0b7b86cd33fd64bcfda57c718e67d36c04ca7986
[releng/builder.git] / openstack-hot / apex-server.yaml
1 ---
2 heat_template_version: 2016-04-08
3
4 parameters:
5     job_name:
6         type: string
7         description: Name of job running this template
8     silo:
9         type: string
10         default: vm
11         description: |
12             String to identify a Jenkins Master
13
14             Useful in scenarios where multiple Jenkins Masters might be
15             creating VMs in the same cloud to uniquely distinguish them.
16
17             TODO we should move to using tags once OpenStack Ocata which is
18             available to us with support for server tags properties.
19     index:
20         type: number
21     group:
22         type: number
23         default: "0"
24     vm_flavor:
25         type: string
26         default: v1-standard-4
27         description: OpenStack Flavor to use
28     vm_image:
29         type: string
30         description: VM Image to spin up
31
32 resources:
33     port:
34         type: "OS::Neutron::Port"
35         properties:
36             allowed_address_pairs:
37                 - ip_address: 192.0.2.0/24
38             network: APEX_192_network
39     instance:
40         type: "OS::Nova::Server"
41         properties:
42             image: {get_param: vm_image}
43             flavor: {get_param: vm_flavor}
44             name:
45                 str_replace:
46                     template: SILO-JOB_NAME-GROUP-VM_TYPE-INDEX
47                     params:
48                         "SILO": {get_param: silo}
49                         "JOB_NAME": {get_param: job_name}
50                         "VM_TYPE":
51                             str_split:
52                                 - ' - '
53                                 - {get_param: vm_image}
54                                 - 2
55                         "GROUP": {get_param: group}
56                         "INDEX": {get_param: index}
57             networks:
58                 - port: {get_resource: port}