-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwww.yaml
More file actions
89 lines (81 loc) · 2.19 KB
/
www.yaml
File metadata and controls
89 lines (81 loc) · 2.19 KB
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
79
80
81
82
83
84
85
86
87
88
89
heat_template_version: 2018-03-02
description: Parameterized template to create a web server
parameters:
image:
type: string
label: Image name or ID
description: Image to be used for compute instance
default: Ubuntu server 18.04
flavor:
type: string
label: Flavor
description: Type of instance (flavor) to be used
default: c1-r05-d20
key:
type: string
label: Key name
description: Name of key-pair to be used for compute instance
default: mykey
servername:
type: string
label: Server name
description: Name of the server
default: myserver
networkname:
type: string
label: Network name
description: Name of the network
default: private
subnetname:
type: string
label: Subnet name
description: Name of the subnet
default: subnet
resources:
security_group:
type: OS::Neutron::SecurityGroup
properties:
name: web_server
rules:
- protocol: tcp
port_range_min: 80
port_range_max: 80
myserver_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: networkname }
fixed_ips:
- subnet_id: { get_param: subnetname }
security_groups: [{ get_resource: security_group }, ssh]
myserver_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: public
port_id: { get_resource: myserver_port }
myserver:
type: OS::Nova::Server
properties:
name: { get_param: servername }
key_name: { get_param: key }
image: { get_param: image }
flavor: { get_param: flavor }
availability_zone: Education
networks:
- port: { get_resource: myserver_port }
user_data_format: RAW
user_data: |
#cloud-config
packages:
- apache2
package_update: true
package_upgrade: true
write_files:
- content: |
<html><head><title>Hello!</title></head>
<body><h1>Hello CSCLOUD tutorial</h1><body>
</html>
path: /var/www/html/hello.html
outputs:
instance_ip:
description: Public IP address
value: { get_attr: [myserver_floating_ip, floating_ip_address] }