The generic environment variables for the Ansible and Python building blocks
You must create a .yml file to specify the environment variables. The structure of this file and the variables that it contains are specific to Ansible® or Python.
The types variable is common to both environments. See The common variable.
Some generic variables must be specified at the beginning of the environment deployment file. See The generic environment variables for Ansible or The generic environment variables for Python.
The other variables are used by some building blocks only. See the documentation of each building block.
The common variable
- The types variable.The types value represents the default name of the root that lists the types and characteristics of the artifacts that an activity applies to in a deployment method. An artifact type is entered differently in the Ansible and Python environment variable files:
- For Ansible, enter the full name of the artifact type, like in the following
example:
types: - type: 'cicsload' pds: name: '{{ hlq }}.LOADLIB'
- For Python, enter a regular expression (
pattern
) on thepath
property of an artifact, like in the following example:
This pattern means that all the paths that end withtypes: - pattern: .*\.CICSLOAD$
.LOAD
will be selected. The dollar sign ($) at the end of the regular expression represents the end of thepath
property. The backslash (\) character is the escape character required to enter the period (.), which represents any character in the regular expression.
You can enter any name instead of the types default root name in the environment variables file that is used by the building block.
To be recognized by Wazi Deploy, this new name must be declared in the
var_type
property of the deployment method step that is implemented by the building block. Entervar_type
as the property key and the new name as the property value.Example:In the environment variables file used by a building block, you enter an other_types root instead of the types default root value.
The following code shows an excerpt from an environment variables file used by an Ansible building block:other_types: - type: 'cicsload' pds: name: '{{ hlq }}.LOADLIB'
The following code shows an excerpt from an environment variables file used by a Python building block.The deployment method step that is implemented by the building block must containother_types: - pattern: .*\.CICSLOAD$
var_type
as the property key andother_types
as the property value.steps: - name: STEP_WITH_VAR_TYPE properties: - key: var_type value: other_types
In the generated deployment plan, the following lines are generated:steps: - name: STEP_WITH_VAR_TYPE properties: - key: var_type value: other_types artifacts: - name: LGDPDB01 properties: - key: type value: cicsload hash: 0dbed6d26d7b5e5fe663a96fb9d8a3033367e0579c395ceec7309b726ef68df8 ...
- For Ansible, enter the full name of the artifact type, like in the following
example:
The generic environment variables for Ansible
- The environment variables that define all the z/OS®
managed nodes in the target environment. They must be declared under an
environment_vars root. The following table lists and explains all the variables for the z/OS nodes:
Variables Explanations _BPXK_AUTOCVT Automatic conversion of tagged files. It must always be set to ON
.ZOAU_HOME Installation root path for IBM Z® Open Automation Utilities (ZOAU). LIBPATH Path to the Python libraries on the z/OS target and path to the ZOAU Python library. Separate them with a colon (:). PATH ZOAU BIN path and Python interpreter path. _CEE_RUNOPTS Language Environment® option for Wazi Deploy generation. _TAG_REDIR_ERR Variable for the shell command. It must be set to txt
._TAG_REDIR_IN Variable for the shell command. It must be set to txt
._TAG_REDIR_OUT Variable for the shell command. It must be set to txt
.LANG Default locale value. For example, the C
value specifies the Portable Operating System Interface (POSIX) locale.EVIDENCES_FOLDER Name of the subfolder where the evidences are to be generated, in the current work folder. By default, this subfolder is named evidences. PYTHONSTDINENCODING PYTHONSTDINENCODING: "cp1047"
Set this variable to
"cp1047"
to avoid UTF-8 encoding errors with the latest version of the IBM® Python SDK and of the z/OS Ansible core collection for z/OS .These variables do not need further configuration.
The following lines show a sample declaration of these variables:environment_vars: _BPXK_AUTOCVT: "ON" ZOAU_HOME: "{{ ZOAU }}" LIBPATH: "{{ ZOAU }}/lib:{{ PYZ }}/lib:/lib:/usr/lib:." PATH: "{{ ZOAU }}/bin:{{ PYZ }}/bin:/bin:/var/bin" _CEE_RUNOPTS: "FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" _TAG_REDIR_ERR: "txt" _TAG_REDIR_IN: "txt" _TAG_REDIR_OUT: "txt" LANG: "C" #EVIDENCE_FOLDER: "evidences_ansible" PYTHONSTDINENCODING: "cp1047"
- The configuration variables.The following table lists and explains all the configuration variables:
Variables Explanations PYZ Python installation home path on the z/OS managed node. You must configure this variable. ZOAU ZOAU installation home on the z/OS managed node. You must configure this variable. ansible_python_interpreter Python binary installation path on the z/OS managed node. The following lines show a sample declaration of these variables:PYZ: "/usr/lpp/IBM/cyp/v3r10/pyz" ZOAU: "/usr/lpp/IBM/zoautil" ansible_python_interpreter: "{{ PYZ }}/bin/python3"
- The wd_log variable.
The value of this variable comes from the value of the
wd_log
argument in the Ansible deployment command, if this argument was specified and set toTrue
. In this case, the verbosity of the log messages is increased.If the argument was not specified, this variable is automatically set to
False
.wd_log: True
- The wd_env root with the following variables that represent work folders for
the deployment:
- uss_dir, which corresponds to a z/OS UNIX System Services partition in the z/OS target environment.
- local_dir, which corresponds to the folder in the file system where Ansible is to run.
The following lines show a sample declaration of these variables:wd_env: uss_dir: "/tmp/wd_deploy/{{ansible_user|lower}}/{{inventory_hostname}}" local_dir: "/tmp/wd_deploy/{{lookup('env','USER')|lower}}/{{inventory_hostname}}"
The generic environment variables for Python
apiVersion: deploy.ibm.com/v1
kind: Environment
metadata:
name: "tivlp02.svl.ibm.com"
version: 1.0.0