Skip to content

Instantly share code, notes, and snippets.

@dlam26
Last active February 3, 2016 23:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlam26/b14da005556095490e26 to your computer and use it in GitHub Desktop.
Save dlam26/b14da005556095490e26 to your computer and use it in GitHub Desktop.
how do i collect all the "app" ips in this pillar list to make a comma-separated string like... 172.31.23.64,1.2.3.4,etc.
hosts: # production
app:
- name: app
ip: 172.31.23.64
full_host: foo-bar-baz@saltstack.com
- name: fakeapp
ip: 1.2.3.4
full_host: here-just-to-test-salt-template-iteration@foo.com
@jcockhren
Copy link

probably something like (not tested, tho):

{% for name,ip,full_host in pillar['hosts']['app'].items() %}
my name is {{name}}
{% endfor %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment