feat: Working on not needing to supply template path when using a repo in setup-project
This commit is contained in:
@@ -1,11 +1,43 @@
|
||||
---
|
||||
- name: Starting setup project.
|
||||
ansible.builtin.debug:
|
||||
msg: "Output dir: {{ output_dir }}"
|
||||
msg: "Project dir: {{ project_dir }}"
|
||||
|
||||
- name: Debug template vars pre parse.
|
||||
ansible.builtin.debug:
|
||||
var: template
|
||||
tags:
|
||||
- debug
|
||||
- never
|
||||
|
||||
- name: Parse template path.
|
||||
ansible.builtin.set_fact:
|
||||
template:
|
||||
path: "{{ project_dir }}/{{ build_dir | default('.build') }}/template"
|
||||
when: not template.path is defined
|
||||
|
||||
- name: Parse template vars.
|
||||
ansible.builtin.set_fact:
|
||||
template:
|
||||
vars: "repo_vars"
|
||||
when: not template.vars is defined
|
||||
|
||||
# - name: Prepare variables.
|
||||
# ansible.builtin.include_tasks:
|
||||
# file: "prepare_vars.yml"
|
||||
# vars:
|
||||
# template: "{{ template }}"
|
||||
|
||||
- name: Debug template vars post parse.
|
||||
ansible.builtin.debug:
|
||||
var: template
|
||||
tags:
|
||||
- debug
|
||||
- never
|
||||
|
||||
- name: Ensure output directory exists.
|
||||
ansible.builtin.file:
|
||||
path: "{{ output_dir }}"
|
||||
path: "{{ project_dir }}"
|
||||
state: directory
|
||||
|
||||
- name: Ensure repo.
|
||||
@@ -37,6 +69,6 @@
|
||||
file: "copy_if_not_exists.yml"
|
||||
vars:
|
||||
source: "{{ template.path }}/{{ item.src | default(item) }}"
|
||||
destination: "{{ output_dir }}/{{ item.dest | default(item) }}"
|
||||
destination: "{{ project_dir }}/{{ item.dest | default(item) }}"
|
||||
mode: "{{ item.mode | default('0600') }}"
|
||||
loop: "{{ copy_on_setup }}"
|
||||
|
||||
Reference in New Issue
Block a user