forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lifecycle.yml
70 lines (55 loc) · 1.83 KB
/
lifecycle.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
# Quickly setup output dir and include vars.
# Do not run the full setup_runtime.yml playbook because
# it installs galaxy dependencies and that is too slow for
# lifecycle actions.
#
# Output dir:
- import_playbook: setup_output_dir.yml
# include global vars from the config
- import_playbook: include_vars.yml
# This file is the default playbook for common actions.
# You should implement those actions in your config if you
# need a specific process.
- name: Run stop/start/status/... actions
hosts: localhost
connection: local
gather_facts: False
become: no
tasks:
- fail:
msg: "guid and env_type must be defined"
when: >-
guid is not defined or guid == ''
or env_type is not defined or env_type == ''
- when: project_tag is not defined
set_fact:
project_tag: "{{ env_type }}-{{ guid }}"
- fail:
msg: "ACTION is not defined"
when: ACTION is not defined
- debug:
msg: "Lifecycle called with ACTION: '{{ ACTION }}'"
- when: >-
guid is not defined
or guid == ''
or guid == '*'
fail:
msg: variable 'guid' must be defined and not empty
- when: cloud_provider == 'ec2'
include_tasks: lifecycle_ec2.yml
- when: cloud_provider == 'osp'
include_role:
name: infra_osp_lifecycle
- when: cloud_provider == 'equinix_metal'
include_tasks: lifecycle_equinix_metal.yml
- when: cloud_provider == 'vmc'
include_tasks: lifecycle_vmc.yml
- when: cloud_provider == 'vmware_ibm'
include_tasks: lifecycle_vmc.yml
- when: cloud_provider == 'openshift_cnv'
ansible.builtin.include_tasks: lifecycle_openshift_cnv.yml
- when: cloud_provider == 'azure'
include_tasks: lifecycle_azure.yml
- when: cloud_provider == 'gcp'
include_tasks: lifecycle_gcp.yml