Skip to content

Instantly share code, notes, and snippets.

@pedro-r-marques
Created January 20, 2015 23:37
Show Gist options
  • Save pedro-r-marques/80b4c938b63263b2dad0 to your computer and use it in GitHub Desktop.
Save pedro-r-marques/80b4c938b63263b2dad0 to your computer and use it in GitHub Desktop.
heat_template_version: 2013-05-23
description: Web Service Stack
parameters:
lb_pool_name:
type: string
description: Name of the loadbalancer
server01_name:
type: string
description: Name of the server01 - instance/volume
server02_name:
type: string
description: Name of the server02 - instance/volume
public_net_id:
type: string
description: ID of the public network
private_net_id:
type: string
description: ID of the private network
private_subnet_id:
type: string
description: ID of the private network subnet
server_flavor:
type: string
description: Instance type for the servers
default: m1.small
constraints:
- allowed_values: [m1.tiny, m1.small, m1.medium, m1.large]
volume_source:
type: string
description: Source volume for clonned volumes
resources:
server_volume_01:
type: OS::Cinder::Volume
properties:
name: { get_param: server01_name }
size: 20
source_volid: { get_param: server_volume }
server_instance_01:
type: OS::Nova::Server
properties:
block_device_mapping:
- volume_id: { get_resource: server_volume_01 }
device_name: vda
flavor: { get_param: server_flavor }
name: { get_param: server01_name }
networks:
- network: { get_param: private_net_id }
security_groups:
- default
user_data_format: RAW
user_data: |
#!/bin/bash -v
server_volume_02:
type: OS::Cinder::Volume
properties:
name: { get_param: server02_name }
size: 20
source_volid: { get_param: server_volume }
server_instance_02:
type: OS::Nova::Server
properties:
block_device_mapping:
- volume_id: { get_resource: server_volume_02 }
device_name: vda
flavor: { get_param: server_flavor }
name: { get_param: server02_name }
networks:
- network: { get_param: private_net_id }
security_groups:
- default
user_data_format: RAW
user_data: |
#!/bin/bash -v
neutron_ping_healt_monitor:
type: OS::Neutron::HealthMonitor
properties:
admin_state_up: True
delay: 20
max_retries: 10
timeout: 10
type: PING
neutron_pool:
type: OS::Neutron::Pool
properties:
admin_state_up: True
lb_method: ROUND_ROBIN
name: { get_param: lb_pool_name }
protocol: HTTP
monitors:
- { get_resource: neutron_ping_healt_monitor }
subnet_id: { get_param: private_subnet_id }
vip:
protocol_port: 80
admin_state_up: True
subnet: { get_param: vip_subnet_id }
neutron_pool_member_instance_01:
type: OS::Neutron::PoolMember
properties:
address: { get_attr: [ server_instance_01, first_address ] }
admin_state_up: True
pool_id: { get_resource: neutron_pool }
protocol_port: 80
weight: 1
neutron_pool_member_instance_02:
type: OS::Neutron::PoolMember
properties:
address: { get_attr: [ server_instance_02, first_address ] }
admin_state_up: True
pool_id: { get_resource: neutron_pool }
protocol_port: 80
weight: 1
neutron_floatingip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net_id }
port_id: { "Fn::Select" : [ "port_id", { get_attr: [ neutron_pool , vip ] } ] }
- See more at: http://tcpcloud.eu/en/blog/2015/01/12/heat-application-stack-opencontrail/#sthash.MjArrHw6.dpuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment