I have problem at conditional include playbook:
For example, I am following three simple playbooks:
playbook0.yml:
I have problem at conditional include playbook:
For example, I am following three simple playbooks:
playbook0.yml:
Conditions on include don’t apply to the include itself, it is applied to the tasks included
Thanks Brian.
if condition is apply to the tasks level, the we will expect the task - debug: msg=“incude playbook0.yml” at playbook0.yml should be skipped, but actually it is not.
Here is result:
$ ansible-playbook -i hosts playbook.yml --extra-vars=“run1=true run0=false”
PLAY [test-servers] ***********************************************************
GATHERING FACTS ***************************************************************
ok: [testserver]
TASK: [debug msg=“incude playbook0.yml”] **************************************
ok: [testserver] => {
“msg”: “incude playbook0.yml”
}
PLAY [test-servers] ***********************************************************
GATHERING FACTS ***************************************************************
ok: [testserver]
TASK: [debug msg=“incude playbook1.yml”] **************************************
ok: [testserver] => {
“msg”: “incude playbook1.yml”
}
PLAY RECAP ********************************************************************
testserver : ok=4 changed=0 unreachable=0 failed=0
Thanks
Jack
For starters, what ansible version are you using?
ansible 1.5.5 on Mac.
Please upgrade to the recent 1.7.2 and see if you have any problems.
We cannot support older versions on this list.