From d9d51de3ce20216459a97103727354fab1fe24f3 Mon Sep 17 00:00:00 2001 From: rsuplina Date: Tue, 5 Dec 2023 17:31:44 +0000 Subject: [PATCH 1/2] Add changes to run a.b.template locally Signed-off-by: rsuplina --- roles/assemble_template/meta/argument_specs.yml | 2 ++ roles/assemble_template/tasks/main.yml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/roles/assemble_template/meta/argument_specs.yml b/roles/assemble_template/meta/argument_specs.yml index ed12e794..fdc66960 100644 --- a/roles/assemble_template/meta/argument_specs.yml +++ b/roles/assemble_template/meta/argument_specs.yml @@ -21,6 +21,8 @@ argument_specs: Discovers fragment files in a specified directory, loops through fragment files rendering them through M(ansible.builtin.template), places them in a temporary directory, and then assembles a single, final cluster template. + Fragment files must be stored in the locally since M(ansible.builtin.template) can only run locally. + This ensures that the template processing occurs on the Ansible controller machine. author: "Ronald Suplina " options: cluster_template_fragments_directory: diff --git a/roles/assemble_template/tasks/main.yml b/roles/assemble_template/tasks/main.yml index 28641881..f1e28183 100644 --- a/roles/assemble_template/tasks/main.yml +++ b/roles/assemble_template/tasks/main.yml @@ -21,11 +21,13 @@ use_regex: yes recurse: yes register: fragments + delegate_to: localhost - name: Create a temporary directory ansible.builtin.tempfile: state: directory register: fragments_temp_directory + delegate_to: localhost - name: Loop through fragment files and template them ansible.builtin.template: @@ -36,6 +38,7 @@ loop_var: __fragment label: "{{ __fragment.path | basename }}" when: fragments.matched > 0 + delegate_to: localhost - name: Create cluster template cloudera.cluster.assemble_cluster_template: From 26aec571719251df572bd68574ba64f7a94d0eee Mon Sep 17 00:00:00 2001 From: rsuplina Date: Wed, 6 Dec 2023 14:19:11 +0000 Subject: [PATCH 2/2] Add update to documentation Signed-off-by: rsuplina --- roles/assemble_template/meta/argument_specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/assemble_template/meta/argument_specs.yml b/roles/assemble_template/meta/argument_specs.yml index fdc66960..615ceee6 100644 --- a/roles/assemble_template/meta/argument_specs.yml +++ b/roles/assemble_template/meta/argument_specs.yml @@ -21,7 +21,7 @@ argument_specs: Discovers fragment files in a specified directory, loops through fragment files rendering them through M(ansible.builtin.template), places them in a temporary directory, and then assembles a single, final cluster template. - Fragment files must be stored in the locally since M(ansible.builtin.template) can only run locally. + Fragment files must be located on the Ansible controller since M(ansible.builtin.template) only executes on the controller. This ensures that the template processing occurs on the Ansible controller machine. author: "Ronald Suplina " options: