Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
140 lines (121 sloc) 3.29 KB
---
heat_template_version: 2016-10-14
description:
An instance for a bastion server
The instances are created with Heat and then configured with Ansible
parameters:
internal_network:
description: >
The name or ID of the internal network
type: string
constraints:
- custom_constraint: neutron.network
internal_subnet:
description: >
The name or ID of the internal IPv4 space
type: string
constraints:
- custom_constraint: neutron.subnet
security_group:
description: >
Allow bastion server access to instances
type: string
constraints:
- custom_constraint: neutron.security_group
image:
description: >
The Glance image to use as a base for bastion server
type: string
constraints:
- custom_constraint: glance.image
volume_size:
description: >
The size of the root cinder volume
type: string
flavor:
description: >
The name of the OpenStack flavor to use
type: string
default: m1.small
constraints:
- custom_constraint: nova.flavor
hostname:
description: >
The Infrastructure hostname portion of the FQDN
type: string
constraints:
- allowed_pattern: '[a-z0-9\-]*'
description: Hostname must contain only characters [a-z0-9\-].
domain_name:
description: >
All VMs will be placed in this domain
type: string
# Access to the VMs
ssh_user:
type: string
description: >
The SSH user available on all nodes.
ssh_key_name:
type: string
description: Name of the SSH keypair registered with Nova
constraints:
- custom_constraint: nova.keypair
resources:
# A VM to provide host based orchestration and other sub-services
host:
type: OS::Nova::Server
properties:
name:
str_replace:
template: "HOSTNAME"
params:
HOSTNAME: {get_param: hostname}
admin_user: {get_param: ssh_user}
image: {get_param: image}
flavor: {get_param: flavor}
key_name: {get_param: ssh_key_name}
networks:
- port: {get_resource: port}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: init}
block_device_mapping:
- device_name: vda
volume_id: { get_resource: root_volume }
delete_on_termination: true
port:
type: OS::Neutron::Port
properties:
security_groups:
- {get_param: security_group}
network: {get_param: internal_network}
fixed_ips:
- subnet: {get_param: internal_subnet}
replacement_policy: AUTO
root_volume:
type: OS::Cinder::Volume
properties:
size: {get_param: volume_size}
image: {get_param: image}
availability_zone: nova
init:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: set_hostname}
set_hostname:
type: OS::Heat::CloudConfig
properties:
cloud_config:
hostname: {get_param: hostname}
fqdn:
str_replace:
template: "HOSTNAME.DOMAIN"
params:
HOSTNAME: {get_param: hostname}
DOMAIN: {get_param: domain_name}
outputs:
ip_address:
description: The internal IP address of the instance
value:
name: {get_param: hostname}
address: {get_attr: [port, fixed_ips, 0, ip_address]}