diff --git a/docsite/latest/rst/intro_configuration.rst b/docsite/latest/rst/intro_configuration.rst index feb4aaf5786..d73de48c496 100644 --- a/docsite/latest/rst/intro_configuration.rst +++ b/docsite/latest/rst/intro_configuration.rst @@ -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 `_. .. _lookup_plugins: diff --git a/docsite/latest/rst/intro_getting_started.rst b/docsite/latest/rst/intro_getting_started.rst index e03ff82171d..46f28062f99 100644 --- a/docsite/latest/rst/intro_getting_started.rst +++ b/docsite/latest/rst/intro_getting_started.rst @@ -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 `_. 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` diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py index 7861c23ecb7..dbc1957b099 100644 --- a/lib/ansible/utils/template.py +++ b/lib/ansible/utils/template.py @@ -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: