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.
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: my_var_include_vars
In this sample code, the value of the var_include_vars property is
my_var_include_vars, 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 Ansible and Python common variables
var_include_vars property in a step of deployment method, you
must declare its value (my_var_include_vars 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.
my_var_include_vars:
files_list:
- "vars/include_vars1.yml"
- "vars/include_vars2.yml"
files_must_exist: Truevar_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: TrueReturn values
The result of each building block task is displayed in the evidence file, in The results level that is embedded in step_result.