I am deploying multiple web applications that all have 4 tasks in common:
`
-
name: copy nginx conf
template:
src=nginx.conf
dest=/etc/nginx/{{ inventory_hostname }}.conf -
enable nginx conf
file:
state=link
… -
name: copy certs
… -
name: copy chain
…
`
To avoid this redundancy, I tried to define a meta role: nginx
with the tasks above and set this role as dependency in every webapp role
`
webapp1-role meta/main.yml
dependencies: {name: nginx, tags: [nginx]}
`
Unfortunately the nginx role does not search in templates
folder of the webapp1-role
Does the nginx
role somehow know about the role it is called with?
Or how would I prevent this redundancy?