Created
February 1, 2017 08:42
-
-
Save chrrrles/8e5e8a8af17ae0037ed6dc3c8e6017a6 to your computer and use it in GitHub Desktop.
How to use jinja select and filter in ansible
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
# test.yml | |
--- | |
- hosts: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
my_list: | |
- one | |
- two | |
- three | |
tasks: | |
- debug: msg="{{ item }}" | |
with_items: "{{my_list | reject('equalto', 'one')|list }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment