Merge "Fix to correctly set the cinder_storage_address"

This commit is contained in:
Jenkins 2015-10-16 15:57:51 +00:00 committed by Gerrit Code Review
commit 0e19217edf

View File

@ -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) }}"