Bundle migration to a new contract version
This article describes the procedure for migrating bundles between contract versions. For each version, a list of changes required to migrate to the new contract version is provided.
Migration to a higher version requires sequential migration of all previous versions.
From the version 1.0 to 2.0
To migrate a bundle from the contract version 1.0 to 2.0, perform the following steps:
-
Convert the action of the
jobtype, since actions of thejobtype are not supported starting from the contract version2.0. To do this:-
Remove the
typeproperty. -
Define script execution using the
scriptsparameter by moving thescriptandscript_typeparameters to it. -
Specify the
nameanddisplay_nameattributes for each element in thescriptslist.
Example of an action with
contract_version: 1.0:--- actions: check: .... type: job script_type: ansible script: ansible/playbooks/cluster/check_mm.yaml ....Example of an action with
contract_version: 2.0:--- actions: check: ... scripts: - name: check display_name: Check script_type: ansible script: ansible/playbooks/cluster/check_mm.yaml -
-
Move the
paramsparameter to the corresponding element of thescriptslist. Forcontract_version: 1.0, theparamsparameter defined at the action level was inherited and applied to each subjob.
Example of an action withcontract_version: 1.0:--- actions: check: display_name: Check type: task scripts: - name: check display_name: Check script_type: ansible script: ansible/playbooks/cluster/check_mm.yaml params: actions: - stopExample of an action with
contract_version: 2.0:--- actions: check: display_name: Check scripts: - name: check display_name: Check script_type: ansible script: ansible/playbooks/cluster/check_mm.yaml params: actions: - stop -
Remove the
typeandlog_filesproperties from theactionssection, as they are not supported starting from the contract version2.0.
Example of an action withcontract_version: 1.0:--- actions: check: display_name: Check type: task log_files: - check scripts: - name: check display_name: Check script_type: ansible script: ansible/playbooks/cluster/check_mm.yamlExample of an action with
contract_version: 2.0:--- actions: check: display_name: Check # legacy attributes to be deleted # type: task # log_files: # - check scripts: - name: check display_name: Check script_type: ansible script: ansible/playbooks/cluster/check_mm.yaml -
Replace the
scripts_jinjaandconfig_jinjaparameters withscripts_templateandconfig_templateby specifying the file path and the type of engine to process the file, since these parameters are not supported starting from the contract version2.0.NOTEMake sure that thescripts_templateandconfig_templateparameters use stricter validation compared to the deprecatedscripts_jinjaandconfig_jinjaparameters. Therefore, migrating to the new parameters may require adjustments to the Jinja2 templates.
Example of an action withcontract_version: 1.0:--- actions: install: display_name: Install type: task config_jinja: config_jinja/cluster/config.j2 scripts_jinja: scripts_jinja/cluster/manage_install.j2 states: available: - createdExample of an action with
contract_version: 2.0:--- actions: check: display_name: Check config_template: file: path: scripts_jinja/cluster/config.j2 engine: type: jinja2 scripts_template: file: path: scripts_jinja/cluster/manage_install.j2 engine: type: jinja2 states: available: - created -
Move the
venvproperty to the object level (for example, a service), since it is not supported at theactionsor upgrade level starting from the contract version2.0.NOTEStarting from the contract version2.0, thevenvproperty is required for theclusterandproviderobjects.Example of an action with
contract_version: 1.0:--- - type: service name: hdfs actions: start: display_name: Start venv: 2.9 .... states: available: - installedExample of an action with
contract_version: 2.0:--- - type: service name: hdfs venv: 2.9 actions: start: display_name: Start .... states: available: - installed -
Migrate actions that use Ansible 2.8 (
default) as the execution environment to version 2.16. The migration may require updates to existing Ansible playbooks and roles.NOTEStarting from the contract version2.0, thevenvproperty does not support thedefaultand2.8values.
|
IMPORTANT
After making changes:
|
From the version 2.0 to 2.1
To migrate a bundle from the contract version 2.0 to 2.1, migrate actions that use Ansible 2.9 as the execution environment to the version 2.16. The migration may require updates to existing Ansible playbooks and roles.
|
NOTE
Starting from the contract version 2.1, the venv property no longer supports the 2.9 value.
|