tripleo-heat-templates/extraconfig/post_deploy/undercloud_post.yaml
Dan Prince 32fe279eec Undercloud: fix stackrc TLS URL detection
We want to configure a TLS url for the underclouds stackrc
when a user specified or generated TLS certificate is used.
This patch updates the existing check so that
the PublicSSLCertificateAutogenerated paremeter is also used
when deciding if the SSL URL should be enabled.

Change-Id: I7561b5de7749ca57f8ac8056b470228e1026eb31
2018-02-15 00:02:39 +00:00

114 lines
3.5 KiB
YAML

heat_template_version: queens
description: >
Post-deployment for the TripleO undercloud
parameters:
servers:
type: json
DeployedServerPortMap:
default: {}
type: json
UndercloudHomeDir:
description: The HOME directory where the stackrc and ssh credentials for the Undercloud will be installed. Set to /home/<user> to customize the location.
type: string
default: '/root'
UndercloudDhcpRangeStart:
type: string
default: '192.168.24.5'
UndercloudDhcpRangeEnd:
type: string
default: '192.168.24.24'
UndercloudNetworkCidr:
type: string
default: '192.168.24.0/24'
UndercloudNetworkGateway:
type: string
default: '192.168.24.1'
UndercloudNameserver:
type: string
default: ''
AdminPassword: #supplied by tripleo-undercloud-passwords.yaml
type: string
description: The password for the keystone admin account, used for monitoring, querying neutron etc.
hidden: True
SSLCertificate:
description: >
The content of the SSL certificate (without Key) in PEM format.
type: string
default: ""
hidden: True
PublicSSLCertificateAutogenerated:
default: false
description: >
Whether the public SSL certificate was autogenerated or not.
type: boolean
SnmpdReadonlyUserPassword:
description: The user password for SNMPd with readonly rights running on all Overcloud nodes
type: string
hidden: true
conditions:
tls_enabled:
or:
- not:
equals:
- {get_param: SSLCertificate}
- ""
- equals:
- {get_param: PublicSSLCertificateAutogenerated}
- true
resources:
UndercloudPostConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: deploy_identifier
- name: local_ip
- name: undercloud_dhcp_start
- name: undercloud_dhcp_end
- name: undercloud_network_cidr
- name: undercloud_network_gateway
- name: undercloud_nameserver
- name: admin_password
- name: auth_url
- name: snmp_readonly_user_password
config: {get_file: ./undercloud_post.sh}
UndercloudPostDeployment:
type: OS::Heat::SoftwareDeployments
properties:
name: UndercloudPostDeployment
servers: {get_param: servers}
config: {get_resource: UndercloudPostConfig}
input_values:
local_ip: {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}
undercloud_dhcp_start: {get_param: UndercloudDhcpRangeStart}
undercloud_dhcp_end: {get_param: UndercloudDhcpRangeEnd}
undercloud_network_cidr: {get_param: UndercloudNetworkCidr}
undercloud_network_gateway: {get_param: UndercloudNetworkGateway}
undercloud_nameserver: {get_param: UndercloudNameserver}
ssl_certificate: {get_param: SSLCertificate}
homedir: {get_param: UndercloudHomeDir}
admin_password: {get_param: AdminPassword}
snmp_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
# if SSL is enabled we use the public virtual ip as the stackrc endpoint
auth_url:
if:
- tls_enabled
- make_url:
scheme: https
host: {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}
port: 13000
path: /
- make_url:
scheme: http
host: {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}
port: 5000
path: /