diff --git a/playbookconfig/src/playbooks/roles/common/load-images-information/tasks/main.yml b/playbookconfig/src/playbooks/roles/common/load-images-information/tasks/main.yml index 946efaa6d..3fd13add3 100644 --- a/playbookconfig/src/playbooks/roles/common/load-images-information/tasks/main.yml +++ b/playbookconfig/src/playbooks/roles/common/load-images-information/tasks/main.yml @@ -24,11 +24,33 @@ - set_fact: kubernetes_images: "{{ kubernetes_images_output.stdout_lines }}" - - include_vars: + - name: Read in system images list + include_vars: dir: "vars/k8s-{{ kubernetes_version }}" files_matching: "system-images.yml" - - name: Get the list of platform images +# Optional system images can be addded in {{ additional_system_images_conf_file }} +# under {{ additional_system_images_conf_path }}. +# Additional static images can be introduced in this file, e.g. +# additional_static_images_list: +# image1_name: /image1:v1.0 +# image2_name: /image2:v2.0 +# Additional static images required or a DC controller only can also be introduced in this file, e.g. +# additional_system_controller_static_images_list: +# image3_name: /image3:v3.0 +# image4_name: /image4:v4.0 + - name: Check if additional image config directory exists + stat: + path: "{{ additional_system_images_conf_path }}" + register: additional_config_dir + + - name: Read in additional system images list(s) + include_vars: + dir: "{{ additional_system_images_conf_path }}" + files_matching: "{{ additional_system_images_conf_file }}" + when: additional_config_dir.stat.exists and additional_config_dir.stat.isdir + + - name: Categorize system images set_fact: networking_images: - "{{ calico_cni_img }}" @@ -45,4 +67,27 @@ - "{{ kubernetes_entrypoint_img }}" storage_images: - "{{ snapshot_controller_img }}" + + - name: Append additional static images if provisioned + set_fact: + static_images: "{{ static_images }} + [ '{{item.value}}' ]" + with_items: "{{ additional_static_images_list | default({})| dict2items }}" + when: additional_static_images_list is defined + + - block: + - name: Append RVMC image for a DC system controller + set_fact: + static_images: "{{ static_images }} + {{ rvmc_img }}" + + - name: Append additional static images for a DC system controller if provisioned + set_fact: + static_images: "{{ static_images }} + [ '{{item.value}}' ]" + with_items: "{{ additional_system_controller_static_images_list | default({})| dict2items }}" + when: additional_system_controller_static_images_list is defined + + when: (distributed_cloud_role is defined and + distributed_cloud_role == 'systemcontroller') or + (check_dc_controller is defined and + check_dc_controller.rc == 0) + when: kubernetes_version is defined diff --git a/playbookconfig/src/playbooks/roles/common/load-images-information/vars/k8s-v1.18.1/system-images.yml b/playbookconfig/src/playbooks/roles/common/load-images-information/vars/k8s-v1.18.1/system-images.yml index 66cf5a9d2..b406e14bf 100644 --- a/playbookconfig/src/playbooks/roles/common/load-images-information/vars/k8s-v1.18.1/system-images.yml +++ b/playbookconfig/src/playbooks/roles/common/load-images-information/vars/k8s-v1.18.1/system-images.yml @@ -15,3 +15,4 @@ sriov_network_device_img: docker.io/starlingx/k8s-plugins-sriov-network-device:s # cluster/addons/volumesnapshots/volume-snapshot-controller/volume-snapshot-controller-deployment.yaml # in the kubernetes github repo snapshot_controller_img: quay.io/k8scsi/snapshot-controller:v2.0.0-rc2 +rvmc_img: docker.io/starlingx/rvmc:stx.5.0-v1.0.0 diff --git a/playbookconfig/src/playbooks/roles/common/load-images-information/vars/main.yml b/playbookconfig/src/playbooks/roles/common/load-images-information/vars/main.yml new file mode 100644 index 000000000..20ecea7e0 --- /dev/null +++ b/playbookconfig/src/playbooks/roles/common/load-images-information/vars/main.yml @@ -0,0 +1,8 @@ +--- +# +# Copyright (c) 2020 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +additional_system_images_conf_path: /usr/share/additional-config +additional_system_images_conf_file: additional-system-images.yml