diff options
author | Jordan Borean <jborean93@gmail.com> | 2020-04-16 20:25:09 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 20:25:09 +1000 |
commit | de6b047fc3e6a9d23921574de55813fa25657d4b (patch) | |
tree | 97d8301424f8b708891a3913540b908d6209960d | |
parent | 702949e64c4eec7f40a920ea72a2f47e28ca53b3 (diff) | |
download | ansible-de6b047fc3e6a9d23921574de55813fa25657d4b.tar.gz |
Add variable for DEFAULT_NO_TARGET_SYSLOG (#68971)
* Add variable for DEFAULT_NO_TARGET_SYSLOG
* Added version_added to new var
-rw-r--r-- | changelogs/fragments/no_target_syslog-var.yaml | 2 | ||||
-rw-r--r-- | lib/ansible/config/base.yml | 7 | ||||
-rw-r--r-- | lib/ansible/plugins/action/__init__.py | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/changelogs/fragments/no_target_syslog-var.yaml b/changelogs/fragments/no_target_syslog-var.yaml new file mode 100644 index 0000000000..9929a690bd --- /dev/null +++ b/changelogs/fragments/no_target_syslog-var.yaml @@ -0,0 +1,2 @@ +minor_changes: +- Added the ability to set ``DEFAULT_NO_TARGET_SYSLOG`` through the ``ansible_no_target_syslog`` variable on a task diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 981c003b59..dfb5fd136d 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -897,10 +897,15 @@ DEFAULT_NO_LOG: DEFAULT_NO_TARGET_SYSLOG: name: No syslog on target default: False - description: Toggle Ansible logging to syslog on the target when it executes tasks. + description: + - Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts this will disable a newer + style PowerShell modules from writting to the event log. env: [{name: ANSIBLE_NO_TARGET_SYSLOG}] ini: - {key: no_target_syslog, section: defaults} + vars: + - name: ansible_no_target_syslog + version_added: '2.10' type: boolean yaml: {key: defaults.no_target_syslog} DEFAULT_NULL_REPRESENTATION: diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 967c5b027c..89b80fb78b 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -714,7 +714,8 @@ class ActionBase(with_metaclass(ABCMeta, object)): module_args['_ansible_check_mode'] = False # set no log in the module arguments, if required - module_args['_ansible_no_log'] = self._play_context.no_log or C.DEFAULT_NO_TARGET_SYSLOG + no_target_syslog = C.config.get_config_value('DEFAULT_NO_TARGET_SYSLOG', variables=task_vars) + module_args['_ansible_no_log'] = self._play_context.no_log or no_target_syslog # set debug in the module arguments, if required module_args['_ansible_debug'] = C.DEFAULT_DEBUG |