Enhance references to logging functionality. Fixes #3431.

This commit is contained in:
Michael DeHaan 2013-10-08 08:26:40 -04:00
parent f081c68a65
commit c69e19c6a6
3 changed files with 18 additions and 4 deletions

View file

@ -274,7 +274,10 @@ the user running Ansible has permissions on the logfile.
log_path=/var/log/ansible.log
This behavior is not on by default.
This behavior is not on by default. Note that ansible will, without this setting, record module arguments called to the
syslog of managed machines. Password arguments are excluded.
For Enterprise users seeking more detailed logging history, you may be interested in `AnsibleWorks AWX <http://ansibleworks.com/ansibleworks-awx>`_.
.. _lookup_plugins:

View file

@ -105,8 +105,8 @@ explore, but you already have a fully working infrastructure!
.. _a_note_about_host_key_checking:
A note about Host Key Checking
``````````````````````````````
Host Key Checking
`````````````````
Ansible 1.2.1 and later have host key checking enabled by default.
@ -123,6 +123,11 @@ Alternatively this can be set by an environment variable:
Also note that host key checking in paramiko mode is reasonably slow, therefore switching to 'ssh' is also recommended when using this feature.
.. _a_note_about_logging:
Ansible will log some information about module arguments on the remote system in the remote syslog. To enable basic
logging on the control machine see `intro_config` document and set the 'log_path' configuration file setting. Enterprise users may also be interested in `AnsibleWorks AWX <http://ansibleworks.com/ansibleworks-awx>`_. AWX provides a very robust database logging feature where it is possible to drill down and see history based on hosts, projects, and particular inventories over time -- explorable both graphically and through a REST API.
.. seealso::
:doc:`intro_inventory`

View file

@ -495,6 +495,7 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
# TODO: may need some way of using lookup plugins here seeing we aren't calling
# the legacy engine, lookup() as a function, perhaps?
data = data.decode('utf-8')
try:
t = environment.from_string(data)
except Exception, e:
@ -509,7 +510,12 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
t.globals['lookup'] = my_lookup
res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals, fail_on_undefined), shared=True)))
jvars =_jinja2_vars(basedir, vars, t.globals, fail_on_undefined)
new_context = t.new_context(jvars, shared=True)
rf = t.root_render_func(new_context)
res = jinja2.utils.concat(rf)
return res
except (jinja2.exceptions.UndefinedError, errors.AnsibleUndefinedVariable):
if fail_on_undefined: