-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdestroy-sso.yml
40 lines (40 loc) · 1.06 KB
/
destroy-sso.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
---
- hosts: masters
vars:
description: "SSO Setup"
sso_username: "glennswest"
sso_project: "sso"
sso_idm_password: "password"
sso_domain: "13.76.165.82.nip.io"
tasks:
- debug:
msg: "Domain: {{sso_domain}}"
- set_fact: idm_dir="/home/{{sso_username}}/{{sso_project}}"
- debug:
msg: "Idm dir {{ idm_dir }}"
- name: Remove repository (and clean up left-over metadata)
yum_repository:
name: epel
state: absent
- name: Cleanup old idm directory
file:
state: absent
path: "{{idm_dir}}"
- name: Delete service account
command: oc delete service account "{{sso_project}}-service_account"
ignore_errors: yes
register: result
failed_when:
- "result.rc > 10"
- name: Delete Secret
command: oc delete secret "{{sso_project}}-app-secret"
ignore_errors: yes
register: result
failed_when:
- "result.rc > 10"
- name: Delete Old Project
command: oc delete project "{{sso_project}}"
ignore_errors: yes
register: result
failed_when:
- "result.rc > 10"