Skip to content

Instantly share code, notes, and snippets.

@chrrrles
Created February 1, 2017 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrrrles/8e5e8a8af17ae0037ed6dc3c8e6017a6 to your computer and use it in GitHub Desktop.
Save chrrrles/8e5e8a8af17ae0037ed6dc3c8e6017a6 to your computer and use it in GitHub Desktop.
How to use jinja select and filter in ansible
# 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