diff --git a/roles/assemble_template/meta/argument_specs.yml b/roles/assemble_template/meta/argument_specs.yml index ed12e794..615ceee6 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 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: 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: