Skip to content

Instantly share code, notes, and snippets.

@gorsuch
Created October 22, 2014 01:55
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 gorsuch/5e83a1256b7fe7822b18 to your computer and use it in GitHub Desktop.
Save gorsuch/5e83a1256b7fe7822b18 to your computer and use it in GitHub Desktop.
ansible example of iterating through a dict
---
- hosts: all
sudo: true
vars:
manifest:
1:
librato_user: michael.gorsuch@gmail.com
librato_token: 12345
sites:
1:
url: http://www.canary.io
name: sites.canaryio
tasks:
- name: "create user u.{{ item.key }}"
user:
name: "u.{{ item.key }}"
with_dict: manifest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment