feat: Reorganizes some of the roles and renames some variables

This commit is contained in:
2024-11-27 16:59:22 -05:00
parent ee91b060eb
commit 2692509fbe
9 changed files with 159 additions and 94 deletions

View File

@@ -0,0 +1,27 @@
---
# Used internally to clone the template repo, if applicable and load it's
# variables.
#
# NOTE: This expects that you've called prepare-template-facts first.
- name: Check if template path exists.
ansible.builtin.stat:
path: "{{ template_dir }}"
register: template_dir_stat
- name: Ensure repo.
ansible.builtin.git:
repo: "{{ template.repo.url }}"
dest: "{{ template_dir }}"
version: "{{ template.repo.version | default('main') }}"
when: template.repo.url is defined and not template_dir_stat.stat.exists
- name: Check for repo vars directory.
ansible.builtin.stat:
path: "{{ template_vars_path }}"
register: repo_vars
- name: Load repo vars if available.
ansible.builtin.include_vars:
dir: "{{ template_vars_path }}"
when: repo_vars.stat.isdir is defined