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
This commit is contained in:
Mohammed Naser 2018-09-28 13:14:52 -04:00
parent ba3e6e8e81
commit e82141a02a
3 changed files with 5 additions and 3 deletions

View File

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

View File

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

View File

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