Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions roles/assemble_template/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
options:
cluster_template_fragments_directory:
Expand Down
3 changes: 3 additions & 0 deletions roles/assemble_template/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down