March 2019
Intermediate to advanced
412 pages
9h 49m
English
Task and handler modules can reference files relatively within roles/<role_name>/files/. The filename can be provided without any prefix and will be sourced from roles/<role_name>/files/<file_name>. Relative prefixes are allowed as well, in order to access files within subdirectories of roles/<role_name>/files/. Modules such as template, copy, and script may take advantage of this.
Similarly, templates used by the template module can be referenced relatively within roles/<role_name>/templates/. This sample code uses a relative path to load the derp.j2 template from the full roles/<role_name>/templates/herp/derp.j2 path:
- name: configure herp
template:
src: herp/derp.j2
dest: /etc/herp/derp.j2
In this way, it is easy ...
Read now
Unlock full access