Skip to content

Instantly share code, notes, and snippets.

@lanky
Created October 3, 2016 15:16
Show Gist options
  • Select an option

  • Save lanky/e3c3d5751c6b33388e343ef72de5217e to your computer and use it in GitHub Desktop.

Select an option

Save lanky/e3c3d5751c6b33388e343ef72de5217e to your computer and use it in GitHub Desktop.
---
# vim: set ft=ansible:
- name: subelements
hosts: localhost
gather_facts: no
vars:
static_hosts:
- host: test1
ips:
- 192.168.0.1
- 192.168.0.2
- 192.168.0.3
- host: test2
ips:
- 127.0.0.1
- 127.0.1.1
- 127.1.0.1
tasks:
- name: iterthingies
debug:
msg: "{{ item.0.host }} = {{ item.1 }}"
with_subelements:
- static_hosts
- ips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment