Kai Weber
unread,Feb 6, 2015, 9:06:12 AM2/6/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hi,
I am writing a role for varnish. Because Varnish configuration language is
a "real" language I can and will not restrict what configuration a user can
provide. To make it as flexible as possible I planned to use a variable with an
empty default. So a user of my role can provide a complete VCL in a playbook
like this:
- name: Configure varnish host
hosts: 'proxy'
sudo: True
vars:
varnish_vcl_content: |
backend default {
.host = foo
.port = 80
}
roles:
- { role: varnish }
Now my questions:
1. Do you think, this is a good practice?
2. Is there a recommended directory for templates outside of role directories?
Where would you put it? A user can fill the variable like this:
varnish_vcl_content: "{{ lookup('template', 'default.vcl') }}"