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') }}"

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20150206140645.GA26880%40computer.corp.ebay.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to