kustomize_deploy
Ansible role designed to deploy architecture-based scenarios using the kustomize tool.
Parameters
Warning
The top level parameter cifmw_architecture_scenario is required in order
to select the proper architecture-based scenario to deploy. If not provided, the role will fail
with a message.
default resources
cifmw_kustomize_deploy_basedir: (string) Base directory for the ci-framework artifacts. Defaults to~/ci-framework-data/cifmw_kustomize_deploy_architecture_repo_url: (string) URL of The “architecture” repository, where the architecture-based scenarios are defined. Defaults tohttps://github.com/openstack-k8s-operators/architecturecifmw_kustomize_deploy_architecture_repo_dest_dir: (string) Directory where the architecture repo is cloned on the controller node. Defaults to~/src/github.com/openstack-k8s-operators/architecturecifmw_kustomize_deploy_architecture_repo_version: (string) Default branch of the architecture repo to clone. Takes its value from group_vars cifmw_architecture_repo_version_pin, defaults toHEADif not defined.cifmw_kustomize_deploy_architecture_examples_common_path: (string) Relative path of the common CRs in the architecture repo. Defaults to/examples/commoncifmw_kustomize_deploy_architecture_examples_path: (string) Relative path of the architecture-based scenario list in the operator repo. Defaults to/examples/vacifmw_kustomize_deploy_kustomizations_dest_dir: (string) Path for the generated CR files. Defaults tocifmw_kustomize_deploy_destfiles_basedir + /artifacts/kustomize_deploycifmw_kustomize_deploy_generate_crs_only: (boolean) The generated CRs aren’t applied (dry-run). Defaults tofalsecifmw_kustomize_deploy_keep_generated_crs: (boolean) Keep the generated CRs in the destination folder. Defaults totrue
operators resources
cifmw_kustomize_deploy_olm_source_files: (string) Path of the source kustomization files for OLM resources. Defaults tocifmw_kustomize_deploy_architecture_repo_dest_dir + /examples/common/olmcifmw_kustomize_deploy_olm_dest_file: (string) Path of the generated CR file for OLM resources. Defaults tocifmw_kustomize_deploy_kustomizations_dest_dir + olm.ymlcifmw_kustomize_deploy_metallb_source_files: (string) Path of the source kustomization files for MetalLB resources. Defaults tocifmw_kustomize_deploy_architecture_repo_dest_dir + /examples/common/metallb/cifmw_kustomize_deploy_metallb_dest_file: (string) Path of the generated CR file for MetalLB resources. Defaults tocifmw_kustomize_deploy_kustomizations_dest_dir + metallb.ymlcifmw_kustomize_deploy_nmstate_source_files: (string) Path of the source kustomization files for NMstate resources. Defaults tocifmw_kustomize_deploy_architecture_repo_dest_dir + /examples/common/nmstatecifmw_kustomize_deploy_nmstate_dest_file: (string) Path of the generated CR file for NMstate resources. Defaults tocifmw_kustomize_deploy_kustomizations_dest_dir + nmstate.yml
controlplane resources
cifmw_kustomize_deploy_nncp_source_files: (string) Path of the NNCP kustomize source files. Defaults tocifmw_kustomize_deploy_cp_source_files + /nncp/cifmw_kustomize_deploy_nncp_values_dest_file: (string) Path of the generated CR file for the NNCP resources deploy. Defaults tocifmw_kustomize_deploy_nncp_source_files + values.yamlcifmw_kustomize_deploy_nncp_dest_file: (string) Path of the generated CR file for NNCP resources. Defaults tocifmw_kustomize_deploy_kustomizations_dest_dir + nncp.yamlcifmw_kustomize_deploy_cp_source_files: (string) Path of the control-plane kustomize source files. Defaults tocifmw_kustomize_deploy_architecture_repo_dest_dir + /examples/va/hci/control-planecifmw_kustomize_deploy_nncp_values_src_file: (string) Path of thevalues.yamlfile for the NNCP customization. Defaults to~/ci-framework-data/artifacts/ci_gen_kustomize_values/network-values/values.yamlcifmw_kustomize_deploy_cp_dest_file: (string) Path of the generated CR file for OSP control-plane resources. Defaults tocifmw_kustomize_deploy_kustomizations_dest_dir + control-plane.yaml
dataplane resources
cifmw_kustomize_deploy_dp_source_files: (string) Path of the dataplane kustomize source files. Defaults tocifmw_kustomize_deploy_architecture_repo_dest_dir +cifmw_kustomize_deploy_architecture_examples_path +cifmw_architecture_scenariocifmw_kustomize_deploy_dp_values_src_file: (string) Path of the generatedvalues.yamlfor dataplane resources. Defaults to~/ci-framework-data/artifacts/ci_gen_kustomize_values/edpm-values/values.yamlcifmw_kustomize_deploy_dp_values_dest_file: (string) Path of thevalues.yamlfile for dataplane resources. Defaults tocifmw_kustomize_deploy_dp_source_files + values.yamlcifmw_kustomize_deploy_dp_dest_file: (string) Path of the generated CR file for the DataPlane resources deploy. Defaults tocifmw_kustomize_deploy_kustomizations_dest_dir + dataplane.yaml
Automation specificities
Timeouts
Some tasks uses timeouts when applying or waiting for resources. Those timeouts can be controlled by:
cifmw_kustomize_deploy_delay: (Int) Ansibledelaypassed to tasks that waits for a resource to reach a target state (default10)cifmw_kustomize_deploy_retries_subscription: (Int) Ansibleretriespassed to tasks that wait for the Subscription (default90)cifmw_kustomize_deploy_retries_install_plan: (Int) Ansibleretriespassed to tasks that wait for the InstallPlan (default60)
Task tagging
Tags are dynamically associated to each stage of the automated deployment.
This allows to discard specific stages by passing the following parameter
to ansible-playbook:
$ ansible-playbook deploy-edpm.yml \
-e @scenarios/reproducers/va-hci.yml \
-e @scenarios/reproducers/networking-definition.yml \
--skip-tags deploy_architecture_stage_0
This would skip the first stage described in the automation file.
Break point
You can also stop the automated deploy by setting cifmw_deploy_architecture_stopper
parameter to a specific value.
Break point names are built using the stage ID, and the code currently supports three different stopper:
Before calling
kustomize build:pre_kustomize_stage_IDBefore applying the CR:
post_kustomize_stage_IDAfter applying the CR (and after the validation):
post_apply_stage_ID
Example
$ ansible-playbook deploy-edpm.yml [...] \
-e cifmw_deploy_architecture_stopper=post_kustomize_stage_3
Examples
- name: Call kustomize_deploy role
vars:
cifmw_kustomize_deploy_nncp_values_src_file: /tmp/values.yml
cifmw_architecture_scenario: hci
ansible.builtin.include_role:
name: "kustomize_deploy"