- Write a Playbook that executes on the "localhost" host. This Playbook should contain five tasks, these task should do the following:
- Print a message when "False"
- Print a message when "True"
- Print a message when a variable is equal to some value (use an existing variable or define one in your Play)
- Print a message when a variable contains a string
- Print a message when a variable does NOT contain a string
Your output should be similar to the following -- note the "skipping" in several of the tasks!
$ ansible-playbook -i inventory.yaml conditionals1.yaml
PLAY [conditionals ex1] ***************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************
ok: [localhost]
TASK [debug] **************************************************************************************************************************
skipping: [localhost]
TASK [debug] **************************************************************************************************************************
ok: [localhost] => {
"msg": "TRUE: Hello World"
}
TASK [debug] **************************************************************************************************************************
ok: [localhost] => {
"msg": "racecars are fast!"
}
TASK [debug] **************************************************************************************************************************
ok: [localhost] => {
"msg": "racecars are still pretty fast!"
}
TASK [debug] **************************************************************************************************************************
skipping: [localhost]
PLAY RECAP ****************************************************************************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=0