Commit d30f7494 authored by R. S.'s avatar R. S.

Update resources role to append to all group_names list the...

Update resources role to append to all group_names list the resources-source-path prefix string during templating. This way all groups in which the inventory-host is will be searched for file templates.
parent ccb5911b
......@@ -104,21 +104,21 @@ resources__group_name: 'nonexistent-host-group'
#
# Directory which contains templates that should be generated on all hosts in
# the Ansible inventory.
resources__templates: '{{ resources__src + "templates/by-group/all" }}'
resources__templates: [ '{{ resources__src + "templates/by-group/all" }}' ]
# ]]]
# .. envvar:: resources__group_templates [[[
#
# Directory which contains templates that should be generated on hosts in
# a specific Ansible inventory group.
resources__group_templates: '{{ resources__src + "templates/by-group/" + resources__group_name }}'
resources__group_templates: '{{ group_names | map("regex_replace", "^(.*)$", resources__src + "templates/by-group/\1") | list }}'
# ]]]
# .. envvar:: resources__host_templates [[[
#
# Directory which contains templates that should be generated on specific hosts
# in the Ansible inventory.
resources__host_templates: '{{ resources__src + "templates/by-host/" + inventory_hostname }}'
resources__host_templates: [ '{{ resources__src + "templates/by-host/" + inventory_hostname }}' ]
# ]]]
# ]]]
# Manage custom paths [[[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment