yaml file for bundle-based-reconciliaion script
[releng/builder.git] / openstack-hot / generic-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     ssh_key:
20         type: string
21         description: SSH Key name to use (Public key must exist in OpenStack)
22     index:
23         type: number
24     group:
25         type: number
26         default: "0"
27     vm_flavor:
28         type: string
29         default: v1-standard-1
30         description: OpenStack Flavor to use
31     vm_image:
32         type: string
33         description: VM Image to spin up
34
35 resources:
36     port:
37         type: "OS::Neutron::Port"
38         properties:
39             allowed_address_pairs:
40                 - ip_address: 10.250.0.0/24
41             network: odlci
42     volume:
43         type: "OS::Cinder::Volume"
44         properties:
45             image: {get_param: vm_image}
46             size: 40
47     instance:
48         type: "OS::Nova::Server"
49         properties:
50             flavor: {get_param: vm_flavor}
51             block_device_mapping_v2:
52                 - volume_id: {get_resource: volume}
53             name:
54                 str_replace:
55                     template: SILO-JOB_NAME-GROUP-VM_TYPE-INDEX
56                     params:
57                         "SILO": {get_param: silo}
58                         "JOB_NAME": {get_param: job_name}
59                         "VM_TYPE":
60                             str_split:
61                                 - ' - '
62                                 - {get_param: vm_image}
63                                 - 2
64                         "GROUP": {get_param: group}
65                         "INDEX": {get_param: index}
66             networks:
67                 - port: {get_resource: port}
68             key_name: {get_param: ssh_key}
69             user_data: |
70                 #!/bin/bash
71                 until host devvexx.opendaylight.org &>/dev/null
72                 do
73                     echo "Waiting until devvexx.opendaylight.org is resolvable..."
74                 done
75                 git clone git://devvexx.opendaylight.org/mirror/releng/builder /builder
76                 /builder/jenkins-scripts/jenkins-init-script.sh
77
78 outputs:
79     ip:
80         description: IP address of the instance
81         value: {get_attr: [instance, networks, odlci, 0]}