You can set a control variable in the vars files located in group_vars/ , or directly in the hosts file as follows:
[vagrant:vars] test_var=true [location-1] 192.168.33.10 hostname=apollo [location-2] 192.168.33.20 hostname=zeus [vagrant:children] location-1 location-2
And complete the following tasks:
- name: "test" command: "echo {{test_var}}" when: test_var is defined and test_var
nvartolomei Jan 08 '14 at 23:37 2014-01-08 23:37
source share