From e2bc9dcf79d0780b765545b796db114ad2f52eca Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Thu, 5 Nov 2015 11:00:35 +0000 Subject: [PATCH] bootstrap takes place on the wrong node The bootstrap must occur on the nova-api node due to binding in the nova-api directory (same goes for all other services) Closes-Bug: #1513439 Backport: Liberty Change-Id: Iab88b49712828085e4d7e7f85e6d8f0b7999a9bf --- ansible/roles/cinder/tasks/bootstrap.yml | 8 ++++++-- ansible/roles/glance/tasks/bootstrap.yml | 8 ++++++-- ansible/roles/haproxy/templates/haproxy.cfg.j2 | 4 ++-- ansible/roles/heat/tasks/bootstrap.yml | 8 ++++++-- ansible/roles/ironic/tasks/bootstrap.yml | 8 ++++++-- ansible/roles/murano/tasks/bootstrap.yml | 8 ++++++-- ansible/roles/neutron/tasks/bootstrap.yml | 8 ++++++-- ansible/roles/nova/tasks/bootstrap.yml | 8 ++++++-- 8 files changed, 44 insertions(+), 16 deletions(-) diff --git a/ansible/roles/cinder/tasks/bootstrap.yml b/ansible/roles/cinder/tasks/bootstrap.yml index 4b72e76112..b0a949f8f1 100644 --- a/ansible/roles/cinder/tasks/bootstrap.yml +++ b/ansible/roles/cinder/tasks/bootstrap.yml @@ -64,15 +64,19 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['cinder-api'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for bootstrap container to exit command: docker wait bootstrap_cinder - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed failed_when: bootstrap_result.stdout != "0" register: bootstrap_result run_once: True + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['cinder-api'] - name: Cleaning up Cinder bootstrap container docker: diff --git a/ansible/roles/glance/tasks/bootstrap.yml b/ansible/roles/glance/tasks/bootstrap.yml index e17a612d41..fe62557bdc 100644 --- a/ansible/roles/glance/tasks/bootstrap.yml +++ b/ansible/roles/glance/tasks/bootstrap.yml @@ -65,7 +65,9 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['glance-api'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for bootstrap container to exit @@ -73,7 +75,9 @@ register: bootstrap_result run_once: True failed_when: bootstrap_result.stdout != "0" - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['glance-api'] - name: Cleaning up Glance bootstrap container docker: diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index 3e31edb0e3..1b3f91ed34 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -67,13 +67,13 @@ listen keystone_admin {% if enable_glance | bool %} listen glance_registry bind {{ kolla_internal_address }}:{{ glance_registry_port }} -{% for host in groups['glance'] %} +{% for host in groups['glance-registry'] %} server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ glance_registry_port }} check inter 2000 rise 2 fall 5 {% endfor %} listen glance_api bind {{ kolla_internal_address }}:{{ glance_api_port }} -{% for host in groups['glance'] %} +{% for host in groups['glance-api'] %} server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ glance_api_port }} check inter 2000 rise 2 fall 5 {% endfor %} {% endif %} diff --git a/ansible/roles/heat/tasks/bootstrap.yml b/ansible/roles/heat/tasks/bootstrap.yml index 4fb6fbe96b..0c8e3920b4 100644 --- a/ansible/roles/heat/tasks/bootstrap.yml +++ b/ansible/roles/heat/tasks/bootstrap.yml @@ -52,7 +52,9 @@ OS_PROJECT_NAME: "{{ openstack_auth.project_name }}" HEAT_DOMAIN_ADMIN_PASSWORD: "{{ heat_domain_admin_password }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['heat-api'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for bootstrap container to exit @@ -60,7 +62,9 @@ register: bootstrap_result run_once: True failed_when: bootstrap_result.stdout != "0" - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['heat-api'] - name: Cleaning up Heat boostrap container docker: diff --git a/ansible/roles/ironic/tasks/bootstrap.yml b/ansible/roles/ironic/tasks/bootstrap.yml index db5d979d5c..0d55efc459 100644 --- a/ansible/roles/ironic/tasks/bootstrap.yml +++ b/ansible/roles/ironic/tasks/bootstrap.yml @@ -48,13 +48,17 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['ironic-api'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for Ironic bootstrap container to exit command: docker wait bootstrap_ironic run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['ironic-api'] - name: Cleaning up boostrap container docker: diff --git a/ansible/roles/murano/tasks/bootstrap.yml b/ansible/roles/murano/tasks/bootstrap.yml index 2dde55d1d6..5d73debc71 100644 --- a/ansible/roles/murano/tasks/bootstrap.yml +++ b/ansible/roles/murano/tasks/bootstrap.yml @@ -47,13 +47,17 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['murano-api'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for bootstrap container to exit command: docker wait bootstrap_murano run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['murano-api'] - name: Cleaning up Murano boostrap container docker: diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml index f5b72506ae..36b4f96476 100644 --- a/ansible/roles/neutron/tasks/bootstrap.yml +++ b/ansible/roles/neutron/tasks/bootstrap.yml @@ -46,7 +46,9 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['neutron-server'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for bootstrap container to exit @@ -54,7 +56,9 @@ register: bootstrap_result run_once: True failed_when: bootstrap_result.stdout != "0" - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['neutron-server'] - name: Cleaning up Neutron bootstrap container docker: diff --git a/ansible/roles/nova/tasks/bootstrap.yml b/ansible/roles/nova/tasks/bootstrap.yml index 44bfa40b93..d81dddc3ad 100644 --- a/ansible/roles/nova/tasks/bootstrap.yml +++ b/ansible/roles/nova/tasks/bootstrap.yml @@ -64,7 +64,9 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" run_once: True - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['nova-api'] # https://github.com/ansible/ansible-modules-core/pull/1031 - name: Waiting for bootstrap container to exit @@ -72,7 +74,9 @@ register: bootstrap_result run_once: True failed_when: bootstrap_result.stdout != "0" - when: database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + when: + - database.stdout.find('localhost | SUCCESS => ') != -1 and (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed + - inventory_hostname in groups['nova-api'] - name: Cleaning up Nova bootstrap container docker: