-
Notifications
You must be signed in to change notification settings - Fork 3
/
delete_site.yml
49 lines (46 loc) · 1.51 KB
/
delete_site.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
---
- hosts: localhost
gather_facts: false
vars_prompt:
- name: site_name
prompt: Provide the site name you would like to backup and delete
private: false
tasks:
- name: Set the site varibale to the site as per the provided site name
set_fact:
site: "{{ item }}"
when:
site_name == item.local.name
loop:
- "{{ site1 }}"
- "{{ site2 }}"
- name: "Delete the DeploymentConfig {{ webapp_deployment_name }}"
community.kubernetes.k8s:
api_version: v1
host: "{{ site.ocp_api_url }}"
api_key: "{{ site.ocp_api_token }}"
kind: DeploymentConfig
namespace: "{{ common_namespace }}"
name: "{{ webapp_deployment_name }}"
state: absent
validate_certs: false
- name: "Delete the Infinispan cluster {{ common_cluster_name }}"
community.kubernetes.k8s:
api_version: v1
host: "{{ site.ocp_api_url }}"
api_key: "{{ site.ocp_api_token }}"
kind: Infinispan
namespace: "{{ common_namespace }}"
name: "{{ common_cluster_name }}"
state: absent
validate_certs: false
- name: "Delete the Infinispan cache {{ common_cache_name }}"
community.kubernetes.k8s:
api_version: infinispan.org/v2alpha1
host: "{{ site.ocp_api_url }}"
api_key: "{{ site.ocp_api_token }}"
kind: Cache
namespace: "{{ common_namespace }}"
name: "{{ common_cache_name }}"
state: absent
validate_certs: false