Only run OpenStack tasks once

By having run_once on the entire include, the set_fact only
runs on a single node which means the configuration for all
the other nodes fails.

This patch makes the play get included for everything, but
only the OpenStack creation happens once, with fact setting
happening on all nodes.

Change-Id: Iddd4afebb491dcf9f78f13b7ad96574f8a68e074
(cherry picked from commit e82141a02ab210484d489b83c70b690e94c67bc1)
This commit is contained in:
Mohammed Naser 2018-09-28 13:14:52 -04:00 committed by Jesse Pretorius (odyssey4me)
parent 88225a2f28
commit 71df07ea8a
3 changed files with 5 additions and 3 deletions

View File

@ -60,7 +60,6 @@
- octavia-install
- include_tasks: octavia_mgmt_network.yml
run_once: true
when:
- octavia_neutron_management_network_uuid is not defined
- octavia_neutron_management_network_name is defined
@ -74,7 +73,6 @@
- octavia-install
- include_tasks: octavia_flavor_create.yml
run_once: true
when:
- octavia_nova_flavor_uuid is not defined
tags:

View File

@ -25,6 +25,7 @@
{{ (octavia_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }}
block:
- name: Create Octavia Flavor
run_once: true
os_nova_flavor:
auth:
auth_url: "{{ keystone_service_adminurl }}"
@ -34,7 +35,7 @@
user_domain_name: "{{ octavia_service_user_domain_id }}"
project_domain_name: "{{ octavia_service_project_domain_id }}"
state: present
name: "{{ octavia_amp_flavor_name}}"
name: "{{ octavia_amp_flavor_name }}"
ram: "{{ octavia_amp_ram }}"
vcpus: "{{ octavia_amp_vcpu }}"
disk: "{{ octavia_amp_disk }}"

View File

@ -25,6 +25,7 @@
{{ (octavia_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }}
block:
- name: Create mgmt network
run_once: true
os_network:
auth:
auth_url: "{{ keystone_service_adminurl }}"
@ -49,6 +50,7 @@
- octavia_service_net_setup | bool
- name: Ensure mgmt subnet exists
run_once: true
os_subnet:
auth:
auth_url: "{{ keystone_service_adminurl }}"
@ -75,6 +77,7 @@
- octavia_service_net_setup | bool
- name: Get neutron network
run_once: true
os_networks_facts:
cloud: default
region_name: "{{ octavia_service_region }}"