Add conditional for overlay network settings

A conditional has been added to the ``_local_ip`` settings used in
the ``neutron_local_ip`` which removes the hard requirement for an
overlay network to be set within a deployment. If no overlay network
is set within the deployment the ``local_ip`` will be set to the
value of ``ansible_ssh_host``.

Change-Id: I954a46443b5434b589226c4999e71bd6ba6a5c0b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-01-28 16:16:15 -06:00 committed by Jimmy McCrory
parent 8ef3b5db42
commit b8802f5ce1
2 changed files with 13 additions and 4 deletions

View File

@ -170,22 +170,23 @@
- name: set local_ip fact (is_metal)
set_fact:
_local_ip: "{{ hostvars[inventory_hostname]['ansible_' + _overlay_network.bridge|replace('-', '_')]['ipv4']['address'] }}"
when: is_metal | bool
_local_ip: "{{ hostvars[inventory_hostname]['ansible_' + _overlay_network.bridge|default('br-mgmt')|replace('-', '_')]['ipv4']['address']|default(ansible_ssh_host) }}"
when:
- is_metal | bool
tags:
- neutron-config
- name: set local_ip fact (container)
set_fact:
_local_ip: "{{ _overlay_network.address|default(ansible_ssh_host) }}"
when: not is_metal | bool
when:
- not is_metal | bool
tags:
- neutron-config
roles:
- role: "os_neutron"
neutron_venv_tag: "{{ openstack_release }}"
neutron_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/neutron-{{ openstack_release }}.tgz"
neutron_local_ip: "{{ _local_ip }}"
neutron_overlay_network: "{{ _overlay_network }}"
neutron_provider_networks: "{{ _provider_networks }}"
pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}"
@ -211,6 +212,7 @@
neutron_galera_user: neutron
neutron_galera_database: neutron
neutron_galera_address: "{{ galera_address }}"
neutron_local_ip: "{{ _local_ip|default('127.0.0.1') }}"
bind_prefix: "{{ provider_network_bind_prefix|default('') }}"
neutron_rabbitmq_userid: neutron
neutron_rabbitmq_vhost: /neutron

View File

@ -0,0 +1,7 @@
---
features:
- A conditional has been added to the ``_local_ip`` settings used in
the ``neutron_local_ip`` which removes the hard requirement for an
overlay network to be set within a deployment. If no overlay network
is set within the deployment the ``local_ip`` will be set to the value
of "ansible_ssh_host".