Description of problem: When a check mode is enabled for a host, all Ansible based jobs are a dry-run and no changes are made to the target host. Check mode should apply only for running Ansible roles on host. Version-Release number of selected component (if applicable): 6.10 How reproducible: Steps to Reproduce: 1. Edit a host, add 'ansible_roles_check_mode = true' as a boolean host parameter and submit 2. From a host detail page, choose 'Run Ansible roles' from the dropdown, wait for job to finish, note there were no changes made on host as expected (this step assumes host has Ansible roles already assigned) 3. Go to Monitor -> Jobs, Run Job 4. Choose 'Ansible Packages' as job category, 'Package Action - Ansible default' template and try to install a package on the host which has check mode set to 'true' in step 1 Actual results: Package in step 4 will not be installed Expected results: Package action in step 4 should install package Additional info:
Connecting redmine issue https://projects.theforeman.org/issues/33218 from this bug
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33218 has been resolved.
Failed QA on Satellite 6.10, snap 20 (tfm-rubygem-foreman_ansible-6.3.4-1.el7sat.noarch, tfm-rubygem-smart_proxy_ansible-3.1.1-1.el7sat.noarch). Steps to Test: 1. Register a RHEL 7 host to Satellite 6.10 and assign an Ansible role. 2. In the Satellite webUI, navigate to Hosts > All Hosts > [hostname] > Edit > Parameters tab. 3. In the "Global Parameters" section, click the "Override" button in the "Actions" column for the "ansible_roles_check_mode" parameter. 4. In the "Host Parameters" section, change the value of the "Value" field from "false" to "true" for the "ansible_roles_check_mode" parameter. 5. Select the "Run Ansible roles" option. 6. When the job completes, navigate back to Hosts > All Hosts > [hostname] and select the "Schedule Remote Job" option. 7. Select the "Ansible Packages" job category and the "Package Action - Ansible Default" job template, set the state to "present," enter a package that is not currently installed on the host in the "name" field, then click the "Submit" button. Expected Results: No changes are made when the Ansible role is run on the host, but the Ansible Packages job successfully installs the package. Actual Results: No changes are made by either the Ansible role or the Ansible Packages job, although the Ansible Packages job reports that it completed successfully. After changing the value of the "ansible_roles_check_mode" parameter back to false, re-running the Ansible Packages job successfully installs the package.
Verified on Satellite 6.11 - 16 Steps to Test: 1. Register a RHEL 7 host to Satellite 6.10 and assign an Ansible role. 2. In the Satellite webUI, navigate to Hosts > All Hosts > [hostname] > Edit > Parameters tab. 3. In the "Global Parameters" section, click the "Override" button in the "Actions" column for the "ansible_roles_check_mode" parameter. 4. In the "Host Parameters" section, change the value of the "Value" field from "false" to "true" for the "ansible_roles_check_mode" parameter. 5. Select the "Run Ansible roles" option. 6. When the job completes, navigate back to Hosts > All Hosts > [hostname] and select the "Schedule Remote Job" option. 7. Select the "Ansible Packages" job category and the "Package Action - Ansible Default" job template, set the state to "present," enter a package that is not currently installed on the host in the "name" field, then click the "Submit" button. Expected Results: No changes are made when the Ansible role is run on the host, but the Ansible Packages job successfully installs the package. Actual Results: No changes are made when the Ansible role is run on the host, but the Ansible Packages job successfully installs the package.
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 (Moderate: Satellite 6.11 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-2022:5498