How Do You Get an Ansible Playbook to Change a Variable Based on a Conditional?

Problem scenario
You do not want to manipulate a variable using a shell: or command: key word. You want a variable to be changed based on conditional logic. What do you do?

Use "set_fact:" and "when:"

Here is an example:

vara: False
when: "{{ foobar }}" == 35

Leave a comment

Your email address will not be published. Required fields are marked *