mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Merge pull request #336 from sfromm/issue122
Issue122 - have all modules log to syslog
This commit is contained in:
@@ -32,6 +32,7 @@ import re
|
||||
import sys
|
||||
import shlex
|
||||
import subprocess
|
||||
import syslog
|
||||
|
||||
# ===========================================
|
||||
# Basic support methods
|
||||
@@ -58,6 +59,8 @@ if not os.path.exists(argfile):
|
||||
|
||||
args = open(argfile, 'r').read()
|
||||
items = shlex.split(args)
|
||||
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
||||
syslog.syslog(syslog.LOG_NOTICE, 'Invoked with %s' % args)
|
||||
|
||||
if not len(items):
|
||||
fail_json(msg="the command module requires arguments (-a)")
|
||||
|
||||
Reference in New Issue
Block a user