feat: Working on not needing to supply template path when using a repo in setup-project

This commit is contained in:
2024-11-27 11:53:46 -05:00
parent e81d9b8f0c
commit ee91b060eb
4 changed files with 92 additions and 9 deletions

View File

@@ -10,7 +10,7 @@
template_dir:
path: "/tmp/hpa-playbook-tmp"
vars: "repo_vars"
output_dir: "/tmp/hpa-setup-project-tmp"
project_dir: "/tmp/hpa-setup-project-tmp"
- role: repo-template
tags:
@@ -25,3 +25,36 @@
path: "/tmp/hpa-playbook-tmp"
vars: "repo_vars"
project_dir: "/tmp/hpa-setup-project-tmp"
tasks:
- name: Test complex var, set fact.
ansible.builtin.set_fact:
template_path: "{{ template.path | default('.build') }}"
vars:
template:
repo:
url: "https://example.com"
version: "main"
tags:
- vars
- never
- name: Test complex var, set fact when path is specified.
ansible.builtin.set_fact:
template_path_specified: true
vars:
template:
repo:
url: "https://example.com"
version: "main"
when: template.path is defined
tags:
- vars
- never
- name: Test complex var was set.
ansible.builtin.debug:
msg: "Template path: {{ template_path }}, specified: {{ template_path_specified | default(false) }}"
tags:
- vars
- never