Bug #32188
closedVerbose log outputs for Ansible jobs are reported to all Hosts present on the Job.
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1912941
and is also related to https://bugzilla.redhat.com/show_bug.cgi?id=1943347
Description of problem:
When enabling very very verbose mode in Ansible settings, the task is generating the debug output log for all hosts present on the Job.
This also applies for deprecation warnings.
Version-Release number of selected component (if applicable):
Red Hat Satellite (build: 6.8.2)
How reproducible:
Enable the debug mode on settings and run the Ansible Default Template on more than one host.
Steps to Reproduce:
1. Enable Ansible Debug (-vvv)
2. Select two or more hosts.
3. Run ansible roles on those hosts.
4. Check the host execution logs.
Actual results:
The host execution log is showing the debug log for all hosts present on the inventory instead of just the expected host.
It's causing a huge delay on the task and makes the time 10 times slower.
Expected results:
Just the debug output log for the host that the output is being checked.
Additional info:
Following a small snippet of debug code example.
~~
32:
TASK [Gathering Facts] *************************************************
33:
task path: /tmp/d20210105-14561-c8qt93/project/playbook.yml:2
34:
<host1.example.com> ESTABLISH SSH CONNECTION FOR USER: root
35:
<host1.example.com> SSH: EXEC sshpass -d8 ssh -o ProxyCommand=none -o StrictHostKeyChecking=no -o Port=22 -o 'IdentityFile="/usr/share/foreman-proxy/.ssh/id_rsa_foreman_proxy"' -o 'User="root"' -o ConnectTimeout=10 host1.example.com '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
36:
<host2.example.com> ESTABLISH SSH CONNECTION FOR USER: root
37:
<host2.example.com> SSH: EXEC sshpass -d8 ssh -o ProxyCommand=none -o StrictHostKeyChecking=no -o Port=22 -o 'IdentityFile="/usr/share/foreman-proxy/.ssh/id_rsa_foreman_proxy"' -o 'User="root"' -o ConnectTimeout=10 host2.example.com '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
~~
From the other BZ:
An example where the error is on host2, however, the playbook is ran against host1:
~~
TASK [Gathering Facts]**********************************************************
ok: [host1]
[DEPRECATION WARNING]: Distribution redhat 8.3 on host host2 should use /usr/libexec/platform-python, but is using
/usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the
discovered platform python for this host. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. This feature will
be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
~~
Updated by Ondřej Ezr almost 4 years ago
- Related to Bug #32030: Using localhost in a playbook causes a crash added
Updated by The Foreman Bot almost 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ondřej Ezr
- Pull request https://github.com/theforeman/foreman_ansible/pull/398 added
Updated by Ondřej Ezr almost 4 years ago
- Subject changed from Verbose log outputs for Ansible jobs are reported to all Hosts present on the Job. to Verbose log outputs for Ansible jobs are reported to all Hosts present on the Job.
For reference we are reading the data from these files: https://ansible-runner.readthedocs.io/en/stable/intro.html#runner-artifact-job-events-host-and-playbook-events we are looking for event_data['host'] now, but we could use event_data['remote_addr'] for the verbose communication events to sort at least some trafic.
Updated by The Foreman Bot about 3 years ago
- Pull request https://github.com/theforeman/smart_proxy_ansible/pull/55 added
Updated by The Foreman Bot over 2 years ago
- Fixed in Releases smart_proxy_ansible-3.4.0 added
Updated by Anonymous over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset smart_proxy_ansible|6398f95f52c53adc66f9d5bc23a26df71adff93c.