Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1829487 - Ansible verbosity level does not work
Summary: Ansible verbosity level does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.8.0
Assignee: Nagoor Shaik
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-29 15:54 UTC by mithun kalyat
Modified: 2024-03-25 15:52 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-foreman_ansible_core-3.0.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:02:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29627 0 Normal Closed ansible-runner verbosity doesn't show verbose output 2021-02-16 10:43:47 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:02:24 UTC

Description mithun kalyat 2020-04-29 15:54:07 UTC
Description of problem:

With Satellite 6.7, ansible-runner is the default implementation of running playbooks. It seems we missed adding the code to append the verbosity to the ansible-runner.

Version-Release number of selected component (if applicable):

Red Hat Satellite 6.7

Comment 3 Bryan Kearney 2020-04-30 12:15:30 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29627 has been resolved.

Comment 4 Lukas Pramuk 2020-09-21 22:32:40 UTC
FailedQA.

@Satellite 6.8.0 Snap16
tfm-rubygem-foreman_ansible_core-3.0.3-1.el7sat.noarch

by the following manual reproducer:

1) Set ansible verbosity level to 'Level 4' (-vvvv) at Administer -> Settings -> tab Ansible - item 'Default verbosity level' 

2) Run ansible REX command "sleep 1000" against a host 

3) Check with what params ansible-runner runs

# ps -efH | grep -A3 [/]smart_proxy_dynflow_core
foreman+  2455     1  0 Sep18 ?        00:01:35   ruby /usr/bin/smart_proxy_dynflow_core --no-daemonize
foreman+ 11441  2455  0 18:07 pts/1    00:00:00     /usr/bin/python2 /usr/bin/ansible-runner run /tmp/d20200921-2455-whv99n -p playbook.yml
foreman+ 11446 11441 12 18:07 pts/2    00:01:18       /usr/bin/python2 /usr/bin/ansible-playbook -i /tmp/d20200921-2455-whv99n/inventory playbook.yml
foreman+ 11906 11446  0 18:07 pts/2    00:00:00         /usr/bin/python2 /usr/bin/ansible-playbook -i /tmp/d20200921-2455-whv99n/inventory playbook.yml

>>> ansible-runner is not run with -vvvv

Note:

# ansible-playbook -h | grep -A1 '\-v[, ]'
  -v, --verbose         verbose mode (-vvv for more, -vvvv to enable
                        connection debugging)
# ansible-runner -h | grep -A1 '\-v[, ]'
  -v                    increase the verbosity with multiple v's (up to 5) of
                        the ansible-playbook output (default=None)

>>> ansible-runner has maximal verbosity 5 (used by satellite) while ansible-playbook has maximal verbosity only 4

Comment 5 Lukas Pramuk 2020-09-21 22:36:18 UTC
Oops.

The fix is not present, rel-eng failure:

# grep -A4 'def start_ansible_runner' /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible_core-*/lib/foreman_ansible_core/runner/ansible_runner.rb
      def start_ansible_runner
        command = ['ansible-runner', 'run', @root, '-p', 'playbook.yml']
        initialize_command(*command)
        logger.debug("[foreman_ansible] - Running command '#{command.join(' ')}'")
      end

>>> the line from fix "command << verbosity if verbose?" is missing

Comment 6 Marek Hulan 2020-09-22 14:37:10 UTC
We need to pull in newer foreman_ansible_core, I'll work on a new 3.0.4 release and will update the BZ shortly.

Comment 7 Marek Hulan 2020-09-22 14:56:42 UTC
New version with the fix published, packaging PR opened at https://github.com/theforeman/foreman-packaging/pull/5836

Comment 8 Lukas Pramuk 2020-10-06 07:38:30 UTC
VERIFIED.

@Satellite 6.8.0 Snap18
tfm-rubygem-foreman_ansible_core-3.0.4-1.el7sat.noarch

by the following manual reproducer:

1) Set ansible verbosity level to 'Level 4' (-vvvv) at Administer -> Settings -> tab Ansible - item 'Default verbosity level' 

2) Run ansible REX command "sleep 1000" against a host 

3) Check with what params ansible-runner runs

# ps -efH | grep -A3 [/]smart_proxy_dynflow_core
foreman+ 11286     1  0 Oct03 ?        00:01:16   ruby /usr/bin/smart_proxy_dynflow_core --no-daemonize
foreman+ 73414 11286  0 03:33 pts/1    00:00:00     /usr/bin/python2 /usr/bin/ansible-runner run /tmp/d20201006-11286-1jo2m29 -p playbook.yml -vvvv
foreman+ 73420 73414  6 03:33 pts/2    00:00:03       /usr/bin/python2 /usr/bin/ansible-playbook -i /tmp/d20201006-11286-1jo2m29/inventory -vvvv playbook.yml
foreman+ 73643 73420  0 03:33 pts/2    00:00:00         /usr/bin/python2 /usr/bin/ansible-playbook -i /tmp/d20201006-11286-1jo2m29/inventory -vvvv playbook.yml

>>> ansible-runner is run with -vvvv

Comment 11 errata-xmlrpc 2020-10-27 13:02:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4366


Note You need to log in before you can comment on or make changes to this bug.