Skip to content

Commit 539d9a3

Browse files
authored
Add changes to run ansible.builtin.template locally (#170)
* Add changes to run a.b.template locally * Add update to documentation Signed-off-by: rsuplina <[email protected]>
1 parent b5b5c88 commit 539d9a3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

roles/assemble_template/meta/argument_specs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ argument_specs:
2121
Discovers fragment files in a specified directory, loops through fragment files
2222
rendering them through M(ansible.builtin.template), places them in a temporary directory,
2323
and then assembles a single, final cluster template.
24+
Fragment files must be located on the Ansible controller since M(ansible.builtin.template) only executes on the controller.
25+
This ensures that the template processing occurs on the Ansible controller machine.
2426
author: "Ronald Suplina <[email protected]>"
2527
options:
2628
cluster_template_fragments_directory:

roles/assemble_template/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
use_regex: yes
2222
recurse: yes
2323
register: fragments
24+
delegate_to: localhost
2425

2526
- name: Create a temporary directory
2627
ansible.builtin.tempfile:
2728
state: directory
2829
register: fragments_temp_directory
30+
delegate_to: localhost
2931

3032
- name: Loop through fragment files and template them
3133
ansible.builtin.template:
@@ -36,6 +38,7 @@
3638
loop_var: __fragment
3739
label: "{{ __fragment.path | basename }}"
3840
when: fragments.matched > 0
41+
delegate_to: localhost
3942

4043
- name: Create cluster template
4144
cloudera.cluster.assemble_cluster_template:

0 commit comments

Comments
 (0)