Add DeployedServerEnvironmentOutput

Add a new output, DeployedServerEnvionmentOutput, that can be used as
the contents of an environment file to input into a services only stack
when using split-stack. The parameter simplifies the manual steps needed
to deploy split-stack.

By default, the resource that generates the output is mapped to
OS::Heat::None.

implements blueprint split-stack-default
Change-Id: I6004cd3f56778f078a69a20e93a0eba0c574b3db
This commit is contained in:
James Slagle 2017-04-28 16:01:14 -04:00
parent 83defdbdbf
commit d0acf56606
12 changed files with 348 additions and 0 deletions

View File

@ -0,0 +1,65 @@
heat_template_version: pike
parameters:
RoleCounts:
type: json
default: {}
VipMap:
type: json
default: {}
DeployedServerPortMap:
type: json
default: {}
DeployedServerDeploymentSwiftDataMap:
type: json
default: {}
DefaultRouteIp:
type: string
default: 192.168.24.1
resources:
DeployedServerPortMapParameter:
type: OS::Heat::Value
properties:
type: json
value:
DeployedServerPortMap:
map_merge:
- {get_param: DeployedServerPortMap}
- control_virtual_ip:
fixed_ips:
- ip_address: {get_param: [VipMap, ctlplane]}
- redis_virtual_ip:
fixed_ips:
- ip_address: {get_param: [VipMap, redis]}
ResourceRegistry:
type: OS::Heat::Value
properties:
type: json
value:
OS::TripleO::DeployedServer::ControlPlanePort: tripleo-heat-templates/deployed-server/deployed-neutron-port.yaml
OS::TripleO::Network::Ports::ControlPlaneVipPort: tripleo-heat-templates/deployed-server/deployed-neutron-port.yaml
DeployedServerEnvironment:
type: OS::Heat::Value
properties:
type: json
value:
resource_registry:
{get_attr: [ResourceRegistry, value]}
parameter_defaults:
map_merge:
- {get_attr: [DeployedServerPortMapParameter, value]}
- DeploymentSwiftDataMap: {get_param: DeployedServerDeploymentSwiftDataMap}
- EC2MetadataIp: {get_param: DefaultRouteIp}
- ControlPlaneDefaultRoute: {get_param: DefaultRouteIp}
- {get_param: RoleCounts}
outputs:
deployed_server_environment:
description:
Environment data that can be used as input into the services stack when
using split-stack.
value: {get_attr: [DeployedServerEnvironment, value]}

View File

@ -4,6 +4,7 @@ resource_registry:
OS::TripleO::DefaultPasswords: OS::Heat::None
OS::TripleO::RandomString: OS::Heat::None
OS::TripleO::AllNodesDeployment: OS::Heat::None
OS::TripleO::DeployedServerEnvironment: ../deployed-server/deployed-server-environment-output.yaml
parameter_defaults:
# Deploy no services

View File

@ -1,3 +1,6 @@
resource_registry:
OS::TripleO::DeployedServerEnvironment: ../deployed-server/deployed-server-environment-output.yaml
parameter_defaults:
# Consistent Hostname format
ControllerDeployedServerHostnameFormat: overcloud-controller-%index%

View File

@ -107,6 +107,8 @@ resource_registry:
# Upgrade resources
OS::TripleO::UpgradeConfig: puppet/upgrade_config.yaml
OS::TripleO::DeployedServerEnvironment: OS::Heat::None
# services
OS::TripleO::Services: services.yaml
OS::TripleO::Services::Apache: puppet/services/apache.yaml

View File

@ -778,6 +778,38 @@ resources:
{{role.name}}: {get_attr: [{{role.name}}, attributes, os_collect_config]}
{% endfor %}
DeployedServerEnvironment:
type: OS::TripleO::DeployedServerEnvironment
properties:
RoleCounts:
{% for role in roles %}
{{role.name}}DeployedServerCount: {get_param: {{role.name}}Count}
{% endfor %}
VipMap:
map_merge:
- {get_attr: [VipMap, net_ip_map]}
- redis: {get_attr: [RedisVirtualIP, ip_address]}
DeployedServerPortMap:
map_merge:
list_concat:
{% for role in roles %}
- {get_attr: [{{role.name}}, deployed_server_port_map]}
{% endfor %}
DeployedServerDeploymentSwiftDataMap:
map_merge:
list_concat:
{% for role in roles %}
- {get_attr: [{{role.name}}, deployed_server_deployment_swift_data_map]}
{% endfor %}
DefaultRouteIp:
str_split:
- ':'
- str_split:
- '/'
- {get_attr: [ServerOsCollectConfigData, value, {{primary_role_name}}, '0', request, metadata_url]}
- 2
- 0
outputs:
ManagedEndpoints:
description: Asserts that the keystone endpoints have been provisioned.
@ -843,3 +875,8 @@ outputs:
ServerIdData:
description: Mapping of each role to a list of nova server IDs and the bootstrap ID
value: {get_attr: [ServerIdMap, value]}
DeployedServerEnvironment:
description:
Environment data that can be used as input into the services stack when
using split-stack.
value: {get_attr: [DeployedServerEnvironment, deployed_server_environment]}

View File

@ -646,6 +646,45 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
management_ip_address:
description: IP address of the server in the management network
value: {get_attr: [ManagementPort, ip_address]}
deployed_server_port_map:
description: |
Map of Heat created hostname of the server to ip address. This is the
hostname before it has been mapped with the HostnameMap parameter, and
the IP address from the ctlplane network. This map can be used to construct
the DeployedServerPortMap parameter when using split-stack.
value:
map_replace:
- hostname:
fixed_ips:
- ip_address: {get_attr: [BlockStorage, networks, ctlplane, 0]}
- keys:
hostname:
list_join:
- '-'
- - {get_param: Hostname}
- ctlplane
deployed_server_deployment_swift_data_map:
description:
Map of Heat created hostname of the server to the Swift container and object
used to created the temporary url for metadata polling with
os-collect-config.
value:
map_replace:
- hostname:
container:
str_split:
- '/'
- {get_attr: [BlockStorage, os_collect_config, request, metadata_url]}
- 5
object:
str_split:
- '?'
- str_split:
- '/'
- {get_attr: [BlockStorage, os_collect_config, request, metadata_url]}
- 6
- 0
- keys: {hostname: {get_param: Hostname}}
os_collect_config:
description: The os-collect-config configuration associated with this server resource
value: {get_attr: [BlockStorage, os_collect_config]}

View File

@ -657,6 +657,45 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
management_ip_address:
description: IP address of the server in the management network
value: {get_attr: [ManagementPort, ip_address]}
deployed_server_port_map:
description: |
Map of Heat created hostname of the server to ip address. This is the
hostname before it has been mapped with the HostnameMap parameter, and
the IP address from the ctlplane network. This map can be used to construct
the DeployedServerPortMap parameter when using split-stack.
value:
map_replace:
- hostname:
fixed_ips:
- ip_address: {get_attr: [CephStorage, networks, ctlplane, 0]}
- keys:
hostname:
list_join:
- '-'
- - {get_param: Hostname}
- ctlplane
deployed_server_deployment_swift_data_map:
description:
Map of Heat created hostname of the server to the Swift container and object
used to created the temporary url for metadata polling with
os-collect-config.
value:
map_replace:
- hostname:
container:
str_split:
- '/'
- {get_attr: [CephStorage, os_collect_config, request, metadata_url]}
- 5
object:
str_split:
- '?'
- str_split:
- '/'
- {get_attr: [CephStorage, os_collect_config, request, metadata_url]}
- 6
- 0
- keys: {hostname: {get_param: Hostname}}
os_collect_config:
description: The os-collect-config configuration associated with this server resource
value: {get_attr: [CephStorage, os_collect_config]}

View File

@ -602,6 +602,45 @@ outputs:
management_ip_address:
description: IP address of the server in the management network
value: {get_attr: [ManagementPort, ip_address]}
deployed_server_port_map:
description: |
Map of Heat created hostname of the server to ip address. This is the
hostname before it has been mapped with the HostnameMap parameter, and
the IP address from the ctlplane network. This map can be used to construct
the DeployedServerPortMap parameter when using split-stack.
value:
map_replace:
- hostname:
fixed_ips:
- ip_address: {get_attr: [NovaCompute, networks, ctlplane, 0]}
- keys:
hostname:
list_join:
- '-'
- - {get_param: Hostname}
- ctlplane
deployed_server_deployment_swift_data_map:
description:
Map of Heat created hostname of the server to the Swift container and object
used to created the temporary url for metadata polling with
os-collect-config.
value:
map_replace:
- hostname:
container:
str_split:
- '/'
- {get_attr: [NovaCompute, os_collect_config, request, metadata_url]}
- 5
object:
str_split:
- '?'
- str_split:
- '/'
- {get_attr: [NovaCompute, os_collect_config, request, metadata_url]}
- 6
- 0
- keys: {hostname: {get_param: Hostname}}
hostname:
description: Hostname of the server
value: {get_attr: [NovaCompute, name]}

View File

@ -645,6 +645,45 @@ outputs:
management_ip_address:
description: IP address of the server in the management network
value: {get_attr: [ManagementPort, ip_address]}
deployed_server_port_map:
description:
Map of Heat created hostname of the server to ip address. This is the
hostname before it has been mapped with the HostnameMap parameter, and
the IP address from the ctlplane network. This map can be used to construct
the DeployedServerPortMap parameter when using split-stack.
value:
map_replace:
- hostname:
fixed_ips:
- ip_address: {get_attr: [Controller, networks, ctlplane, 0]}
- keys:
hostname:
list_join:
- '-'
- - {get_param: Hostname}
- ctlplane
deployed_server_deployment_swift_data_map:
description:
Map of Heat created hostname of the server to the Swift container and object
used to created the temporary url for metadata polling with
os-collect-config.
value:
map_replace:
- hostname:
container:
str_split:
- '/'
- {get_attr: [Controller, os_collect_config, request, metadata_url]}
- 5
object:
str_split:
- '?'
- str_split:
- '/'
- {get_attr: [Controller, os_collect_config, request, metadata_url]}
- 6
- 0
- keys: {hostname: {get_param: Hostname}}
hostname:
description: Hostname of the server
value: {get_attr: [Controller, name]}

View File

@ -645,6 +645,45 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
management_ip_address:
description: IP address of the server in the management network
value: {get_attr: [ManagementPort, ip_address]}
deployed_server_port_map:
description: |
Map of Heat created hostname of the server to ip address. This is the
hostname before it has been mapped with the HostnameMap parameter, and
the IP address from the ctlplane network. This map can be used to construct
the DeployedServerPortMap parameter when using split-stack.
value:
map_replace:
- hostname:
fixed_ips:
- ip_address: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
- keys:
hostname:
list_join:
- '-'
- - {get_param: Hostname}
- ctlplane
deployed_server_deployment_swift_data_map:
description:
Map of Heat created hostname of the server to the Swift container and object
used to created the temporary url for metadata polling with
os-collect-config.
value:
map_replace:
- hostname:
container:
str_split:
- '/'
- {get_attr: [SwiftStorage, os_collect_config, request, metadata_url]}
- 5
object:
str_split:
- '?'
- str_split:
- '/'
- {get_attr: [SwiftStorage, os_collect_config, request, metadata_url]}
- 6
- 0
- keys: {hostname: {get_param: Hostname}}
os_collect_config:
description: The os-collect-config configuration associated with this server resource
value: {get_attr: [SwiftStorage, os_collect_config]}

View File

@ -592,6 +592,45 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
value:
{get_resource: {{role.name}}}
condition: server_not_blacklisted
deployed_server_port_map:
description: |
Map of Heat created hostname of the server to ip address. This is the
hostname before it has been mapped with the HostnameMap parameter, and
the IP address from the ctlplane network. This map can be used to construct
the DeployedServerPortMap parameter when using split-stack.
value:
map_replace:
- hostname:
fixed_ips:
- ip_address: {get_attr: [{{role.name}}, networks, ctlplane, 0]}
- keys:
hostname:
list_join:
- '-'
- - {get_param: Hostname}
- ctlplane
deployed_server_deployment_swift_data_map:
description:
Map of Heat created hostname of the server to the Swift container and object
used to created the temporary url for metadata polling with
os-collect-config.
value:
map_replace:
- hostname:
container:
str_split:
- '/'
- {get_attr: [{{role.name}}, os_collect_config, request, metadata_url]}
- 5
object:
str_split:
- '?'
- str_split:
- '/'
- {get_attr: [{{role.name}}, os_collect_config, request, metadata_url]}
- 6
- 0
- keys: {hostname: {get_param: Hostname}}
os_collect_config:
description: The os-collect-config configuration associated with this server resource
value: {get_attr: [{{role.name}}, os_collect_config]}

View File

@ -0,0 +1,6 @@
---
features:
- Add a new output, DeployedServerEnvironment, that can be used as
the contents of an environment file. This environment file can then be used
as input into a services only stack when using split-stack. The parameter
simplifies the manual steps needed to deploy split-stack.