feat: Working on not needing to supply template path when using a repo in setup-project
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user