Skip to content

Instantly share code, notes, and snippets.

@joshuaconner
Created February 13, 2014 23:32
Show Gist options
  • Save joshuaconner/8986237 to your computer and use it in GitHub Desktop.
Save joshuaconner/8986237 to your computer and use it in GitHub Desktop.
Ansible: possible to pass a dict to a module?
---
- name: Ensure nginx is set up
tasks:
- name: Ensure nginx is installed
apt: pkg=nginx
- name: Ensure nginx.conf is in place
template: "{{ nginx_template_opts }}"
notify: restart nginx
---
nginx_template_opts:
src: templates/nginx.conf.j2
dest: /etc/nginx/nginx.conf
@joshuaconner
Copy link
Author

It's not optimal, but this works:


---
nginx_template_opts: src=templates/nginx.conf.j2 dest=/etc/nginx/nginx.conf

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