-
Notifications
You must be signed in to change notification settings - Fork 0
/
single_compute-template.yml
78 lines (72 loc) · 2.21 KB
/
single_compute-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
heat_template_version: 2013-05-23
description: >
This is an template to install a basic instance on
a delcared tenant network.
parameters:
key_name:
type: string
label: key_name
description: Name of key-pair to be used for compute instance
default: admin
image_id:
type: string
label: image_id
description: Name of the image to use for compute instance
default: ubuntu-trusty
instance_type:
type: string
label: instance_type
description: Type of instance (flavor) to be used
default: m1.medium
constraints:
- allowed_values: [ m1.medium, m1.large, m1.xlarge ]
description: Value must be m1.medium, m1.large, or m1.xlarge
public_net:
type: string
description: public network id
secgroup_id:
type: string
description : Id of the security group
tenant_net:
type: string
description: tenant network id
tenant_subnet:
type: string
description: tenant subnet id
resources:
instance_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: tenant_net }
security_groups: [ get_param: secgroup_id ]
fixed_ips:
- subnet_id: { get_param: tenant_subnet }
instance_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net }
port_id: { get_resource: chefserver_port }
instance:
type: OS::Nova::Server
properties:
name: chefserver
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: m1.medium
admin_user: ubuntu
networks:
- port: { get_resource: instance_port }
user_data:
str_replace:
template: |
#!/bin/bash
sudo apt-get update
sudo echo "127.0.0.1 instance instance" >> /etc/hosts
sudo apt-get -y wget
outputs:
instance_private_ip:
description: Private IP address of instance
value: { get_attr: [ instance, first_address ] }
chefserver_public_ip:
description: Floating IP address of chefserver
value: { get_attr: [ instance_floating_ip, floating_ip_address ] }