mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
make rsyslog fall back to no-op if logging is disabled
This commit is contained in:
committed by
Christian Adams
parent
5d54877183
commit
f70a76109c
@@ -25,7 +25,6 @@ def construct_rsyslog_conf_template(settings=settings):
|
|||||||
port = parsed.port
|
port = parsed.port
|
||||||
except ValueError:
|
except ValueError:
|
||||||
port = settings.LOG_AGGREGATOR_PORT
|
port = settings.LOG_AGGREGATOR_PORT
|
||||||
|
|
||||||
max_bytes = settings.MAX_EVENT_RES_DATA
|
max_bytes = settings.MAX_EVENT_RES_DATA
|
||||||
parts.extend([
|
parts.extend([
|
||||||
'$WorkDirectory /var/lib/awx/rsyslog',
|
'$WorkDirectory /var/lib/awx/rsyslog',
|
||||||
@@ -67,6 +66,8 @@ 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:
|
||||||
|
parts.append(f'action(type="omfile" file="/dev/null")') # rsyslog needs *at least* one valid action to start
|
||||||
tmpl = '\n'.join(parts)
|
tmpl = '\n'.join(parts)
|
||||||
return tmpl
|
return tmpl
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user