Jenkins has a Boolean parameter mycheck
which gets passed to ansible playbook like below:
ansible-playbook -i /var/myserver.hosts /var/testplay.yml -e mycheck=$mycheck
The above translates to the below when the checkbox is unchecked:
ansible-playbook -i /var/myserver.hosts /var/testplay.yml -e mycheck=False
cat /var/testplay.yml
- debug:
msg: "mycheck is True"
when: not mycheck
However, the above debug gets skipped when I was expecting the when
condition to be true and print.
Can you please suggest why not mycheck
is not translated to "true" and the when
condition met ?