Skip to content

Instantly share code, notes, and snippets.

@CalvinHartwell
Last active September 28, 2017 13:41
Show Gist options
  • Select an option

  • Save CalvinHartwell/62f6d8d2d6decb88a1c616c1a7669942 to your computer and use it in GitHub Desktop.

Select an option

Save CalvinHartwell/62f6d8d2d6decb88a1c616c1a7669942 to your computer and use it in GitHub Desktop.
Example ansible error with nested when in role
# works fine:
- name: generate kittens to take over the world
hosts: places_where_dogs_reside
gather_facts: yes
roles:
- { role: train-kitten-for-battle, topics: ["whiskers"], partitions: 6, replication: 2}
# does not work:
- name: generate kittens to take over the world
hosts: places_where_dogs_reside
gather_facts: yes
roles:
- { role: train-kitten-for-battle, when: ansible_os_family == "Debian", namespaces: ['fluffy', 'brown','cat'], topics: ["whiskers"], partitions: 6, replication: 2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment