forked from rh-mobb/ansible-rosa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete-cluster.yaml
More file actions
89 lines (76 loc) · 2.36 KB
/
Copy pathdelete-cluster.yaml
File metadata and controls
89 lines (76 loc) · 2.36 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
- name: "init"
hosts: localhost
connection: local
gather_facts: true
tags:
- always
tasks:
- name: "set a state fact"
ansible.builtin.set_fact:
state: absent
- ansible.builtin.set_fact:
ansible_python_interpreter: ./virtualenv/bin/python
staging_dir: "{{ playbook_dir }}/staging"
- name: "get the aws account id"
aws_caller_info:
register: _aws_caller_info
- ansible.builtin.set_fact:
aws_account_id: "{{ _aws_caller_info.account }}"
- hosts: "all"
connection: "local"
vars_files:
- vars/main.yaml
roles:
- name: roles/_vars
- name: roles/rosa_cluster
vars:
rosa_cluster:
name: "{{ cluster_name }}"
aws_account_id: "{{ aws_account_id }}"
account_roles_prefix: "{{ rosa_account_roles_prefix }}"
region: "{{ rosa_region }}"
hosted_cp: "{{ rosa_hosted_cp }}"
- name: roles/rosa_account_roles
vars:
rosa_account_roles:
hosted_cp: "{{ rosa_hosted_cp }}"
version: "{{ rosa_account_roles_version }}"
prefix: "{{ rosa_account_roles_prefix }}"
- name: roles/rosa_ec2_instance
vars:
rosa_ec2_instance:
name: "rosa-{{ cluster_name }}-jumphost"
region: "{{ rosa_region }}"
when:
- (rosa_private or rosa_private_link) or
(enable_jumphost | default(False) | bool)
- name: roles/rosa_ec2_instance
vars:
rosa_ec2_instance:
name: "rosa-{{ cluster_name }}-proxy"
region: "{{ rosa_region }}"
when:
- (rosa_private_link | bool) and
(proxy_enabled | default(False) | bool)
- name: roles/rosa_transit_gateway
vars:
rosa_transit_gateway:
name: "rosa-{{ cluster_name }}-tgw"
region: "{{ rosa_region }}"
when: rosa_tgw_enabled | bool
- name: roles/rosa_egress_vpc
vars:
rosa_egress_vpc:
name: "rosa-{{ cluster_name }}-egress-vpc"
region: "{{ rosa_region }}"
when:
- rosa_egress_vpc_enabled | bool
- rosa_egress_vpc_subnet_ids | default([]) | length == 0
# ROSA VPC
- name: roles/rosa_vpc
vars:
rosa_vpc:
name: "rosa-{{ cluster_name }}-vpc"
region: "{{ rosa_region }}"
when: rosa_subnet_ids | default([]) | length == 0