Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variable for DEFAULT_NO_TARGET_SYSLOG #68971

Merged
merged 2 commits into from Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions 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
7 changes: 6 additions & 1 deletion lib/ansible/config/base.yml
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/plugins/action/__init__.py
Expand Up @@ -714,7 +714,8 @@ def _update_module_args(self, module_name, module_args, task_vars):
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
Expand Down