From efe45551cb2f28fe13e32896935a39c4f610425a Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 8 Oct 2015 11:11:40 -0500 Subject: [PATCH] Fix to correctly set the cinder_storage_address This change sets the cinder storage address based on the facts the play is able to set about the environment. This will correct configure the iscsi address within cinder to use the correct network which is not always the default container address. Change-Id: I647161c0154cad11bf2f31b6b7cd8476e0662f12 Closes-Bug: #1504208 Signed-off-by: Kevin Carter --- playbooks/os-cinder-install.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/playbooks/os-cinder-install.yml b/playbooks/os-cinder-install.yml index 6e00e63f5a..f211abffac 100644 --- a/playbooks/os-cinder-install.yml +++ b/playbooks/os-cinder-install.yml @@ -114,6 +114,46 @@ when: is_metal | bool tags: - cinder-logs + - name: Set cinder storage bridge (is_metal) + set_fact: + storage_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] | replace('-', '_') }}" + when: + - hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] is defined + - is_metal | bool + tags: + - cinder-config + - name: Set cinder storage address (is_metal) + set_fact: + storage_address: "{{ hostvars[inventory_hostname][storage_bridge]['ipv4']['address'] }}" + when: + - hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] is defined + - is_metal | bool + tags: + - cinder-config + - name: Set cinder storage bridge (is_metal no storage network) + set_fact: + storage_address: "{{ ansible_ssh_host }}" + when: + - hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] is undefined + - is_metal | bool + tags: + - cinder-config + - name: Set cinder storage address (container) + set_fact: + storage_address: "{{ hostvars[inventory_hostname]['container_networks']['storage_address']['address'] }}" + when: + - hostvars[inventory_hostname]['container_networks']['storage_address']['address'] is defined + - not is_metal | bool + tags: + - cinder-config + - name: Set cinder storage address (container no storage network) + set_fact: + storage_address: "{{ ansible_ssh_host }}" + when: + - hostvars[inventory_hostname]['container_networks']['storage_address']['address'] is undefined + - not is_metal | bool + tags: + - cinder-config roles: - role: "os_cinder" cinder_venv_tag: "{{ openstack_release }}" @@ -142,3 +182,4 @@ galera_address: "{{ internal_lb_vip_address }}" ansible_hostname: "{{ container_name }}" is_metal: "{{ properties.is_metal|default(false) }}" +