forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_runtime.yml
47 lines (40 loc) · 1.18 KB
/
setup_runtime.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
- name: Step 0000 - Setup output_dir
hosts: localhost
connection: local
gather_facts: false
become: false
tasks:
- debug:
msg: "Warning: ANSIBLE_REPO_PATH variable is deprecated, you don't have to use it anymore."
when: ANSIBLE_REPO_PATH is defined
- name: Set output_dir if not defined
set_fact:
output_dir: >-
{{
ANSIBLE_REPO_PATH + '/workdir' if ANSIBLE_REPO_PATH is defined
else '/tmp/output_dir'
}}
when: output_dir is not defined
- name: Stat output_dir
stat:
path: "{{ output_dir }}"
register: rstat_output_dir
- name: Create output_dir if it does not exists
file:
path: "{{ output_dir }}"
state: directory
when: not rstat_output_dir.stat.exists
- name: Create empty user-info.yaml and user-data.yaml in output dir
copy:
content: |
---
dest: "{{ output_dir }}/{{ item }}"
loop:
- user-info.yaml
- user-data.yaml
# include global vars from the config
- import_playbook: include_vars.yml
# Load galaxy roles of the config
- import_playbook: install_galaxy_roles.yml
tags: galaxy_roles