Merge "Refactor and optimise image pulling"

This commit is contained in:
Zuul 2021-08-10 14:59:45 +00:00 committed by Gerrit Code Review
commit 9cd7ed8074
65 changed files with 144 additions and 610 deletions

View File

@ -1,11 +1,3 @@
---
- name: Pulling aodh images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ aodh_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling barbican images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ barbican_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling blazar images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ blazar_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling ceilometer images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling chrony images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ chrony_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling cinder images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cinder_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling cloudkitty images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cloudkitty_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling collectd image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ collectd_services }}"
- import_role:
role: service-images-pull

View File

@ -1,10 +1,3 @@
---
- name: Pulling common images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value | service_enabled_and_mapped_to_host
with_dict: "{{ common_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling cyborg images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cyborg_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling designate images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling elasticsearch images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ elasticsearch_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling etcd image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling freezer images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ freezer_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling glance images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value.host_in_groups | bool
- item.value.enabled | bool
with_dict: "{{ glance_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling gnocchi images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ gnocchi_services }}"
- import_role:
role: service-images-pull

View File

@ -1,8 +1,3 @@
---
- name: Pulling grafana image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ grafana_image_full }}"
when: inventory_hostname in groups['grafana']
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling hacluster images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ hacluster_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling haproxy images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ haproxy_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling heat images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ heat_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling horizon images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ horizon_services }}"
- import_role:
role: service-images-pull

View File

@ -1,8 +1,3 @@
---
- name: Pulling influxdb image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ influxdb_image_full }}"
when: inventory_hostname in groups['influxdb']
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling ironic images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling iscsi images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ iscsi_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling kafka images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ kafka_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling keystone images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ keystone_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling Kibana image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ kibana_services }}"
- import_role:
role: service-images-pull

View File

@ -1,7 +1,3 @@
---
- name: Pulling kuryr image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ kuryr_image_full }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling magnum images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ magnum_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling manila images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ manila_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling mariadb image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ mariadb_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling masakari images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ masakari_services }}"
- import_role:
role: service-images-pull

View File

@ -1,12 +1,3 @@
---
- name: Pulling memcached image
vars:
service: "{{ memcached_services.memcached }}"
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ service.image }}"
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling mistral images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
with_dict: "{{ mistral_services }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling monasca images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ monasca_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling multipathd image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ multipathd_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling murano images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ murano_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling neutron images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
- import_role:
role: service-images-pull

View File

@ -1,6 +1,10 @@
---
project_name: "nova"
# NOTE(yoctozepto): we need this for the nova-cell role because this role's
# vars prefix does not match "{{ project_name }}"
kolla_role_name: "nova_cell"
nova_cell_services:
nova-libvirt:
container_name: nova_libvirt

View File

@ -1,11 +1,3 @@
---
- name: Pulling nova images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_cell_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling nova images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling octavia images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ octavia_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling Openvswitch images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ openvswitch_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling OVN images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling ovs-dpdk images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ ovsdpdk_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling placement images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ placement_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling prometheus images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ prometheus_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling qdrouterd image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ qdrouterd_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling rabbitmq image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ rabbitmq_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling redis images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ redis_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling sahara images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ sahara_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling senlin images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ senlin_services }}"
- import_role:
role: service-images-pull

View File

@ -0,0 +1,12 @@
---
- name: "{{ kolla_role_name | default(project_name) }} | Pull images"
vars:
service: "{{ item.value }}"
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ service.image }}"
with_dict: "{{ lookup('vars', (kolla_role_name | default(project_name)) + '_services') | select_services_enabled_and_mapped_to_host }}"
loop_control:
label: "{{ item.key }}"

View File

@ -1,11 +1,3 @@
---
- name: Pulling skydive images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ skydive_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling solum images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ solum_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling storm images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ storm_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling tacker images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- item.value.host_in_groups | bool
- item.value.enabled | bool
with_dict: "{{ tacker_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling telegraf image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ telegraf_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling trove images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ trove_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling vitrage images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ vitrage_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling vmtp image
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ vmtp_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling watcher images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ watcher_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling zookeeper images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ zookeeper_services }}"
- import_role:
role: service-images-pull

View File

@ -1,11 +1,3 @@
---
- name: Pulling zun images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ zun_services }}"
- import_role:
role: service-images-pull

View File

@ -0,0 +1,4 @@
---
other:
- |
Optimised image pulling to avoid looping over disabled services.