forked from IBM/z_ansible_collections_samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete-ims-datasets.yml
99 lines (81 loc) · 2.7 KB
/
delete-ims-datasets.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
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
90
91
92
93
94
95
96
97
98
---
- name: Clean up IMS data sets
hosts: all
gather_facts: false
# * Include different variable files depending on environment/inventory used
vars_files:
- vars_wazi/ims-dbdc.yml
environment: '{{ system_environment }}'
collections:
- ibm.ibm_zos_core
- ibm.ibm_zos_ims
- operator_sdk.util
tasks:
- name: Retrieve z/OS proclib dataset
shell: pproc
register: proclib_ds
# JOB_CARD will be the default job card inserted for dynamically generated JCL
# ensure MSGCLASS and CLASS are correct for desired environment
- set_fact:
JOB_CARD: |-
//ANSIBLE JOB 'testing',
//* NOTIFY={{ TARGET_USERNAME | upper }},
// USER={{ TARGET_USERNAME | upper }},
// MSGCLASS={{ MSG_CLASS }},
// MSGLEVEL=(1,1),
// CLASS={{ JOB_CLASS }}
IST_VTAM_IMSAPPLID: '{{ DFS_IMS_SSID }}'
ADDTL_SAMP_PROC_LIB: '{{ DFS_AUTH_LIB_HLQ1 }}.{{ DFS_AUTH_LIB_HLQ2 }}.PROCLIB'
TCPIP_PROFILE_TMP: '{{ DFS_AUTH_LIB_HLQ1 }}.TEMP'
ROUTE: '{{ DFS_IMS_SSID }}'
ZOS_RELEASE: '{{proclib_ds.stdout[5:9]}}'
DFS_DS_VOLUME1: '{{proclib_ds.stdout[8]}}{{proclib_ds.stdout[7]}}USR1'
DFS_DS_VOLUME2: '{{proclib_ds.stdout[8]}}{{proclib_ds.stdout[7]}}USR1'
- debug:
var:
- ZOS_RELEASE
- DFS_DS_VOLUME1
- set_fact:
system_environment: '{{ system_environment | combine(new_item, recursive=true) }}'
vars:
new_item: { STEPLIB: '{{ STEPLIB }}' }
with_dict: '{{ system_environment }}'
- block:
- tempfile:
state: directory
register: tmdb_tmp_dir
- set_fact:
DFS_AUTH_LIB_SYSHLQ: "{% if DFS_AUTH_LIB_SYSHLQ2 %}{{DFS_AUTH_LIB_SYSHLQ1}}.{{DFS_AUTH_LIB_SYSHLQ2}}{% else %}{{DFS_AUTH_LIB_SYSHLQ1}}{% endif %}"
- debug:
msg: IMS source location is '{{ DFS_AUTH_LIB_SYSHLQ }}'
# - block:
# - include_role:
# name: ims_dataset
# vars:
# work_dataset: ""
# sysdef_datasets: delete
# runtime_datasets: delete
# system_datasets: ""
# java_dataset: ""
- block:
- include_role:
name: ims_catalog
vars:
catalog: delete
- block:
- include_role:
name: ims_iefjobs
vars:
iefjobs: delete
- block:
- include_role:
name: ims_proclib
vars:
delete: true
always:
- name: Delete the temporary provision files directory
file:
path: "{{ tmdb_tmp_dir.path }}"
state: absent
vars:
uss_file_path: '{{ tmdb_tmp_dir.path }}'