-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathdeprovision.yml
60 lines (49 loc) · 1.78 KB
/
deprovision.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
---
- hosts: zos_host
collections:
- ibm.ibm_zos_core
gather_facts: false
environment: "{{environment_vars}}"
tasks:
- name: Stop the server
zos_operator:
cmd: "STOP {{SERVER_PROC}}"
tags: stop
register: stop_result
- name: Response from stopping server process
debug:
msg: "{{stop_result}}"
# #Stop the server -- USS shell example -- if you start the server in the shell, must also stop the server in the shell
# - name: Stop the server
# shell: '{{liberty_bin_path}}/server stop {{server_instance_name}}'
# tags: stop
# Stop the angel process
- name: Stop angel
zos_operator:
cmd: "STOP {{ANGEL_PROC}}"
tags: stop_angel # if tags are used while running the playbook, it has precedence over the when conditional
when: ANGEL | bool # assumes if you enable authorized services, you would want to stop the angel process
register: angel_stop_result
- name: Response from stopping angel process
debug:
msg: "{{angel_stop_result}}"
# Remove server instance by deleting directory
- name: Delete the server directory
shell: 'rm -rf {{liberty_server_path}}'
- name: unmount zFS file
shell: "/usr/sbin/unmount {{environment_vars.WLP_USER_DIR}}"
- name: delete zFS file
ibm.ibm_zos_core.zos_data_set:
name: "{{data_set_name}}"
state: absent
# Remove JCL Procedures
- name: Remove JCL server procedure from an existing procedure library
zos_data_set:
name: "{{PROC_LIB}}({{SERVER_PROC}})"
state: absent
type: MEMBER
- name: Remove JCL angel procedure from an existing procedure library
zos_data_set:
name: "{{PROC_LIB}}({{ANGEL_PROC}})"
state: absent
type: MEMBER