Created
December 5, 2013 20:46
-
-
Save natefoo/7813567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# file: test.yml | |
- hosts: localhost | |
vars: | |
foodata: null | |
roles: | |
- { role: foo, when: foodata } | |
--- | |
# file: roles/foo/tasks/main.yml | |
- debug: msg="task1" | |
- debug: msg="task2" | |
with_subelements: | |
- foodata | |
- barsub | |
- debug: msg="task3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ansible-playbook -i hosts test.yml | |
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [foo | debug msg="task1"] *********************************************** | |
skipping: [localhost] | |
TASK: [foo | debug msg="task2"] *********************************************** | |
fatal: [localhost] => subelements lookup expects a dictionary, got 'None' | |
FATAL: all hosts have already failed -- aborting | |
PLAY RECAP ******************************************************************** | |
to retry, use: --limit @test.retry | |
localhost : ok=1 changed=0 unreachable=1 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment