Hi,
I’m having trouble passing a user-defined template input (crowdstrike
) from Foreman into an Ansible role using an Ansible Job Template. Here’s what I have configured:
Job Template YAML **
- hosts: all
become: true
gather_facts: true
roles:- role: workgroup_local_liunx_rke_k8s
Inside the role workgroup_local_liunx_rke_k8s/tasks/main.yml:
- name: Install CrowdStrike if enabled
copy:
src: falcon.rpm
dest: /tmp/falcon.rpm
when: howtopasshere == “yes”
If the user selects yes, then the variable crowdstrike should be “yes” and the task should run.
If no, then it should be skipped.
I am trying to understand how to pass to the ansible.
Any help or working example will be appreciated.
Thank you!