Allow to specify the public IP to be used for public endpoints

This complements a previous patchset in case the Bifrost deployment
user would like to set a specific value instead of using the interface
IP value. This could be useful in case NAT is used for instance.

Change-Id: I67e45c98473de35c08feb67a9f792270230f6499
This commit is contained in:
Olivier Bourdon 2018-10-02 14:36:36 +02:00
parent 1e19c45199
commit beb404f19a
4 changed files with 16 additions and 3 deletions

View File

@ -170,7 +170,7 @@
- name: "Setting external Ironic public URL"
set_fact:
ironic_public_url: "{{ ironic.keystone.public_url | default('http://127.0.0.1:6385/') | replace('127.0.0.1', hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address']) }}"
ironic_public_url: "{{ ironic.keystone.public_url | default('http://127.0.0.1:6385/') | replace('127.0.0.1', public_ip | default(hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'])) }}"
when: use_public_urls | default(false) | bool
- name: "Create ironic public endpoint"

View File

@ -149,7 +149,7 @@
- name: "Setting external ironic-inspector public URL"
set_fact:
ironic_inspector_public_url: "{{ ironic_inspector.keystone.public_url | default('http://127.0.0.1:5050/') | replace('127.0.0.1', hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address']) }}"
ironic_inspector_public_url: "{{ ironic_inspector.keystone.public_url | default('http://127.0.0.1:5050/') | replace('127.0.0.1', public_ip | default(hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'])) }}"
when: use_public_urls | default(false) | bool
# NOTE(TheJulia): This seems like something that should be

View File

@ -163,7 +163,7 @@
- name: "Setting external Keystone public URL"
set_fact:
keystone_public_url: "{{ keystone.bootstrap.public_url | replace('127.0.0.1', hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address']) }}"
keystone_public_url: "{{ keystone.bootstrap.public_url | replace('127.0.0.1', public_ip | default(hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'])) }}"
when: use_public_urls | default(false) | bool
- name: "Bootstrap Keystone Database"

View File

@ -0,0 +1,13 @@
---
features:
- |
By adding extra string variable ``-e public_ip=8.8.8.8``
which is to be used in conjunction with ``use_public_urls=true``
Bifrost, if used with Keystone enabled, will configure
public services endpoints (for Keystone, Ironic and Ironic
Inspector) to contain this public IP address in replacement
of the default values which are set to point to localhost.
The default behaviour is kept unchanged, which means that
services public endpoints will contain references to
localhost aka 127.0.0.1.