mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Add default rsyslog.conf without including /etc/rsyslog.conf
This commit is contained in:
parent
d350551547
commit
4d5507d344
@ -7,7 +7,7 @@ from awx.main.utils.reload import supervisor_service_command
|
||||
|
||||
def construct_rsyslog_conf_template(settings=settings):
|
||||
tmpl = ''
|
||||
parts = ['$IncludeConfig /etc/rsyslog.conf']
|
||||
parts = []
|
||||
if settings.LOG_AGGREGATOR_ENABLED:
|
||||
host = getattr(settings, 'LOG_AGGREGATOR_HOST', '')
|
||||
port = getattr(settings, 'LOG_AGGREGATOR_PORT', '')
|
||||
@ -63,6 +63,10 @@ def construct_rsyslog_conf_template(settings=settings):
|
||||
parts.append(
|
||||
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)
|
||||
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 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 && \
|
||||
ln -sf /dev/stderr /var/log/nginx/error.log
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ services:
|
||||
hostname: awx
|
||||
command: launch_awx.sh
|
||||
environment:
|
||||
PYTHONUNBUFFERED: 1
|
||||
CURRENT_UID:
|
||||
OS:
|
||||
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 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/
|
||||
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
|
||||
|
||||
ENV HOME /var/lib/awx
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user