include_vars

This building block reads the variables that are contained in external .yml files and adds these variables to the environment variables file that is used by the Wazi Deploy building blocks. This building block is not related to artifacts.

To trigger the execution of this building block, you can enter the following code in the deployment method from which the deployment plan is generated. See How to trigger the execution of a building block. The following code is an example.
actions:
    - name: READ THE VARIABLES CONTAINED IN EXTERNAL FILES
      short_name: EXTERNAL_VARIABLES
      steps:
      - name: TEST STEP FOR INCLUDE_VARS
        short_name: TEST_EXT_VARIABLES
        properties:
        - key: template
          value: include_vars
        - key: var_include_vars
          value: include_vars_list_1

In this sample code, the value of the var_include_vars property is include_vars_list_1, but it can be any other string.

If you do not declare this property in the deployment method, then default values must exist in the variables file.

To run correctly, this building block requires environment variables. Indicate them in a .yml file. Indicate The generic environment variables for the Ansible and Python building blocks and adapt their values to your target z/OS environment. Indicate also the variables that are specific to this building block.

The environment variables

If you specify a var_include_vars property in a step of deployment method, you must declare its value (include_vars_list_1 in the example) as a variable in the environment variables files and specify the values of its following elementary variables:
  • files_list (required), where you list the paths to one or more variables files.
  • files_must_exist (required), whose boolean value defines whether the execution of the building block fails when one of the variables files of the list does not exist.
For example, enter the following lines in the environment variables file:
include_vars_list_1:
  files_list:
   - "vars/include_vars1.yml"
   - "vars/include_vars2.yml"
  files_must_exist: True
If you do not indicate a var_include_vars property in the deployment method, then the values of the elementary variables of the include_vars_default group variable are used. For example, you can enter the following lines for the default group variable:
include_vars_default:
  files_list:
   - "vars/default_file1.yml"
  files_must_exist: True

Return values

The result of each building block task is displayed in the evidence file, in The results level that is embedded in step_result.