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:
Christian Adams 2020-01-24 13:56:01 -05:00
parent 955d57bce6
commit 4cd0d60711
2 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

@ -31,6 +31,7 @@ awx/ui/templates/ui/installing.html
awx/ui_next/node_modules/
awx/ui_next/coverage/
awx/ui_next/build/locales/_build
rsyslog.pid
/tower-license
/tower-license/**
tools/prometheus/data

View File

@ -22,7 +22,7 @@ def reconfigure_rsyslog():
host = parsed.hostname
try:
port = parsed.port or settings.LOG_AGGREGATOR_PORT
port = parsed.port
except ValueError:
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
ssl = "on" if parsed.scheme == 'https' else "off"
skip_verify = "off" if settings.LOG_AGGREGATOR_VERIFY_CERT else "on"
if not port:
port = 443 if parsed.scheme == 'https' else 80
params = [
'type="omhttp"',
f'server="{host}"',
@ -45,7 +48,10 @@ def reconfigure_rsyslog():
'action.resumeRetryCount="-1"',
'template="awx"',
'errorfile="/var/log/tower/external.err"',
'healthchecktimeout="20000"',
]
if parsed.path:
params.append(f'restpath="{parsed.path[1:]}"')
username = getattr(settings, 'LOG_AGGREGATOR_USERNAME', '')
password = getattr(settings, 'LOG_AGGREGATOR_PASSWORD', '')
if username: