6
6
- ibm.ibm_zos_cics
7
7
hosts : ' localhost'
8
8
gather_facts : ' false'
9
+ vars :
10
+ csdgroup : ' ANSITEST'
11
+ bunddef : ' ANSIBUND'
12
+
13
+ module_defaults :
14
+ ibm.ibm_zos_cics.cmci_delete :
15
+ cmci_host : ' {{ cmci_host }}'
16
+ cmci_port : ' {{ cmci_port }}'
17
+ cmci_user : ' {{ cmci_user }}'
18
+ cmci_password : ' {{ cmci_password }}'
19
+ context : ' {{ context }}'
20
+ scope : ' {{ scope }}'
21
+ insecure : true
22
+
23
+ ibm.ibm_zos_cics.cmci_action :
24
+ cmci_host : ' {{ cmci_host }}'
25
+ cmci_port : ' {{ cmci_port }}'
26
+ cmci_user : ' {{ cmci_user }}'
27
+ cmci_password : ' {{ cmci_password }}'
28
+ context : ' {{ context }}'
29
+ scope : ' {{ scope }}'
30
+ insecure : true
31
+
32
+ ibm.ibm_zos_cics.cmci_create :
33
+ cmci_host : ' {{ cmci_host }}'
34
+ cmci_port : ' {{ cmci_port }}'
35
+ cmci_user : ' {{ cmci_user }}'
36
+ cmci_password : ' {{ cmci_password }}'
37
+ context : ' {{ context }}'
38
+ scope : ' {{ scope }}'
39
+ insecure : true
40
+
9
41
10
42
tasks :
11
- - name : test create bundle failure
43
+ - name : ' delete bundle def'
44
+ delegate_to : ' localhost'
45
+ ibm.ibm_zos_cics.cmci_delete :
46
+ type : ' CICSDefinitionBundle'
47
+ resources :
48
+ complex_filter :
49
+ and :
50
+ - attribute : NAME
51
+ value : ' {{ bunddef }}'
52
+ - attribute : CSDGROUP
53
+ value : ' {{ csdgroup }}'
54
+ get_parameters :
55
+ - name : ' CSDGROUP'
56
+ value : ' {{ csdgroup }}'
57
+ register : result
58
+ failed_when : >
59
+ 'cpsm_response' not in result or result.cpsm_response not in ['OK', 'NODATA']
60
+
61
+
62
+ - name : ' create bundle def'
63
+ delegate_to : ' localhost'
12
64
ibm.ibm_zos_cics.cmci_create :
13
- cmci_host : ' {{ cmci_host }}'
14
- cmci_port : ' {{ cmci_port }}'
15
- cmci_user : ' {{ cmci_user }}'
16
- cmci_password : ' {{ cmci_password }}'
17
- insecure : true
18
- context : ' {{ context }}'
19
- scope : ' {{ scope }}'
20
65
type : ' CICSDefinitionBundle'
21
66
create_parameters :
22
67
- name : ' CSD'
23
68
attributes :
24
- name : ' ANSIBUND'
25
- csdgroup : ' ANDITEST'
26
- bundledir : " invalid"
69
+ name : ' {{ bunddef }}'
70
+ csdgroup : ' {{ csdgroup }}'
71
+ bundledir : " /invalid"
72
+ register : result
73
+
74
+ - name : assert created
75
+ assert :
76
+ that :
77
+ - result is changed
78
+ - result.cpsm_response == 'OK'
79
+ - result.record_count == 1
80
+ - result.records[0].name == 'ANSIBUND'
81
+
82
+ - name : ' install bundle def'
83
+ delegate_to : ' localhost'
84
+ ibm.ibm_zos_cics.cmci_action :
85
+ type : ' CICSDefinitionBundle'
86
+ action_name : ' CSDINSTALL'
87
+ resources :
88
+ filter :
89
+ NAME : ' {{ bunddef }}'
90
+ get_parameters :
91
+ - name : ' CSDGROUP'
92
+ value : ' {{ csdgroup }}'
27
93
failed_when : false
28
94
register : result
29
95
30
96
- name : debug
31
97
debug :
32
98
msg : ' {{ result }}'
33
99
34
- - name : assert
100
+ - name : assert installed
35
101
assert :
36
102
that :
37
103
- result.failed is false
38
104
# This will need updating when we pull out more specific error messages from the CMCI response.
39
- # Expecting the error to contain 'Attribute Bundle Directory (BUNDLEDIR) Error(BUNDDEF_INV_DATA)'
40
- - result.msg == "CMCI request failed with response \"TABLEERROR\" reason \"DATAERROR\""
105
+ # Expecting the error to contain 'EXEC CICS command(CSD INSTALL) RESP(INVREQ) RESP2(633)'
106
+ # Where RESP2(633) is 'Installation of BUNDLE resource resource failed because the resource had no manifest'
107
+ - result.msg == "CMCI request failed with response \"TABLEERROR\" reason \"DATAERROR\""
108
+
109
+
110
+ - name : ' delete bundle def'
111
+ delegate_to : ' localhost'
112
+ ibm.ibm_zos_cics.cmci_delete :
113
+ type : ' CICSDefinitionBundle'
114
+ resources :
115
+ filter :
116
+ NAME : ' {{ bunddef }}'
117
+ get_parameters :
118
+ - name : ' CSDGROUP'
119
+ value : ' {{ csdgroup }}'
120
+ register : result
121
+
122
+ - name : assert deleted
123
+ assert :
124
+ that :
125
+ - result is changed
126
+ - result.cpsm_response == 'OK'
127
+ - result.record_count == 1
128
+ - result.success_count == 1
0 commit comments