forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lifecycle.yml
53 lines (42 loc) · 1.33 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
---
# 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 == 'azure'
include_tasks: lifecycle_azure.yml
- when: cloud_provider == 'gcp'
include_tasks: lifecycle_gcp.yml