From b8802f5ce1dc922ff20cab0a46cd7d715323c461 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 28 Jan 2016 16:16:15 -0600 Subject: [PATCH] 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 --- playbooks/os-neutron-install.yml | 10 ++++++---- ...utron-conditional-overlay-net-eeb6ffefbe01c188.yaml | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/neutron-conditional-overlay-net-eeb6ffefbe01c188.yaml diff --git a/playbooks/os-neutron-install.yml b/playbooks/os-neutron-install.yml index cd42478d57..8ab9d472ae 100644 --- a/playbooks/os-neutron-install.yml +++ b/playbooks/os-neutron-install.yml @@ -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 diff --git a/releasenotes/notes/neutron-conditional-overlay-net-eeb6ffefbe01c188.yaml b/releasenotes/notes/neutron-conditional-overlay-net-eeb6ffefbe01c188.yaml new file mode 100644 index 0000000000..e2be978fef --- /dev/null +++ b/releasenotes/notes/neutron-conditional-overlay-net-eeb6ffefbe01c188.yaml @@ -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".