Hi everyone,
Where do you usually put files or templates that are just used in a certain play but are not part of a role? Currently I do have them just alongside my playbooks organised by play
someplay.yml files/ someplay/somefile someotherplay/someotherfile templates someplay/sometemplate.j2 someotherplay/someothertemplate.j2
This however is a bit awkward when using it in a play since I always have to specify the play subfolder in files/ or templates/
`
- name: Copy extensions.conf
copy: src=files/someplay/extensions.conf dest=/etc/extensions.conf
`
Now this can be easily solved by converting that particular playbook into a role and then just using ‘templates/somethemplate.js’ and ‘files/somefile’ without the ‘play’ subdirectory. That however has the side-effect that I’d have a rather stupid playbook that just includes a role, which I find rather annoying:
`
- name: Configure server
hosts: mysinglehost
roles: - role: custom_configure_server_role
`
I’ve heard from other ansible guys that they treat ‘everything as a role’. Maybe it’s just me but I find that opening a playbook just to find out that it contains just one custom role a bit redundant. How do you guys usually do this?
Cheers!