86 lines
1.8 KiB
YAML
86 lines
1.8 KiB
YAML
heat_template_version: 2013-05-23
|
|
|
|
description: |
|
|
Template to create an instance and check connectivity to it
|
|
|
|
parameters:
|
|
flavor:
|
|
type: string
|
|
image:
|
|
type: string
|
|
subnet_cidr:
|
|
type: string
|
|
default: 190.40.2.0/24
|
|
public_net:
|
|
type: string
|
|
default: public
|
|
private_net:
|
|
type: string
|
|
default: heat-net
|
|
dns_servers:
|
|
type: comma_delimited_list
|
|
default: ["8.8.8.8", "8.8.4.4"]
|
|
|
|
resources:
|
|
sg:
|
|
type: OS::Neutron::SecurityGroup
|
|
properties:
|
|
name: sg
|
|
description: Security group to allow ICMP and SSH
|
|
rules:
|
|
- protocol: icmp
|
|
- protocol: tcp
|
|
port_range_min: 22
|
|
port_range_max: 22
|
|
|
|
floating_ip:
|
|
type: OS::Neutron::FloatingIP
|
|
properties:
|
|
floating_network: {get_param: public_net}
|
|
|
|
network:
|
|
type: OS::Neutron::Net
|
|
|
|
subnet:
|
|
type: OS::Neutron::Subnet
|
|
properties:
|
|
network: {get_resource: network}
|
|
ip_version: 4
|
|
cidr: {get_param: subnet_cidr}
|
|
dns_nameservers: {get_param: dns_servers}
|
|
|
|
router:
|
|
type: OS::Neutron::Router
|
|
properties:
|
|
external_gateway_info:
|
|
network: {get_param: public_net}
|
|
|
|
router_interface:
|
|
type: OS::Neutron::RouterInterface
|
|
properties:
|
|
router: {get_resource: router}
|
|
subnet: {get_resource: subnet}
|
|
|
|
wait_handle:
|
|
type: OS::Heat::WaitConditionHandle
|
|
|
|
server:
|
|
type: OS::Nova::Server
|
|
properties:
|
|
image: {get_param: image}
|
|
flavor: {get_param: flavor}
|
|
networks:
|
|
- subnet: {get_resource: subnet}
|
|
security_groups:
|
|
- {get_resource: sg}
|
|
|
|
server_floating_ip_assoc:
|
|
type: OS::Neutron::FloatingIPAssociation
|
|
properties:
|
|
floatingip_id: {get_resource: floating_ip}
|
|
port_id: {get_attr: [server, addresses, {get_resource: network}, 0, port]}
|
|
|
|
outputs:
|
|
server_ip:
|
|
value: {get_attr: [floating_ip, floating_ip_address]}
|