2025-11-15 17:22:21 +01:00
|
|
|
|
---
|
|
|
|
|
|
# create-clones.yml - Create and configure clones from template with error handling
|
|
|
|
|
|
|
|
|
|
|
|
- name: "[CLONES] Validate clone list is not empty"
|
2025-11-15 21:49:12 +01:00
|
|
|
|
ansible.builtin.fail:
|
2025-11-15 17:22:21 +01:00
|
|
|
|
msg: "No clones defined in 'clones' variable"
|
|
|
|
|
|
when:
|
|
|
|
|
|
- create_clones | default(false)
|
|
|
|
|
|
- clones is not defined or clones | length == 0
|
|
|
|
|
|
|
|
|
|
|
|
- name: "[CLONES] Process each clone"
|
2025-12-06 11:53:45 +01:00
|
|
|
|
include_tasks: clone_iteration.yml
|
|
|
|
|
|
vars:
|
|
|
|
|
|
clone: "{{ item }}"
|
2025-11-15 17:22:21 +01:00
|
|
|
|
loop: "{{ clones }}"
|
|
|
|
|
|
when: create_clones | default(false)
|
|
|
|
|
|
|
|
|
|
|
|
- name: "[CLONES] Skip clone creation (disabled)"
|
2025-11-15 21:49:12 +01:00
|
|
|
|
ansible.builtin.debug:
|
2025-11-15 17:22:21 +01:00
|
|
|
|
msg: "ℹ Clone creation is disabled. Set 'create_clones: true' to enable."
|
|
|
|
|
|
when: not (create_clones | default(false))
|