feat: Changes template_dir to template in build-project
This commit is contained in:
@@ -5,11 +5,11 @@ build_dir: "{{ project_dir }}/{{ build_dir_name }}"
|
|||||||
project_dir: "{{ lookup('env', 'PWD') }}"
|
project_dir: "{{ lookup('env', 'PWD') }}"
|
||||||
project_vars_dir: "{{ project_dir }}"
|
project_vars_dir: "{{ project_dir }}"
|
||||||
|
|
||||||
# template_dir:
|
# template:
|
||||||
# path: "/path/to/template/dir
|
# path: "/path/to/template/dir
|
||||||
# vars: "repo_vars"
|
# vars: "repo_vars"
|
||||||
# repo: (optional if using a repo as a template)
|
# repo: (optional if using a repo as a template)
|
||||||
template_dir:
|
template:
|
||||||
path: "/path/to/template/dir"
|
path: "/path/to/template/dir"
|
||||||
vars: "repo_vars"
|
vars: "repo_vars"
|
||||||
|
|
||||||
@@ -23,9 +23,9 @@ template_dir:
|
|||||||
repo: {}
|
repo: {}
|
||||||
|
|
||||||
copy_on_build:
|
copy_on_build:
|
||||||
- "{{ template_dir.path }}/head.tex"
|
- "{{ template.path }}/head.tex"
|
||||||
- "{{ template_dir.path }}/Definitions.md"
|
- "{{ template.path }}/Definitions.md"
|
||||||
|
|
||||||
template_on_build:
|
template_on_build:
|
||||||
- "{{ project_dir }}/Report.md"
|
- "{{ project_dir }}/Report.md"
|
||||||
- "{{ template_dir.path }}/footer.tex"
|
- "{{ template.path }}/footer.tex"
|
||||||
|
|||||||
@@ -15,19 +15,19 @@
|
|||||||
|
|
||||||
- name: Ensure template repo.
|
- name: Ensure template repo.
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ template_dir.repo.url }}"
|
repo: "{{ template.repo.url }}"
|
||||||
dest: "{{ template_dir.path }}"
|
dest: "{{ template.path }}"
|
||||||
version: "{{ template_dir.repo.version | default('main') }}"
|
version: "{{ template.repo.version | default('main') }}"
|
||||||
when: template_dir.repo.url is defined
|
when: template.repo.url is defined
|
||||||
|
|
||||||
- name: Check for repo vars directory.
|
- name: Check for repo vars directory.
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ template_dir.path }}/{{ template_dir.vars }}"
|
path: "{{ template.path }}/{{ template.vars }}"
|
||||||
register: repo_vars
|
register: repo_vars
|
||||||
|
|
||||||
- name: Load repo vars if available.
|
- name: Load repo vars if available.
|
||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
dir: "{{ template_dir.path }}/{{ template_dir.vars }}"
|
dir: "{{ template.path }}/{{ template.vars }}"
|
||||||
when: repo_vars.stat.isdir is defined
|
when: repo_vars.stat.isdir is defined
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,12 @@
|
|||||||
|
|
||||||
- name: Check for repo vars directory.
|
- name: Check for repo vars directory.
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ template.path }}/{{ template_dir.vars }}"
|
path: "{{ template.path }}/{{ template.vars }}"
|
||||||
register: repo_vars
|
register: repo_vars
|
||||||
|
|
||||||
- name: Load repo vars if available.
|
- name: Load repo vars if available.
|
||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
dir: "{{ template.path }}/{{ template_dir.vars }}"
|
dir: "{{ template.path }}/{{ template.vars }}"
|
||||||
when: repo_vars.stat.isdir is defined
|
when: repo_vars.stat.isdir is defined
|
||||||
|
|
||||||
- name: Debug on_setup.
|
- name: Debug on_setup.
|
||||||
|
|||||||
Reference in New Issue
Block a user