feat: Moves playbook into resources of cli-client.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[defaults]
|
||||
inventory = ../inventory.ini
|
||||
roles_path = ../roles
|
||||
@@ -0,0 +1,2 @@
|
||||
test *ARGS:
|
||||
@ansible-playbook ./test.yml {{ARGS}}
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
- name: Test ansible-hpa-playbook
|
||||
hosts: all
|
||||
roles:
|
||||
- role: setup-project
|
||||
tags:
|
||||
- setup-project
|
||||
- never # force passing tags to run.
|
||||
vars:
|
||||
template_dir:
|
||||
path: "/tmp/hpa-playbook-tmp"
|
||||
vars: "repo_vars"
|
||||
project_dir: "/tmp/hpa-setup-project-tmp"
|
||||
|
||||
- role: repo-template
|
||||
tags:
|
||||
- repo-template
|
||||
- never # force passing tags to run.
|
||||
- role: build-project
|
||||
tags:
|
||||
- build-project
|
||||
- never # force passing tags to run.
|
||||
vars:
|
||||
template_dir:
|
||||
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