Skip to content

Instantly share code, notes, and snippets.

@fmount
Last active Jun 13, 2017
Embed
What would you like to do?
heat_template_version: 2015-04-30
description: >
Simple template to deploy lbaas with two httpd servers using heat orchestrator
parameters:
tenant_user_role:
type: string
description: tenant user roles
default: _member_
tenant_user:
type: string
description: tenant user name to add to the new tenant
key_name:
type: string
description : Keypair to be passed to cloud-init inside the new VM
default: ssh_key
image:
type: string
description: >
Image to be used as a base for virtual machine deployments.
instance_type:
type: string
label: Instance Type (Flavor)
description: Type of instance (flavor) to be used
constraints:
- allowed_values: [ flavor1, flavor2 ]
description: Value must be one of flavor1 or flavor2.
sec_group_name:
type: string
description: Name of Security Group
user_name:
type: string
description: User to add to new tenant
constraints:
- allowed_values: [ user1, user2, user3 ]
description: Value must be one of user1, user2 or user3
#public_net_id:
# type: string
# description: >
# Public Network to attach VMs (floating IP)
public_net_name:
type: string
description: Name of Private Network
router_name:
type: string
description: Name of Router
resources:
demo_tenant:
type: OS::Keystone::Project
properties:
name: { get_param: tenant_name }
domain: default
description: Create New Tenant
#user:
# type: OS::Keystone::User
# properties:
# name: { get_param: tenant_user }
# domain: default
# description: Example project tenant user
# #default_project: { get_resource: tenant }
# password: { get_param: tenant_user_password }
# roles:
# - role: { get_param: tenant_user_role }
# project: { get_resource: tenant }
private_net:
type: OS::Neutron::Net
properties:
name: { get_param: private_net_name } }
private_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: private_net }
cidr: 192.168.0.0/24
dns_nameservers:
- 8.8.8.8
router1:
type: OS::Neutron::Router
properties:
name: { get_param: router_name }
external_gateway_info:
network: { get_param: public_net_name }
router1_interface1:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router1 }
subnet_id: { get_resource: private_subnet }
# Add icmp rule to the security group assigned to the created vm
security_group:
type: OS::Neutron::SecurityGroup
properties:
description: Security Group for VM
name: { get_param: sec_group_name }
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
- remote_ip_prefix: 0.0.0.0/0
protocol: icmp
Server1:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: instance_type }
networks:
- network: { get_param: net_name }
outputs:
instance_ip1:
description: The IP address of the deployed instance
value: { get_attr: [Server1, first_address] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment