Last active
January 17, 2017 18:13
-
-
Save dekimsey/015e3131625e00878b8bf6cee3aa6f02 to your computer and use it in GitHub Desktop.
cannot filter host_lists with group_by generated groups
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 localhost, filtering-by-group_by.yml | |
- name: Gather facts and partition hosts | |
hosts: '!__partitioned' | |
become: false | |
connection: local | |
tasks: | |
- group_by: | |
key: __skipme | |
- group_by: | |
key: __partitioned | |
- hosts: all | |
become: false | |
connection: local | |
tasks: | |
- debug: var=group_names | |
- hosts: '!all' | |
become: false | |
connection: local | |
tasks: | |
- fail: msg='I should not run, !all filter used' | |
- hosts: '!__skipme' | |
become: false | |
connection: local | |
tasks: | |
- fail: msg='I should not run, !__skipme filter used' | |
- hosts: '!__partitioned' | |
become: false | |
connection: local | |
tasks: | |
- fail: msg='I should not run, !__partitioned filter used' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment