summaryrefslogtreecommitdiff
path: root/hacking
diff options
context:
space:
mode:
authorStephen Fromm <stephenf@nero.net>2012-11-09 22:13:00 -0800
committerStephen Fromm <stephenf@nero.net>2012-11-11 00:14:08 -0800
commit06e54c0b970910881525da00df1f2d78517b1ed1 (patch)
tree140417f47a846a524d005a18564636c5391269f1 /hacking
parent40e49b6a5a4ef75f8b412511f0cac07c98c53e4c (diff)
downloadansible-06e54c0b970910881525da00df1f2d78517b1ed1.tar.gz
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.
Diffstat (limited to 'hacking')
-rwxr-xr-xhacking/test-module2
1 files changed, 2 insertions, 0 deletions
diff --git a/hacking/test-module b/hacking/test-module
index f953c15b9c..240eb130d9 100755
--- a/hacking/test-module
+++ b/hacking/test-module
@@ -35,6 +35,7 @@ import traceback
import optparse
import ansible.utils as utils
import ansible.module_common as module_common
+import ansible.constants as C
try:
import json
@@ -83,6 +84,7 @@ def boilerplate_module(modfile, args):
module_data = module_data.replace(module_common.REPLACER, module_common.MODULE_COMMON)
encoded_args = "\"\"\"%s\"\"\"" % args.replace("\"","\\\"")
module_data = module_data.replace(module_common.REPLACER_ARGS, encoded_args)
+ module_data = module_data.replace('syslog.LOG_USER', "syslog.%s" % C.DEFAULT_SYSLOG_FACILITY)
modfile2_path = os.path.expanduser("~/.ansible_module_generated")
print "* including generated source, if any, saving to: %s" % modfile2_path