Skip to content

Commit 1d6ec08

Browse files
cssh-erikandrewhughes101
authored andcommitted
Draft
1 parent 95602da commit 1d6ec08

File tree

1 file changed

+51
-42
lines changed

1 file changed

+51
-42
lines changed

docs/source/playbooks.rst

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ Playbooks
99
There are sample playbooks that demonstrate the **IBM z/OS CICS collection**
1010
functionality in the `samples repository`_.
1111

12+
The sample playbooks fall into two categories:
13+
14+
- Operations on CICS and CICSPlex SM resources and definitions. The sample playbooks use the CMCI modules to achieve various real-life use cases.
15+
- CICS provisioning. The sample playbook demonstrates how a set of modules for provisioning and managing CICS TS data sets and utilities can be used to provision, start, stop, and deprovision a CICS region.
16+
1217
.. _samples repository:
1318
https://github.com/IBM/z_ansible_collections_samples
1419

@@ -28,8 +33,8 @@ to reference your CICS artifacts and configuration.
2833

2934
You can find the playbook content that is included with the collection in the
3035
same location where the collection is installed. For more information, refer to
31-
the `installation documentation`_. In the following examples, this document will
32-
refer to the installation path as ``~/.ansible/collections/ibm/ibm_zos_cics``.
36+
the `installation documentation`_. In the following examples, this document
37+
refers to the installation path as ``~/.ansible/collections/ibm/ibm_zos_cics``.
3338

3439

3540
.. _Ansible playbook:
@@ -81,13 +86,13 @@ Inventory
8186
---------
8287

8388
Ansible works with multiple managed nodes (hosts) at the same time, using a
84-
list or group of lists known as an `inventory`_. Once the inventory is defined,
89+
list or group of lists known as an `inventory`_. After the inventory is defined,
8590
you can use `patterns`_ to select the hosts or groups that you want Ansible to
8691
run against.
8792

88-
Included in the CICS `deploy program sample`_ is an example `inventory file`_
89-
which shows how host information is supplied to Ansible. It looks like the
90-
following:
93+
Included in the CICS `deploy program sample`_ is an example `inventory file`_,
94+
which shows how host information is supplied to Ansible. Code that defines a host
95+
is shown below:
9196

9297
.. code-block:: yaml
9398
@@ -98,24 +103,16 @@ following:
98103
ansible_user: zos_target_username
99104
ansible_python_interpreter: path_to_python_interpreter_binary_on_zos_target
100105
106+
A host is defined by the following properties:
101107

102-
The value for the property **ansible_host** is the hostname of the managed node;
103-
for example, ``ansible_host: example.com``
104-
105-
The value for the property **zos_target_username** is the user name to use when
106-
connecting to the host; for example, ``ansible_user: ibmuser``.
107-
108-
The value for the property **ansible_python_interpreter** is the target host
109-
Python path. This is useful for systems with more than one Python installation,
110-
or when Python is not installed in the default location **/usr/bin/python**;
111-
for example, ``ansible_python_interpreter: /usr/lpp/rsusr/python39/bin/python``
108+
- **ansible_host**: The value of this property identifies the hostname of the managed node. For example: ``ansible_host: example.com``
109+
- **zos_target_username**: The value of this property identifies the user name to use when connecting to the host. For example: ``ansible_user: ibmuser``
110+
- **ansible_python_interpreter**: The value of this property specifies the Python path for the target host. For example: ``ansible_python_interpreter: /usr/lpp/rsusr/python39/bin/python``
111+
This is useful for systems with more than one Python installation, or when Python is not installed in the default location **/usr/bin/python**.
112112

113-
For more information on Python configuration requirements on z/OS, refer to
114-
Ansible `FAQ`_.
113+
For more information about the Python configuration requirements on z/OS, see the Ansible `FAQ`_.
115114

116-
Behavioral inventory parameters such as ``ansible_port`` which allows you
117-
to set the port for a host can be reviewed in the
118-
`behavioral inventory parameters`_.
115+
For behavioral inventory parameters such as ``ansible_port`` which allows you to set the port for a host, see `behavioral inventory parameters`_.
119116

120117
.. _inventory:
121118
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html
@@ -139,27 +136,16 @@ Although you can store variables in the inventory file, storing separate host
139136
and group variables files may help you organize your variable values more
140137
easily. An example of one of these variable files is the `zos_host.yml`_
141138
file included with the `deploy_program sample`_, which is used to provide the
142-
required environment variables.
143-
144-
The value for the property **BPXK_AUTOCVT** must be configured to ``ON``.
145-
146-
The value for the property **ZOAU_HOME** is the ZOA Utilities install root path;
147-
for example, ``/usr/lpp/IBM/zoautil``.
148-
149-
The value for the property **PYTHONPATH** is the ZOA Utilities Python library
150-
path; for example, ``/usr/lpp/IBM/zoautil/lib/``.
151-
152-
The value for the property **LIBPATH** is both the path to the Python libraries
153-
on the target and the ZOA Utilities Python library path separated by
154-
colons ``:``; for example,
155-
``/usr/lpp/IBM/zoautil/lib/:/usr/lpp/rsusr/python39/lib:/lib:/usr/lib:.``.
139+
required environment variables. Another such example is the `variables.yml`_ file
140+
included with the `CICS provisioning`_ playbook.
156141

157-
The value for the property **PATH** is the ZOA utilities BIN path and the Python
158-
interpreter path; for example,
159-
``/usr/lpp/IBM/zoautil/bin:/usr/lpp/rsusr/python39/bin/python:/bin``.
142+
The properties that define the environment variables are as follows:
160143

161-
The included sample variables file (zos_host.yml) contains variables specific to
162-
the playbook as well as the following:
144+
- **BPXK_AUTOCVT**: The value must be ``ON``.
145+
- **ZOAU_HOME**: The value of this property identifies the ZOA Utilities install root path. For example: ``/usr/lpp/IBM/zoautil``
146+
- **PYTHONPATH**: The value of this property identifies the ZOA Utilities Python library path. For example: ``/usr/lpp/IBM/zoautil/lib/``
147+
- **LIBPATH**: The value of this property specifies both the path to the Python libraries on the target and the ZOA Utilities Python library path, separated by colons ``:``. For example: ``/usr/lpp/IBM/zoautil/lib/:/usr/lpp/rsusr/python39/lib:/lib:/usr/lib:.``
148+
- **PATH**: The value of this property identifies the ZOA utilities BIN path and the Python interpreter path, separated by colons ``:``. For example: ``/usr/lpp/IBM/zoautil/bin:/usr/lpp/rsusr/python39/bin/python:/bin``
163149

164150
.. code-block:: yaml
165151
@@ -181,14 +167,20 @@ the playbook as well as the following:
181167
https://github.com/IBM/z_ansible_collections_samples/blob/main/zos_subsystems/cics/cmci/deploy_program/host_vars/zos_host.yml
182168
.. _deploy_program sample:
183169
https://github.com/IBM/z_ansible_collections_samples/blob/main/zos_subsystems/cics/cmci/deploy_program
170+
.. _variables.yml:
171+
https://github.com/IBM/z_ansible_collections_samples/blob/main/zos_subsystems/cics/provisioning/host_vars/variables.yml
172+
.. _CICS provisioning:
173+
https://github.com/IBM/z_ansible_collections_samples/tree/main/zos_subsystems/cics/provisioning
184174

185175

186176

187177
Module Defaults
188178
---------------
189179

190180
Ansible has a module defaults feature to use the same values during every use of
191-
a module, rather than repeating them everytime. Here we can set the host url and
181+
a module, rather than repeating them everytime.
182+
183+
For example, when using CMCI modules to manage CICS and CICSPlex SM resources and definitions, you can set the host url and
192184
credentials of the **cmci_get** module to be the same throughout the playbook.
193185

194186
.. code-block:: yaml
@@ -200,7 +192,7 @@ credentials of the **cmci_get** module to be the same throughout the playbook.
200192
cmci_password: "{{ cmci_password }}"
201193
202194
203-
If you wish to use the same values in **all** CMCI modules, you can assign them
195+
If you want to use the same values in **all** CMCI modules, you can assign them
204196
to the group called **cmci_group**.
205197

206198
.. code-block:: yaml
@@ -212,6 +204,23 @@ to the group called **cmci_group**.
212204
cmci_user: "my.username"
213205
cmci_password: "my.password"
214206
207+
208+
Likewise, you can easily apply a default set of CICS TS data sets and utilities for the provisioning or de-provisioning of CICS regions.
209+
If you want to use the same values in **all** CICS TS data set provisioning modules, you can assign them to the group called **region_group**.
210+
For example, the following **module_defaults** example indicates that the SDFHLOAD library of the CICS installation is created by default using the templated location of
211+
``CTS610.CICS740.<< data_set_name >>``, and the region data sets are to be created by using the templated location of ``{{ansible_user}}.REGIONS.{{applid}}.<< data_set_name >>``.
212+
213+
.. code-block:: yaml
214+
215+
module_defaults:
216+
group/ibm.ibm_zos_cics.region_group:
217+
state: initial
218+
cics_data_sets:
219+
template: "CTS610.CICS740.<< data_set_name >>"
220+
region_data_sets:
221+
template: "{{ansible_user}}.REGIONS.{{applid}}.<< data_set_name >>"
222+
223+
215224
.. note::
216225
Group module defaults are only available in ``ansible-core`` 2.12 or later. If
217226
this syntax is used with ``ansible-core`` 2.11 or earlier, the values are

0 commit comments

Comments
 (0)