mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 20:35:02 -02:30
Properly handle logger paths and https/http configuration
- log aggregator url paths were not being passed to rsyslog - http log services like loggly will now truly use http and port 80 - add rsyslog.pid to .gitignore
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -31,6 +31,7 @@ awx/ui/templates/ui/installing.html
|
|||||||
awx/ui_next/node_modules/
|
awx/ui_next/node_modules/
|
||||||
awx/ui_next/coverage/
|
awx/ui_next/coverage/
|
||||||
awx/ui_next/build/locales/_build
|
awx/ui_next/build/locales/_build
|
||||||
|
rsyslog.pid
|
||||||
/tower-license
|
/tower-license
|
||||||
/tower-license/**
|
/tower-license/**
|
||||||
tools/prometheus/data
|
tools/prometheus/data
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ def reconfigure_rsyslog():
|
|||||||
|
|
||||||
host = parsed.hostname
|
host = parsed.hostname
|
||||||
try:
|
try:
|
||||||
port = parsed.port or settings.LOG_AGGREGATOR_PORT
|
port = parsed.port
|
||||||
except ValueError:
|
except ValueError:
|
||||||
port = settings.LOG_AGGREGATOR_PORT
|
port = settings.LOG_AGGREGATOR_PORT
|
||||||
|
|
||||||
@@ -36,6 +36,9 @@ def reconfigure_rsyslog():
|
|||||||
# https://github.com/rsyslog/rsyslog-doc/blob/master/source/configuration/modules/omhttp.rst
|
# https://github.com/rsyslog/rsyslog-doc/blob/master/source/configuration/modules/omhttp.rst
|
||||||
ssl = "on" if parsed.scheme == 'https' else "off"
|
ssl = "on" if parsed.scheme == 'https' else "off"
|
||||||
skip_verify = "off" if settings.LOG_AGGREGATOR_VERIFY_CERT else "on"
|
skip_verify = "off" if settings.LOG_AGGREGATOR_VERIFY_CERT else "on"
|
||||||
|
if not port:
|
||||||
|
port = 443 if parsed.scheme == 'https' else 80
|
||||||
|
|
||||||
params = [
|
params = [
|
||||||
'type="omhttp"',
|
'type="omhttp"',
|
||||||
f'server="{host}"',
|
f'server="{host}"',
|
||||||
@@ -45,7 +48,10 @@ def reconfigure_rsyslog():
|
|||||||
'action.resumeRetryCount="-1"',
|
'action.resumeRetryCount="-1"',
|
||||||
'template="awx"',
|
'template="awx"',
|
||||||
'errorfile="/var/log/tower/external.err"',
|
'errorfile="/var/log/tower/external.err"',
|
||||||
|
'healthchecktimeout="20000"',
|
||||||
]
|
]
|
||||||
|
if parsed.path:
|
||||||
|
params.append(f'restpath="{parsed.path[1:]}"')
|
||||||
username = getattr(settings, 'LOG_AGGREGATOR_USERNAME', '')
|
username = getattr(settings, 'LOG_AGGREGATOR_USERNAME', '')
|
||||||
password = getattr(settings, 'LOG_AGGREGATOR_PASSWORD', '')
|
password = getattr(settings, 'LOG_AGGREGATOR_PASSWORD', '')
|
||||||
if username:
|
if username:
|
||||||
|
|||||||
Reference in New Issue
Block a user