Project

General

Profile

Actions

Bug #32188

closed

Verbose log outputs for Ansible jobs are reported to all Hosts present on the Job.

Added by Ondřej Ezr about 3 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Fixed in Releases:
Found in Releases:

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.
~~


Related issues 1 (0 open1 closed)

Related to Ansible - Bug #32030: Using localhost in a playbook causes a crashClosedOndřej EzrActions
Actions #1

Updated by Ondřej Ezr about 3 years ago

  • Related to Bug #32030: Using localhost in a playbook causes a crash added
Actions #2

Updated by The Foreman Bot about 3 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
Actions #3

Updated by Ondřej Ezr about 3 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.

Actions #4

Updated by Ondřej Ezr almost 3 years ago

  • Description updated (diff)
Actions #5

Updated by The Foreman Bot over 2 years ago

  • Pull request https://github.com/theforeman/smart_proxy_ansible/pull/55 added
Actions #6

Updated by The Foreman Bot almost 2 years ago

  • Fixed in Releases smart_proxy_ansible-3.4.0 added
Actions #7

Updated by Anonymous almost 2 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF