ovh_instance_playbooks/launch_role.yml

34 lines
831 B
YAML
Raw Normal View History

2024-10-19 10:12:10 +00:00
- name: Create temp inventory
hosts: localhost
gather_facts: false
tasks:
- 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 }}