mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 18:37:39 -02:30
Add default rsyslog.conf without including /etc/rsyslog.conf
This commit is contained in:
@@ -7,7 +7,7 @@ from awx.main.utils.reload import supervisor_service_command
|
|||||||
|
|
||||||
def construct_rsyslog_conf_template(settings=settings):
|
def construct_rsyslog_conf_template(settings=settings):
|
||||||
tmpl = ''
|
tmpl = ''
|
||||||
parts = ['$IncludeConfig /etc/rsyslog.conf']
|
parts = []
|
||||||
if settings.LOG_AGGREGATOR_ENABLED:
|
if settings.LOG_AGGREGATOR_ENABLED:
|
||||||
host = getattr(settings, 'LOG_AGGREGATOR_HOST', '')
|
host = getattr(settings, 'LOG_AGGREGATOR_HOST', '')
|
||||||
port = getattr(settings, 'LOG_AGGREGATOR_PORT', '')
|
port = getattr(settings, 'LOG_AGGREGATOR_PORT', '')
|
||||||
@@ -63,6 +63,10 @@ def construct_rsyslog_conf_template(settings=settings):
|
|||||||
parts.append(
|
parts.append(
|
||||||
f'action(type="omfwd" target="{host}" port="{port}" protocol="{protocol}" action.resumeRetryCount="-1" template="awx")' # noqa
|
f'action(type="omfwd" target="{host}" port="{port}" protocol="{protocol}" action.resumeRetryCount="-1" template="awx")' # noqa
|
||||||
)
|
)
|
||||||
|
parts.extend([
|
||||||
|
'$WorkDirectory /var/lib/awx/rsyslog',
|
||||||
|
'$IncludeConfig /etc/rsyslog.d/*.conf'
|
||||||
|
])
|
||||||
tmpl = '\n'.join(parts)
|
tmpl = '\n'.join(parts)
|
||||||
return tmpl
|
return tmpl
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,10 @@ RUN find /var/lib/awx -not -path '/var/lib/awx/venv*' | xargs chgrp root && \
|
|||||||
chmod +rx /usr/bin/config-watcher && \
|
chmod +rx /usr/bin/config-watcher && \
|
||||||
chmod u+s /usr/bin/bwrap # https://github.com/ansible/awx/issues/5224
|
chmod u+s /usr/bin/bwrap # https://github.com/ansible/awx/issues/5224
|
||||||
|
|
||||||
|
# Create default awx rsyslog.conf
|
||||||
|
RUN echo -e '$WorkDirectory /var/lib/awx/rsyslog\n$IncludeConfig /etc/rsyslog.d/*.conf' >> /var/lib/awx/rsyslog/rsyslog.conf
|
||||||
|
|
||||||
|
|
||||||
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
|
||||||
ln -sf /dev/stderr /var/log/nginx/error.log
|
ln -sf /dev/stderr /var/log/nginx/error.log
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ services:
|
|||||||
hostname: awx
|
hostname: awx
|
||||||
command: launch_awx.sh
|
command: launch_awx.sh
|
||||||
environment:
|
environment:
|
||||||
|
PYTHONUNBUFFERED: 1
|
||||||
CURRENT_UID:
|
CURRENT_UID:
|
||||||
OS:
|
OS:
|
||||||
SDB_HOST: 0.0.0.0
|
SDB_HOST: 0.0.0.0
|
||||||
|
|||||||
@@ -131,10 +131,9 @@ RUN for dir in /var/lib/awx/rsyslog /var/run/tower/rsyslog /var/log/tower/ /var/
|
|||||||
|
|
||||||
|
|
||||||
RUN chmod -R 0775 /var/lib/awx /var/lib/awx/rsyslog
|
RUN chmod -R 0775 /var/lib/awx /var/lib/awx/rsyslog
|
||||||
RUN chmod -R 0770 /var/lib/rsyslog # needed, or else: rsyslogd: imjournal: open on state file `/var/lib/rsyslog/imjournal.state' failed
|
|
||||||
ADD tools/docker-compose/rsyslog.repo /etc/yum.repos.d/
|
ADD tools/docker-compose/rsyslog.repo /etc/yum.repos.d/
|
||||||
RUN yum install -y rsyslog-omhttp
|
RUN yum install -y rsyslog-omhttp
|
||||||
RUN echo '$IncludeConfig /etc/rsyslog.conf' >> /var/lib/awx/rsyslog/rsyslog.conf
|
RUN echo -e '$WorkDirectory /var/lib/awx/rsyslog\n$IncludeConfig /etc/rsyslog.d/*.conf' >> /var/lib/awx/rsyslog/rsyslog.conf
|
||||||
RUN chmod 0775 /var/lib/awx/rsyslog/rsyslog.conf
|
RUN chmod 0775 /var/lib/awx/rsyslog/rsyslog.conf
|
||||||
|
|
||||||
ENV HOME /var/lib/awx
|
ENV HOME /var/lib/awx
|
||||||
|
|||||||
Reference in New Issue
Block a user