Skip to content

Instantly share code, notes, and snippets.

@Cluster444
Created August 25, 2016 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cluster444/aaf2dd6f718dda90f714dacc5892a1ac to your computer and use it in GitHub Desktop.
Save Cluster444/aaf2dd6f718dda90f714dacc5892a1ac to your computer and use it in GitHub Desktop.
nested openstack heat templates with errors on include
heat_template_version: 2016-04-08
description: Deploys a full stack of instances for processing data
resources:
network_with_pivot:
type: full-network-pivot.yml
properties:
key_name: chris
private_net_name: big-data-net
private_subnet_name: big-data-subnet
$ openstack stack create --wait -t big-data-stack.yml big-data-stack
ERROR: The Resource Type (full-network-pivot.yml) could not be found.
heat_template_version: 2016-04-08
description: Template to deploy a network stack and pivot instance with docker volume attached
parameters:
key_name:
type: string
label: SSH Key Name
description: Name of SSH key-pair to use for instance creation
image_id:
type: string
label: Image ID
description: Image to be used for instance creation
default: ubuntu-xenial
instance_type:
type: string
label: Instance Type
description: The type of instance/flavor to launch as
default: m1.small
public_net:
type: string
label: Public Network
description: The public network to floating IP assignment
default: <uuid of public net>
private_net_name:
type: string
label: Private Network Name
description: Name of the private network
private_subnet_name:
type: string
label: Private Subnet Name
description: Name of the subnet for the private network
private_net_cidr:
type: string
label: Private Network CIDR
description: CIDR for the private network allocation pool
default: 10.0.0.0/24
resources:
internal_sg:
type: OS::Neutron::SecurityGroup
properties:
name: internal
description: Internal Security Group for LAN communication
rules:
- remote_ip_prefix: { get_param: private_net_cidr }
protocol: tcp
- remote_ip_prefix: { get_param: private_net_cidr }
protocol: udp
- remote_ip_prefix: { get_param: private_net_cidr }
protocol: icmp
ssh_sg:
type: OS::Neutron::SecurityGroup
properties:
name: SSH
description: Allow SSH Access
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
private_net:
type: OS::Neutron::Net
properties:
name: { get_param: private_net_name }
private_subnet:
type: OS::Neutron::Subnet
properties:
name: { get_param: private_subnet_name }
network_id: { get_resource: private_net }
cidr: { get_param: private_net_cidr }
dns_nameservers: ["8.8.8.8","8.8.4.4"]
ip_version: 4
router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: public_net }
router_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet_id: { get_resource: private_subnet }
pivot:
type: OS::Nova::Server
properties:
name: pivot
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: { get_param: instance_type }
networks:
- port: { get_resource: pivot_port }
pivot_port:
type: OS::Neutron::Port
properties:
network: { get_resource: private_net }
security_groups:
- { get_resource: internal_sg }
- { get_resource: ssh_sg }
fixed_ips:
- subnet: { get_resource: private_subnet }
pivot_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: public_net }
port_id: { get_resource: pivot_port }
pivot_docker:
type: OS::Cinder::Volume
properties:
name: pivot-docker
size: 20
pivot_docker_attachment:
type: OS::Cinder::VolumeAttachment
properties:
volume_id: { get_resource: pivot_docker }
instance_uuid: { get_resource: pivot }
outputs:
pivot_private_ip:
description: IP Address of pivot in private network
value: { get_attr: [pivot, first_address] }
pivot_public_ip:
description: IP Address of pivot in public network
value: { get_attr: [pivot_floating_ip, floating_ip_address] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment