Do not run neutron upgrade when no hosts in group

We not always have hosts in neutron_all group. So we skip running
neutron migration only when there're neutron hosts in groups.

Change-Id: Idac16939f7488cc4dca1fed7ed67c19cd2640c5d
This commit is contained in:
Dmitriy Rabotyagov 2022-12-07 13:24:06 +01:00 committed by Dmitriy Rabotyagov
parent 46cdfe2260
commit eac4cf0b23

View File

@ -19,8 +19,13 @@
gather_facts: false gather_facts: false
user: root user: root
vars: vars:
neutron_host_to_check: "{{ groups['neutron_all'][0] }}" neutron_group: 'neutron_all'
neutron_host_to_check: "{{ groups[neutron_group][0] }}"
tasks: tasks:
- name: End task if neutron is not deployed
meta: end_play
when: not groups[neutron_group]
- name: Define neutron variables for upgrade - name: Define neutron variables for upgrade
lineinfile: lineinfile:
dest: "{{ openstack_config_dir }}/user_neutron_migration.yml" dest: "{{ openstack_config_dir }}/user_neutron_migration.yml"