mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 05:17:36 -02:30
Add rsyslog config to container from file for consistency
This commit is contained in:
@@ -65,14 +65,6 @@ 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
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
# If logging is disabled, add a valid config and discard all messages
|
|
||||||
parts = [
|
|
||||||
'$WorkDirectory /var/lib/awx/rsyslog',
|
|
||||||
'$IncludeConfig /etc/rsyslog.d/*.conf',
|
|
||||||
'*.* stop'
|
|
||||||
f'action(type="omfwd" target="localhost" port="9000" protocol="udp")'
|
|
||||||
]
|
|
||||||
tmpl = '\n'.join(parts)
|
tmpl = '\n'.join(parts)
|
||||||
return tmpl
|
return tmpl
|
||||||
|
|
||||||
|
|||||||
4
installer/roles/image_build/files/rsyslog.conf
Normal file
4
installer/roles/image_build/files/rsyslog.conf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$WorkDirectory /var/lib/awx/rsyslog
|
||||||
|
$IncludeConfig /etc/rsyslog.d/*.conf
|
||||||
|
*.* stop
|
||||||
|
action(type="omfwd" target="localhost" port="9000" protocol="udp")
|
||||||
@@ -101,7 +101,7 @@ ADD rsyslog.repo /etc/yum.repos.d/
|
|||||||
RUN yum install -y rsyslog-omhttp
|
RUN yum install -y rsyslog-omhttp
|
||||||
|
|
||||||
# Pre-create things that we need to write to
|
# Pre-create things that we need to write to
|
||||||
RUN for dir in /home/awx /var/run/supervisor /var/lib/awx/rsyslog /var/run/rsyslog /var/log/tower /var/log/nginx /var/lib/nginx; \
|
RUN for dir in /home/awx /var/run/supervisor /var/lib/awx /var/lib/awx/rsyslog /var/run/rsyslog /var/log/tower /var/log/nginx /var/lib/nginx; \
|
||||||
do mkdir -p $dir; chmod -R g+rwx $dir; chgrp -R root $dir; done && \
|
do mkdir -p $dir; chmod -R g+rwx $dir; chgrp -R root $dir; done && \
|
||||||
\
|
\
|
||||||
for file in /etc/passwd /var/run/nginx.pid; \
|
for file in /etc/passwd /var/run/nginx.pid; \
|
||||||
@@ -116,7 +116,7 @@ RUN find /var/lib/awx -not -path '/var/lib/awx/venv*' | xargs chgrp root && \
|
|||||||
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
|
# 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
|
ADD rsyslog.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 && \
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ data:
|
|||||||
rsyslog-config: |
|
rsyslog-config: |
|
||||||
$WorkDirectory /var/lib/awx/rsyslog
|
$WorkDirectory /var/lib/awx/rsyslog
|
||||||
$IncludeConfig /etc/rsyslog.d/*.conf
|
$IncludeConfig /etc/rsyslog.d/*.conf
|
||||||
|
*.* stop
|
||||||
|
action(type="omfwd" target="localhost" port="9000" protocol="udp")
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ ADD tools/docker-compose/entrypoint.sh /
|
|||||||
ADD tools/scripts/awx-python /usr/bin/awx-python
|
ADD tools/scripts/awx-python /usr/bin/awx-python
|
||||||
|
|
||||||
# Pre-create things that we need to write to
|
# Pre-create things that we need to write to
|
||||||
RUN for dir in /var/lib/awx/rsyslog /var/run/rsyslog /var/log/tower/ /var/lib/awx/projects /.ansible /var/log/nginx /var/lib/nginx /.local; \
|
RUN for dir in /var/lib/awx /var/lib/awx/rsyslog /var/run/rsyslog /var/log/tower/ /var/lib/awx/projects /.ansible /var/log/nginx /var/lib/nginx /.local; \
|
||||||
do mkdir -p $dir; chmod -R g+rwx $dir; chgrp -R root $dir; done && \
|
do mkdir -p $dir; chmod -R g+rwx $dir; chgrp -R root $dir; done && \
|
||||||
\
|
\
|
||||||
for file in /etc/passwd /etc/supervisord.conf /venv/awx/lib/python3.6/site-packages/awx.egg-link /var/run/nginx.pid; \
|
for file in /etc/passwd /etc/supervisord.conf /venv/awx/lib/python3.6/site-packages/awx.egg-link /var/run/nginx.pid; \
|
||||||
@@ -133,7 +133,7 @@ RUN for dir in /var/lib/awx/rsyslog /var/run/rsyslog /var/log/tower/ /var/lib/aw
|
|||||||
RUN chmod -R 0775 /var/lib/awx /var/lib/awx/rsyslog
|
RUN chmod -R 0775 /var/lib/awx /var/lib/awx/rsyslog
|
||||||
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 -e '$WorkDirectory /var/lib/awx/rsyslog\n$IncludeConfig /etc/rsyslog.d/*.conf' >> /var/lib/awx/rsyslog/rsyslog.conf
|
ADD tools/docker-compose/rsyslog.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
|
||||||
|
|||||||
4
tools/docker-compose/rsyslog.conf
Normal file
4
tools/docker-compose/rsyslog.conf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$WorkDirectory /var/lib/awx/rsyslog
|
||||||
|
$IncludeConfig /etc/rsyslog.d/*.conf
|
||||||
|
*.* stop
|
||||||
|
action(type="omfwd" target="localhost" port="9000" protocol="udp")
|
||||||
Reference in New Issue
Block a user