Ansible_roles_check_mode sometimes doesn’t work…

Problem:

ansible_roles_check_mode = true sometimes doesn’t work…

Expected outcome:

ansible should runs in every circumstance in check mode when I apply the roles.

Foreman and Proxy versions:

foreman (3.14) + katello (4.16.3), smart proxy (3.14)

Foreman and Proxy plugin versions:

foreman_ansible (15.0.7)

Distribution and version:

Red Hat Linux Enterprise 9.6

Other relevant data:

  • I’ve set a global variable “ansible_roles_check_mode” to true.
    • I can see the inherited variable on my hosts
  • Even if I use:
    • the select action “Run Ansible Roles” on the host
    • schedule the job “Ansible Roles - Ansible Default”
    • schedule a clone of the job template: “Ansible Roles - Ansible Default”
  • When It occurs, the reports doesn’t show the banner:
    • Ansible check mode Notice that ansible roles run in check mode.

  • I tried a “kill switch” in the cloned template:
    • - ansible.builtin.fail:
          msg: "ansible_roles_check_mode is {{ ansible_roles_check_mode }}"
        when: ansible_roles_check_mode == false
      
    • Even with this, the var is “true”, the playbook runs, apply roles, and the banner doesn’t show up on the report
  • I cannot find a pattern to reproduce: This occurs in hosts, in random hostgroups.
  • When I apply the jobs, I use the following filter:
    • parent_hostgroup = “foo/bar“