40 lines
999 B
YAML
40 lines
999 B
YAML
- name: Create temp inventory
|
|
hosts: localhost
|
|
vars_files:
|
|
- vars/main.yml
|
|
gather_facts: false
|
|
tasks:
|
|
- name: Include retrieve_secret_vars tasks
|
|
ansible.builtin.include_tasks:
|
|
file: "tasks/retrieve_secret_vars.yml"
|
|
|
|
- name: add target to temp inventory
|
|
ansible.builtin.add_host:
|
|
name: "{{ target_name }}"
|
|
groups: target
|
|
changed_when: false
|
|
|
|
- name: Launch a role
|
|
hosts: target
|
|
vars_files:
|
|
- vars/main.yml
|
|
gather_facts: false
|
|
tasks:
|
|
- name: Set ansible_user
|
|
set_fact:
|
|
ansible_user: "{{ LINUX_USERNAME }}"
|
|
|
|
- name: Gather facts
|
|
ansible.builtin.setup:
|
|
|
|
- name: Include retrieve_secret_vars tasks
|
|
ansible.builtin.include_tasks:
|
|
file: "tasks/retrieve_secret_vars.yml"
|
|
|
|
- name: Include secrets from yml db
|
|
ansible.builtin.include_vars: "{{ local_workdir }}/secrets.yml"
|
|
|
|
- name: Include {{ role_name }}
|
|
ansible.builtin.include_role:
|
|
name: "{{ role_name }}"
|