Merge "Update cloud image Ubuntu18.04 mininet ovs"
[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: v3-standard-2
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   instance:
43     type: "OS::Nova::Server"
44     properties:
45       image: { get_param: vm_image }
46       flavor: { get_param: vm_flavor }
47       name:
48         str_replace:
49           template: SILO-JOB_NAME-GROUP-VM_TYPE-INDEX
50           params:
51             "SILO": { get_param: silo }
52             "JOB_NAME": { get_param: job_name }
53             "VM_TYPE":
54               str_split:
55                 - " - "
56                 - { get_param: vm_image }
57                 - 2
58             "GROUP": { get_param: group }
59             "INDEX": { get_param: index }
60       networks:
61         - port: { get_resource: port }
62       key_name: { get_param: ssh_key }
63       user_data: |
64         #!/bin/bash
65         until host devvexx.opendaylight.org &>/dev/null
66         do
67             echo "Waiting until devvexx.opendaylight.org is resolvable..."
68         done
69         git clone --recurse-submodules git://devvexx.opendaylight.org/mirror/releng/builder /opt/ciman
70         /opt/ciman/jjb/global-jjb/jenkins-init-scripts/init.sh
71
72 outputs:
73   ip:
74     description: IP address of the instance
75     value: { get_attr: [instance, networks, odlci, 0] }