feat: Begins hpa script

This commit is contained in:
2024-11-28 18:57:55 -05:00
parent ee134d3ce8
commit a20ce14bce
6 changed files with 323 additions and 2 deletions

View File

@@ -8,6 +8,8 @@
ansible.builtin.stat:
path: "{{ template_dir }}"
register: template_dir_stat
tags:
- always
- name: Ensure repo.
ansible.builtin.git:
@@ -15,13 +17,19 @@
dest: "{{ template_dir }}"
version: "{{ template.repo.version | default('main') }}"
when: template.repo.url is defined and not template_dir_stat.stat.exists
tags:
- always
- name: Check for repo vars directory.
ansible.builtin.stat:
path: "{{ template_vars_path }}"
register: repo_vars
tags:
- always
- name: Load repo vars if available.
ansible.builtin.include_vars:
dir: "{{ template_vars_path }}"
when: repo_vars.stat.isdir is defined
tags:
- always

View File

@@ -5,11 +5,17 @@
- name: Set default template path.
ansible.builtin.set_fact:
repo_template_path: "{{ build_dir }}/template"
tags:
- always
- name: Parse template path.
ansible.builtin.set_fact:
template_dir: "{{ template.path | default(repo_template_path) }}"
tags:
- always
- name: Parse template vars path.
ansible.builtin.set_fact:
template_vars_path: "{{ template_dir }}/{{ template.vars | default('repo_vars') }}"
tags:
- always

View File

@@ -23,7 +23,7 @@ project_dir: "{{ lookup('env', 'PWD') }}"
# This is safe to use inside of the project or template specifications
# for paths to files that live in the template directory not the project
# directory.
template_dir: ""
#template_dir: ""
# Files or directories that are copied from the template directory to the project
# directory.

View File

@@ -58,7 +58,7 @@
- name: Debug copy directory contents.
ansible.builtin.debug:
var: unsafe_copy_directory_on_setup
var: copy_directory_on_setup
tags:
- debug
- never