Merge "Add lftools version configuration"
[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: 1 GB General Purpose v1
30         description: OpenStack Flavor to use
31     vm_image:
32         type: string
33         description: VM Image to spin up
34
35 resources:
36     instance:
37         type: "OS::Nova::Server"
38         properties:
39             flavor: {get_param: vm_flavor}
40             image: {get_param: vm_image}
41             name:
42                 str_replace:
43                     template: SILO-JOB_NAME-GROUP-VM_TYPE-INDEX
44                     params:
45                         "SILO": {get_param: silo}
46                         "JOB_NAME": {get_param: job_name}
47                         "VM_TYPE":
48                             str_split:
49                                 - ' - '
50                                 - {get_param: vm_image}
51                                 - 1
52                         "GROUP": {get_param: group}
53                         "INDEX": {get_param: index}
54             networks:
55                 - network: RC-ODL
56             key_name: {get_param: ssh_key}
57             user_data: |
58                 #!/bin/bash
59                 until ping -c1 git.opendaylight.org &>/dev/null
60                 do
61                     echo "Waiting until git.opendaylight.org is resolvable..."
62                 done
63                 git clone https://git.opendaylight.org/gerrit/releng/builder /builder
64                 /builder/jenkins-scripts/jenkins-init-script.sh
65
66 outputs:
67     ip:
68         description: IP address of the instance
69         value: {get_attr: [instance, networks, RC-ODL, 0]}