From d354e1d1b742900b775566420feeeeb51f0c1bb7 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 24 Mar 2021 17:43:22 +0200 Subject: [PATCH] Fix usage of tags Tags are working differently with includes vs imports, so we should respect that and use appropriently. Change-Id: Iaa029ebb27cec98b51472ce4f127337fb83b8b45 --- tasks/consoles/nova_console_novnc_install.yml | 10 +++++--- tasks/drivers/kvm/nova_compute_kvm.yml | 24 +++++++++++++++---- tasks/nova_compute.yml | 12 ++++++++-- tasks/nova_install.yml | 16 ++++++++++--- 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/tasks/consoles/nova_console_novnc_install.yml b/tasks/consoles/nova_console_novnc_install.yml index ef8270f6..e0966a2c 100644 --- a/tasks/consoles/nova_console_novnc_install.yml +++ b/tasks/consoles/nova_console_novnc_install.yml @@ -64,7 +64,11 @@ when: - nova_console_user_ssl_cert is defined - nova_console_user_ssl_key is defined + args: + apply: + tags: + - nova-novnc + - nova-novnc-ssl + - nova-config tags: - - nova-novnc - - nova-novnc-ssl - - nova-config + - always diff --git a/tasks/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index 4f16d9b2..c03036fe 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include_tasks: nova_compute_kvm_install.yml +- import_tasks: nova_compute_kvm_install.yml tags: - nova-install @@ -70,6 +70,14 @@ when: - ansible_facts['distribution'] == 'Ubuntu' - nova_libvirt_inject_key | bool or nova_libvirt_inject_password | bool + args: + apply: + tags: + - nova-config + - nova-kvm + - nova-libvirt + tags: + - always - name: Set libvirtd config template: @@ -179,16 +187,24 @@ - include_tasks: nova_disable_smt.yml when: - ansible_facts['architecture'] == 'ppc64le' + args: + apply: + tags: + - nova-config tags: - - nova-config + - always - include_tasks: nova_enable_ksm.yml when: - nova_compute_ksm_enabled | bool + args: + apply: + tags: + - nova-config tags: - - nova-config + - always -- include_tasks: nova_compute_kvm_virsh_net_remove.yml +- import_tasks: nova_compute_kvm_virsh_net_remove.yml tags: - nova-config - nova-kvm diff --git a/tasks/nova_compute.yml b/tasks/nova_compute.yml index b2803bb5..eb9116ba 100644 --- a/tasks/nova_compute.yml +++ b/tasks/nova_compute.yml @@ -14,8 +14,12 @@ # limitations under the License. - include_tasks: "drivers/{{ nova_virt_type }}/nova_compute_{{ nova_virt_type }}.yml" + args: + apply: + tags: + - nova-install tags: - - nova-install + - always - import_tasks: nova_compute_key_populate.yml tags: @@ -51,5 +55,9 @@ with_items: "{{ nova_nfs_client }}" loop_control: loop_var: mount_var + args: + apply: + tags: + - nova-config tags: - - nova-config + - always diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index 943b0d6f..c4463d7e 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -34,6 +34,12 @@ apt_pinned_packages: [{ package: "{{ nova_backports_packages | join(' ') }}", release: 'Debian Backports' }] when: - ansible_facts['distribution'] | lower == 'debian' + args: + apply: + tags: + - nova-install + tags: + - always - name: Install distro packages package: @@ -92,10 +98,14 @@ nova_services['nova-spicehtml5proxy']['group'] in group_names or nova_services['nova-serialconsole-proxy']['group'] in group_names" - "nova_console_type != 'serialconsole'" + args: + apply: + tags: + - nova-install + - nova-novnc-console + - nova-spice-console tags: - - nova-install - - nova-novnc-console - - nova-spice-console + - always - name: Populate service facts service_facts: