From e33331ae0bdc80c6dc4475dbda608933fc51b4f0 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 3 Dec 2020 20:56:42 +0200 Subject: [PATCH] Ensure that we create Octavia resources only once Make use of the new _octavia_is_first_play_host while creating resources to ensure that we try to create them only once. Change-Id: I0c5d017bd865b09d94139740ef50b712b8753760 --- tasks/main.yml | 8 ++++++-- tasks/octavia_flavor_create.yml | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 326904ea..47418e04 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -169,17 +169,20 @@ when: - octavia_neutron_management_network_uuid is not defined - octavia_neutron_management_network_name is defined + - _octavia_is_first_play_host tags: - octavia-install - octavia-config - import_tasks: octavia_security_group.yml - run_once: true + when: + - _octavia_is_first_play_host tags: - octavia-install - import_tasks: octavia_flavor_create.yml when: + - _octavia_is_first_play_host - octavia_nova_flavor_uuid is not defined tags: - octavia-install @@ -202,7 +205,8 @@ - octavia-config - import_tasks: octavia_amp_image.yml - run_once: true + when: + - _octavia_is_first_play_host tags: - octavia-config diff --git a/tasks/octavia_flavor_create.yml b/tasks/octavia_flavor_create.yml index ed061341..16b94841 100644 --- a/tasks/octavia_flavor_create.yml +++ b/tasks/octavia_flavor_create.yml @@ -24,7 +24,6 @@ ansible_python_interpreter: "{{ octavia_service_setup_host_python_interpreter }}" block: - name: Create Octavia Flavor - run_once: true openstack.cloud.compute_flavor: auth: auth_url: "{{ keystone_service_adminurl }}"