6
6
Playbooks
7
7
=========
8
8
9
- The sample playbooks that are **included ** in the **IBM z/OS CICS collection **
10
- demonstrate how to use the collection content.
9
+ There are sample playbooks that demonstrate the **IBM z/OS CICS collection **
10
+ functionality in the `samples repository `_.
11
+
12
+ .. _samples repository :
13
+ https://github.com/IBM/z_ansible_collections_samples
14
+
15
+
11
16
12
17
Playbook Documentation
13
18
----------------------
14
19
15
20
An `Ansible playbook `_ consists of organized instructions that define work for
16
21
a managed node (host) to be managed with Ansible.
17
22
18
- A ` playbooks directory `_ that contains a sample playbook is included in the
19
- ** IBM z/OS CICS collection ** . The sample playbook is for reference and can be run
20
- with the ``ansible-playbook `` command with some modification to the **inventory **,
21
- **ansible.cfg ** and **group_vars ** as well as updates to the module parameters
23
+ ` Samples `_ that contains multiple example playbooks are included in the
24
+ ` CICS samples repository `_ . The sample playbooks are for reference and can be run
25
+ with the ``ansible-playbook `` command with some modification to their **inventory **,
26
+ **ansible.cfg ** and **group_vars ** as well as updates to their module parameters
22
27
to reference your CICS artifacts and configuration.
23
28
24
29
You can find the playbook content that is included with the collection in the
@@ -29,12 +34,15 @@ refer to the installation path as ``~/.ansible/collections/ibm/ibm_zos_cics``.
29
34
30
35
.. _Ansible playbook :
31
36
https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#playbooks-intro
32
- .. _playbooks directory :
33
- https://github.com/ansible-collections/ibm_zos_cics/tree/master/playbooks
37
+ .. _Samples :
38
+ https://github.com/IBM/z_ansible_collections_samples/tree/main/zos_subsystems/cics
39
+ .. _CICS samples repository :
40
+ https://github.com/IBM/z_ansible_collections_samples
34
41
.. _installation documentation :
35
42
installation.html
36
43
37
44
45
+
38
46
Sample Configuration and Setup
39
47
------------------------------
40
48
Each release of Ansible provides options in addition to the ones identified in
@@ -43,18 +51,14 @@ allow you to customize how Ansible operates in your environment. Ansible
43
51
supports several sources to configure its behavior and all sources follow the
44
52
Ansible `precedence rules `_.
45
53
46
- The Ansible configuration file `ansible.cfg ` can override almost all
47
- ``ansible-playbook `` configurations. Included in the `playbooks directory `_ is a
48
- sample `ansible.cfg `_ that can supplement ``ansible-playbook `` with a
49
- little modification. In the sample `ansible.cfg `_, the only required
50
- configuration is ``pipelining = True ``.
54
+ The Ansible configuration file ``ansible.cfg `` can override almost all
55
+ ``ansible-playbook `` configurations.
51
56
52
57
You can specify the SSH port used by Ansible and instruct Ansible where to
53
58
write the temporary files on the target. This can be easily done by adding the
54
- options to your inventory or `ansible.cfg `.
59
+ options to your inventory or `` ansible.cfg ` `.
55
60
56
- An example of adding these options to `ansible.cfg ` is shown below. For more
57
- details, see the sample `ansible.cfg `_ notes.
61
+ An example of adding these options to ``ansible.cfg `` is shown below.
58
62
59
63
.. code-block :: yaml
60
64
@@ -66,13 +70,13 @@ details, see the sample `ansible.cfg`_ notes.
66
70
For more information about available configurations for ``ansible.cfg ``, read
67
71
the Ansible documentation on `Ansible configuration settings `_.
68
72
69
- .. _ansible.cfg :
70
- https://github.com/ansible-collections/ibm_zos_cics/blob/master/playbooks/ansible.cfg
71
73
.. _Ansible configuration settings :
72
74
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-configuration-settings-locations
73
75
.. _precedence rules :
74
76
https://docs.ansible.com/ansible/latest/reference_appendices/general_precedence.html#general-precedence-rules
75
77
78
+
79
+
76
80
Inventory
77
81
---------
78
82
@@ -81,15 +85,15 @@ list or group of lists known as an `inventory`_. Once the inventory is defined,
81
85
you can use `patterns `_ to select the hosts or groups that you want Ansible to
82
86
run against.
83
87
84
- Included in the `playbooks directory `_ is a `sample inventory file `_ that can be
85
- used to manage your nodes with a little modification. This inventory file
86
- should be included when running the sample playbook.
88
+ Included in the `CMCI samples repository `_ is a `sample inventory file `_
89
+ that can be used to manage your nodes with a little modification. This
90
+ inventory file should be included when running the sample playbook.
87
91
88
92
.. code-block :: yaml
89
93
90
- zsystem :
94
+ source_system :
91
95
hosts :
92
- zvm :
96
+ zos_host :
93
97
ansible_host : zos_target_address
94
98
ansible_user : zos_target_username
95
99
ansible_python_interpreter : path_to_python_interpreter_binary_on_zos_target
@@ -115,23 +119,26 @@ to set the port for a host can be reviewed in the
115
119
116
120
.. _inventory :
117
121
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html
122
+ .. _CMCI samples repository :
123
+ https://github.com/IBM/z_ansible_collections_samples/blob/main/zos_subsystems/cics/cmci
118
124
.. _patterns :
119
125
https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html#intro-patterns
120
126
.. _sample inventory file :
121
- https://github.com/ansible-collections/ibm_zos_cics /blob/master/playbooks/ inventory
127
+ https://github.com/IBM/z_ansible_collections_samples /blob/main/zos_subsystems/cics/cmci/deploy_program/ inventory.yml
122
128
.. _FAQ :
123
129
https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#running-on-z-os
124
130
.. _behavioral inventory parameters :
125
131
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#connecting-to-hosts-behavioral-inventory-parameters
126
132
127
133
134
+
128
135
Group_vars
129
136
----------
130
137
131
138
Although you can store variables in the inventory file, storing separate host
132
139
and group variables files may help you organize your variable values more
133
140
easily. Included with the sample playbook is a sample variables
134
- file `all .yml `_.
141
+ file `zos_host .yml `_.
135
142
136
143
The value for the property **BPXK_AUTOCVT ** must be configured to ``ON ``.
137
144
@@ -150,7 +157,8 @@ The value for the property **PATH** is the ZOA utilities BIN path and the Python
150
157
interpreter path; for example,
151
158
``/usr/lpp/IBM/zoautil/bin:/usr/lpp/rsusr/python36/bin/python:/bin ``.
152
159
153
- The included sample variables file (all.yml) looks like this:
160
+ The included sample variables file (zos_host.yml) contains variables specific to
161
+ the playbook as well as the following:
154
162
155
163
.. code-block :: yaml
156
164
@@ -168,8 +176,8 @@ The included sample variables file (all.yml) looks like this:
168
176
**ZOAU_ROOT ** which is the ZOA Utilities install root path required for
169
177
ZOAU; for example, ``/usr/lpp/IBM/zoautil ``.
170
178
171
- .. _ all .yml :
172
- https://github.com/ansible-collections/ibm_zos_cics /blob/master/playbooks/group_vars/all .yml
179
+ .. _ zos_host .yml :
180
+ https://github.com/IBM/z_ansible_collections_samples /blob/main/zos_subsystems/cics/cmci/deploy_program/host_vars/zos_host .yml
173
181
174
182
175
183
@@ -181,11 +189,12 @@ a module, rather than repeating them everytime. Here we can set the host url and
181
189
credentials of the **cmci_get ** module to be the same throughout the playbook.
182
190
183
191
.. code-block :: yaml
192
+
184
193
module_defaults :
185
- ibm.ibm_zos_cics.cmci_get :
186
- cmci_host : " {{ cmci_host }}"
187
- cmci_user : " {{ cmci_user }}"
188
- cmci_password : " {{ cmci_password }}"
194
+ ibm.ibm_zos_cics.cmci_get :
195
+ cmci_host : " {{ cmci_host }}"
196
+ cmci_user : " {{ cmci_user }}"
197
+ cmci_password : " {{ cmci_password }}"
189
198
190
199
191
200
If you wish to use the same values in **all ** CMCI modules, you can assign them
@@ -194,11 +203,11 @@ to the group called **cmci_group**.
194
203
.. code-block :: yaml
195
204
196
205
module_defaults :
197
- group/ibm.ibm_zos_cics.cmci_group :
198
- cmci_host : " my.system.host"
199
- cmci_port : " system.port.number"
200
- cmci_user : " my.username"
201
- cmci_password : " my.password"
206
+ group/ibm.ibm_zos_cics.cmci_group :
207
+ cmci_host : " my.system.host"
208
+ cmci_port : " system.port.number"
209
+ cmci_user : " my.username"
210
+ cmci_password : " my.password"
202
211
203
212
.. note ::
204
213
Group module defaults are only available in ``ansible-core `` 2.12 or later. If
@@ -210,13 +219,14 @@ to the group called **cmci_group**.
210
219
Run the playbook
211
220
----------------
212
221
213
- Access the sample Ansible playbook and ensure that you are within the collection
214
- playbooks directory where the sample files are included :
215
- ``~/.ansible/collections/ibm/ibm_zos_cics/playbooks / ``.
222
+ Access the ` collection samples repository `_ and ensure you have navigated to
223
+ the directory containing the playbook you want to run. For example :
224
+ ``zos_subsystems/cics/cmci/deploy_program / ``.
216
225
217
226
Use the Ansible command ``ansible-playbook `` to run the sample playbook. The
218
- command syntax is ``ansible-playbook -i <inventory> <playbook> ``; for example,
219
- ``ansible-playbook -i inventory zos-collection-sample.yaml ``.
227
+ command syntax is ``ansible-playbook -i <inventory> <playbook> `` which, using
228
+ the example above of deploy_program, is
229
+ ``ansible-playbook -i inventory deploy_program.yaml ``.
220
230
221
231
This command assumes that the controller's public SSH key has been shared with
222
232
the managed node. If you want to avoid entering a username and password each
@@ -225,7 +235,7 @@ command; for example, ``ssh-copy-id -i ~/.ssh/mykey.pub user@<hostname>``.
225
235
226
236
Alternatively, you can use the ``--ask-pass `` option to be prompted for the
227
237
user's password each time a playbook is run; for example,
228
- ``ansible-playbook -i inventory zos-collection-sample .yaml --ask-pass ``.
238
+ ``ansible-playbook -i inventory deploy_program .yaml --ask-pass ``.
229
239
230
240
.. note ::
231
241
* Using ``--ask-pass `` is not recommended because it will hinder performance.
@@ -249,14 +259,15 @@ ERROR, DEBUG.
249
259
Review the playbook notes sections for additional details and
250
260
configuration.
251
261
252
- Sample playbooks often submit JCL that is included with this collection
262
+ Playbooks often submit JCL that is included in the samples repository
253
263
under the `files directory `_. Review the sample JCL for necessary edits to
254
264
allow for submission on the target system. The most common changes are to
255
265
add a CLASS parameter and change the NOTIFY user parameter. For more details,
256
266
see the JCL notes section included in the collection.
257
267
258
268
.. _ask-pass documentation :
259
269
https://linux.die.net/man/1/sshpass
260
-
270
+ .. _collection samples repository :
271
+ https://github.com/IBM/z_ansible_collections_samples
261
272
.. _files directory :
262
- https://github.com/ansible-collections/ibm_zos_core /tree/dev/playbooks /files
273
+ https://github.com/IBM/z_ansible_collections_samples /tree/main/zos_basics/constructs /files
0 commit comments