From da41aaaa27dbd09e152de336222af35213c03303 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 18 Feb 2020 12:57:30 -0700 Subject: [PATCH] Add container prepare playbook This adds a playbook that can run the container prepare default command to generate a default ContainerImagePrepare setting or can be used to run the container image prepare process to download the containers to an existing overcloud. Change-Id: Ibc5c6acf305b6b3d8f6d589a5c1058cc7f9bc3e8 --- playbooks/README.md | 1 + playbooks/container-prepare.yml | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 playbooks/container-prepare.yml diff --git a/playbooks/README.md b/playbooks/README.md index a4e5f7b..4809276 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -8,6 +8,7 @@ tailored to your specific requirements. Examples -------- +* `container-prepare.yml` - Container prepare playbook * `import-nodes.yml` - Baremetal node import and introspection playbook * `standalone.yml` - Standalone playbook for PoC * `undercloud.yml` - Undercloud installation playbook diff --git a/playbooks/container-prepare.yml b/playbooks/container-prepare.yml new file mode 100644 index 0000000..c57e0e8 --- /dev/null +++ b/playbooks/container-prepare.yml @@ -0,0 +1,50 @@ +--- +############################################################################### +# Container preparation playbook +# +# Description: +# This is a basic playbook to perform the basic container prepare actions +# for an overcloud or undercloud deployment. +# +############################################################################### +- hosts: undercloud + collections: + - tripleo.operator + vars: + prepare_debug: true + use_default: true + default_push_destination: true + output_env_file: "{{ ansible_env.HOME }}/container-image-prepare.yaml" + prepare_env_files: [] + prepare_rolefile: + + tasks: + - name: Gather the rpm package facts + package_facts: + + - name: Check if tripleoclient is installed + fail: + msg: >- + TripleO Client is not installed. Please make sure that the client + has been installed and the repositories are properly configured. + when: (ansible_facts.distribution_major_version|int <= 7 and not 'python2-tripleoclient' in ansible_facts.packages) or + (ansible_facts.distribution_major_version|int >= 8 and not 'python3-tripleoclient' in ansible_facts.packages) + + - name: Run container image prepare defaults + include_role: + name: tripleo_container_image_prepare_default + vars: + tripleo_container_image_prepare_default_debug: "{{ prepare_debug }}" + tripleo_container_image_prepare_default_local_push_destination: "{{ default_push_destination }}" + tripleo_container_image_prepare_default_output_env_file: "{{ output_env_file }}" + when: use_default|bool + + - name: Run container image prepare + include_role: + name: tripleo_overcloud_node_introspect + vars: + tripleo_container_image_prepare_debug: "{{ prepare_debug }}" + tripleo_container_image_prepare_environment_files: "{{ prepare_env_files }}" + tripleo_container_image_prepare_roles_file: "{{ prepare_roles_file }}" + tripleo_container_image_prepare_output_env_file: "{{ output_env_file }}" + when: not use_default|bool