feat: Moves playbook into resources of cli-client.

This commit is contained in:
2024-12-12 19:39:52 -05:00
parent ba1e61d99e
commit 5f4ef3b5b5
31 changed files with 1076 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
---
# 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
tags:
- always
- name: Debug template variable.
ansible.builtin.debug:
var: template
tags:
- debug
- never
- 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
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