1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

don't assume all delegation subkeys exist (#43032)

* don't assume all delegation subkeys exist

fixes #43026

* add tests
This commit is contained in:
Brian Coca 2018-07-24 08:54:58 -04:00 committed by GitHub
parent bf544c2200
commit cdc762dd9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -126,7 +126,8 @@ class TaskResult:
if sub in self._result:
x[sub] = {}
for key in _SUB_PRESERVE[sub]:
x[sub][key] = self._result[sub][key]
if key in self._result[sub]:
x[sub][key] = self._result[sub][key]
result._result = x
elif self._result:

View file

@ -0,0 +1,8 @@
- hosts: testhost
gather_facts: false
tasks:
- name: no log filtering caused delegation to fail https://github.com/ansible/ansible/issues/43026
become: False
no_log: true
debug:
delegate_to: localhost

View file

@ -8,3 +8,5 @@ ANSIBLE_SSH_ARGS='-C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHos
ansible-playbook test_loop_control.yml -v "$@"
ansible-playbook test_delegate_to_loop_randomness.yml -v "$@"
ansible-playbook delegate_and_nolog.yml -v "$@"