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,31 @@
---
build_dir_name: ".build"
build_dir: "{{ project_dir }}/{{ build_dir_name }}"
project_dir: "{{ lookup('env', 'PWD') }}"
project_vars_dir: "{{ project_dir }}"
# template:
# path: "/path/to/template/dir
# vars: "repo_vars"
# repo: (optional if using a repo as a template)
template:
path: "/path/to/template/dir"
vars: "repo_vars"
# When using a repository as a template dir. In general, it's
# probably best to pin to a particular version of the repo template
# instead of a branch.
#
# repo:
# url: "https://example.com/repo.git"
# version: "main"
repo: {}
copy_on_build:
- "{{ template.path }}/head.tex"
- "{{ template.path }}/Definitions.md"
template_on_build:
- "{{ project_dir }}/Report.md"
- "{{ template.path }}/footer.tex"

View File

@@ -0,0 +1,36 @@
---
- name: Starting build project.
ansible.builtin.debug:
msg: "Build dir: {{ build_dir }}"
- name: Load project vars.
ansible.builtin.include_vars:
dir: "{{ project_vars_dir }}"
ignore_unknown_extensions: true
- name: Ensure build directory exists.
ansible.builtin.file:
path: "{{ build_dir }}"
state: directory
- name: Parse template facts.
ansible.builtin.include_role:
name: "prepare-template-facts"
- name: Load repo vars.
ansible.builtin.include_role:
name: "load-template-vars"
- name: Copy build files.
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ build_dir }}/{{ item | basename }}"
mode: '0600'
with_items: "{{ copy_on_build }}"
- name: Template build files.
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ build_dir }}/{{ item | basename }}"
mode: '0600'
with_items: "{{ template_on_build }}"