mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 21:09:09 -07:00
Add ability to specify syslog facility for modules
Update constants.py so that one can specify environmental variable ANSIBLE_SYSLOG_FACILITY or syslog_facility in ansible.cfg to define the syslog facility to use. Alternatively, you can specify ansible_syslog_facility in inventory. Runner now replaces the syslog facility in the openlog() call with the default or the injected variables ansible_syslog_facility. This also updates hacking/test-module to behave similarly.
This commit is contained in:
parent
40e49b6a5a
commit
06e54c0b97
4 changed files with 9 additions and 1 deletions
|
@ -539,7 +539,7 @@ class AnsibleModule(object):
|
|||
journal.sendv(*journal_args)
|
||||
else:
|
||||
msg = ''
|
||||
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
||||
syslog.openlog('ansible-%s' % os.path.basename(__file__), 0, syslog.LOG_USER)
|
||||
for arg in log_args:
|
||||
msg = msg + arg + '=' + str(log_args[arg]) + ' '
|
||||
if msg:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue