Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion playbooks/openstack/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def base_openshift_inventory(cluster_hosts):
osev3 = list(set(nodes + etcd + load_balancers))

inventory['cluster_hosts'] = {'hosts': [s.name for s in cluster_hosts]}
inventory['OSEv3'] = {'hosts': osev3}
inventory['OSEv3'] = {'hosts': osev3, 'vars': {}}
inventory['masters'] = {'hosts': masters}
inventory['etcd'] = {'hosts': etcd}
inventory['nodes'] = {'hosts': nodes}
Expand Down Expand Up @@ -168,6 +168,12 @@ def build_inventory():
except KeyError:
pass # Not an API load balanced deployment

try:
inventory['OSEv3']['vars'][
'openshift_master_cluster_hostname'] = stout['private_api_ip']
except KeyError:
pass # Internal LB not specified

inventory['localhost']['openshift_openstack_public_api_ip'] = \
stout.get('public_api_ip')
inventory['localhost']['openshift_openstack_public_router_ip'] = \
Expand Down
12 changes: 12 additions & 0 deletions roles/openshift_openstack/templates/heat_stack.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ outputs:
value: { get_attr: [infra_nodes, resource.0, floating_ip] }
{% endif %}

private_api_ip:
description: >
The address of the private OpenShift API. This is used during OpenShift
deployment and for API access by the internal pods and services.
{% if openshift_openstack_use_lbaas_load_balancer %}
value: { get_attr: [api_lb, vip_address] }
{% elif openshift_openstack_use_vm_load_balancer %}
value: { get_attr: [loadbalancer, resource.0, private_ip] }
{% else %}
value: { get_attr: [masters, resource.0, private_ip] }
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well done!


{% if openshift_use_kuryr|default(false)|bool %}
vm_subnet:
description: ID of the subnet the Pods will be on
Expand Down