Bump template version for all templates to "ocata"
[apex-tripleo-heat-templates.git] / ci / pingtests / scenario002-multinode.yaml
1 heat_template_version: ocata
2
3 description: >
4   HOT template to created resources deployed by scenario002.
5 parameters:
6   key_name:
7     type: string
8     description: Name of keypair to assign to servers
9     default: 'pingtest_key'
10   image:
11     type: string
12     description: Name of image to use for servers
13     default: 'pingtest_image'
14   public_net_name:
15     type: string
16     default: 'nova'
17     description: >
18       ID or name of public network for which floating IP addresses will be allocated
19   private_net_name:
20     type: string
21     description: Name of private network to be created
22     default: 'default-net'
23   private_net_cidr:
24     type: string
25     description: Private network address (CIDR notation)
26     default: '192.168.2.0/24'
27   private_net_gateway:
28     type: string
29     description: Private network gateway address
30     default: '192.168.2.1'
31   private_net_pool_start:
32     type: string
33     description: Start of private network IP address allocation pool
34     default: '192.168.2.100'
35   private_net_pool_end:
36     type: string
37     default: '192.168.2.200'
38     description: End of private network IP address allocation pool
39
40 resources:
41
42   key_pair:
43     type: OS::Nova::KeyPair
44     properties:
45       save_private_key: true
46       name: {get_param: key_name }
47
48   private_net:
49     type: OS::Neutron::Net
50     properties:
51       name: { get_param: private_net_name }
52
53   private_subnet:
54     type: OS::Neutron::Subnet
55     properties:
56       network_id: { get_resource: private_net }
57       cidr: { get_param: private_net_cidr }
58       gateway_ip: { get_param: private_net_gateway }
59       allocation_pools:
60         - start: { get_param: private_net_pool_start }
61           end: { get_param: private_net_pool_end }
62
63   router:
64     type: OS::Neutron::Router
65     properties:
66       external_gateway_info:
67         network: { get_param: public_net_name }
68
69   router_interface:
70     type: OS::Neutron::RouterInterface
71     properties:
72       router_id: { get_resource: router }
73       subnet_id: { get_resource: private_subnet }
74
75   luks_volume_type:
76     type: OS::Cinder::VolumeType
77     properties:
78       name: LUKS
79
80   encrypted_volume_type:
81     type: OS::Cinder::EncryptedVolumeType
82     properties:
83       volume_type: {get_resource: luks_volume_type}
84       provider: nova.volume.encryptors.luks.LuksEncryptor
85       cipher: aes-xts-plain64
86       control_location: front-end
87       key_size: 256
88
89   volume1:
90     type: OS::Cinder::Volume
91     depends_on: encrypted_volume_type
92     properties:
93       name: Volume1
94       image: { get_param: image }
95       size: 1
96       volume_type: {get_resource: luks_volume_type}
97
98   server1:
99     type: OS::Nova::Server
100     depends_on: volume1
101     properties:
102       name: Server1
103       block_device_mapping:
104         - device_name: vda
105           volume_id: { get_resource: volume1 }
106       flavor: { get_resource: test_flavor }
107       key_name: { get_resource: key_pair }
108       networks:
109         - port: { get_resource: server1_port }
110
111   server1_port:
112     type: OS::Neutron::Port
113     properties:
114       network_id: { get_resource: private_net }
115       fixed_ips:
116         - subnet_id: { get_resource: private_subnet }
117       security_groups: [{ get_resource: server_security_group }]
118
119   server1_floating_ip:
120     type: OS::Neutron::FloatingIP
121     # TODO: investigate why we need this depends_on and if we could
122     # replace it by router_id with get_resource: router_interface
123     depends_on: router_interface
124     properties:
125       floating_network: { get_param: public_net_name }
126       port_id: { get_resource: server1_port }
127
128   server_security_group:
129     type: OS::Neutron::SecurityGroup
130     properties:
131       description: Add security group rules for server
132       name: pingtest-security-group
133       rules:
134         - remote_ip_prefix: 0.0.0.0/0
135           protocol: tcp
136           port_range_min: 22
137           port_range_max: 22
138         - remote_ip_prefix: 0.0.0.0/0
139           protocol: icmp
140
141   test_flavor:
142     type: OS::Nova::Flavor
143     properties:
144       ram: 512
145       vcpus: 1
146
147   zaqar_queue:
148     type: OS::Zaqar::Queue
149     properties:
150       name: pingtest-queue
151
152 outputs:
153   server1_private_ip:
154     description: IP address of server1 in private network
155     value: { get_attr: [ server1, first_address ] }
156   server1_public_ip:
157     description: Floating IP address of server1 in public network
158     value: { get_attr: [ server1_floating_ip, floating_ip_address ] }