Problem:
We’d like to use “ansible_roles_check_mode = true” with a custom Job template that runs a single role based on user input.
When we run the the below Job template the “ansible_roles_check_mode = true” parameter is being ignored.
Write now “ansible_roles_check_mode = true” is a global parameter but I’ve tried as hostgroup and host level too.
When using the default “Ansible Roles - Ansible Default” Job Template for all Ansible roles “ansible_roles_check_mode = true” works as expected.
Expected outcome:
Single Ansible role is ran against a remote host with “ansible_roles_check_mode = true” using custom Job template.
Foreman and Proxy versions:
3.1.1.3
Foreman and Proxy plugin versions:
foreman_ansible 7.0.4.1
Distribution and version:
Red Hat 7.9
Other relevant data:
This is our custom Job template that takes user input for the role name(s):
- hosts: all
pre_tasks:
- name: Display all parameters known for the Foreman host
debug:
var: foreman
tags:
- always
vars:
rolename: <%= input('rolename') %>
tasks:
- name: Apply Ansible Specific roles
include_role:
name: "{{ item }}"
tags:
- always
with_items: "{{ rolename }}"