blob: 6533aa2bbd6dca52a6cd3c07a32181d17cff4e55 [file] [log] [blame]
Zsolt Haraszti2a792f62016-05-12 17:49:02 -07001/*
2 * Copyright 2012 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
David K. Bainbridge59bdb542016-07-01 11:07:45 -070016import org.opencord.gradle.rules.*
David K. Bainbridge10b0c112016-05-24 13:17:23 -070017import org.yaml.snakeyaml.Yaml
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070018
David K. Bainbridge59bdb542016-07-01 11:07:45 -070019allprojects {
20 apply plugin: 'base'
21 apply plugin: 'de.gesellix.docker'
22 //apply plugin: 'com.tmiyamon.config'
23
24 docker {
25 // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock'
26 // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
27 // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default"
28 // authConfigPlain = [
29 // "username" : "joe",
30 // "password" : "some-pw-as-needed",
31 // "email" : "joe@acme.com",
32 // "serveraddress" : "https://index.docker.io/v1/"
33 // ]
34 }
35}
36
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070037ext {
38
David K. Bainbridge59bdb542016-07-01 11:07:45 -070039 // Upstream registry to simplify filling out the comps table below
40 upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io'
41
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070042 // Target registry to be used to publish docker images needed for deployment
43 targetReg = project.hasProperty('targetReg') ? project.getProperty('targetReg') : 'localhost:5000'
44
45 // The tag used to tag the docker images push to the target registry
46 targetTag = project.hasProperty('targetTag') ? project.getProperty('targetTag') : 'candidate'
47
David K. Bainbridge10b0c112016-05-24 13:17:23 -070048 // Deployment target config file (yaml format); this can be overwritten from the command line
49 // using the -PdeployConfig=<file-path> syntax.
50 deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'
David K. Bainbridge19b8d272016-05-26 21:20:43 -070051
David K. Bainbridge59bdb542016-07-01 11:07:45 -070052 comps = [
53 'consul': [
54 'type': 'image',
55 'upstream': upstreamReg,
56 'name': 'consul',
57 'digest': 'sha256:0dc990ff3c44d5b5395475bcc5ebdae4fc8b67f69e17942a8b9793b3df74d290'
58 ]
59 ]
60}
61
62task fetchUpstreamImages {
63 comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070064}
65
David K. Bainbridge97ee8052016-06-14 00:52:07 -070066// Switch Configuration Image
67
David K. Bainbridgede0d9262016-09-13 20:12:06 -070068def getBuildTimestamp() {
69 def cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"))
70 def date = cal.getTime()
71 def formattedDate = date.format("yyyy-MM-dd'T'HH:mm:ss.ss'Z'")
72 return formattedDate
73}
74
75def getCommitHash = { ->
76 def hashStdOut = new ByteArrayOutputStream()
77 exec {
78 commandLine "git", "rev-parse", "HEAD"
79 standardOutput = hashStdOut
80 }
81 return hashStdOut.toString().trim()
82}
83
84def getBranchName = { ->
85 def branchStdOut = new ByteArrayOutputStream()
86 exec {
87 commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
88 standardOutput = branchStdOut
89 }
90 return branchStdOut.toString().trim()
91}
92
David K. Bainbridge97ee8052016-06-14 00:52:07 -070093task buildSwitchqImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -070094 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-maas-switchq', './switchq'
David K. Bainbridge97ee8052016-06-14 00:52:07 -070095}
96
97task tagSwitchqImage(type: Exec) {
98 dependsOn buildSwitchqImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070099 commandLine "docker", 'tag', 'cord-maas-switchq', "$targetReg/cord-maas-switchq:$targetTag"
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700100}
101
102task publishSwitchqImage(type: Exec) {
103 dependsOn tagSwitchqImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700104 commandLine "docker", 'push', "$targetReg/cord-maas-switchq:$targetTag"
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700105}
106
107// Bootstrap Image
108
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700109task buildBootstrapImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700110 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-maas-bootstrap', './bootstrap'
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700111}
112
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700113task tagBootstrapImage(type: Exec) {
114 dependsOn buildBootstrapImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700115 commandLine "docker", 'tag', 'cord-maas-bootstrap', "$targetReg/cord-maas-bootstrap:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700116}
117
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700118task publishBootstrapImage(type: Exec) {
119 dependsOn tagBootstrapImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700120 commandLine "docker", 'push', "$targetReg/cord-maas-bootstrap:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700121}
122
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700123// IP Allocator Image
124
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700125task buildAllocationImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700126 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-ip-allocator', './ip-allocator'
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700127}
128
129task tagAllocationImage(type: Exec) {
David K. Bainbridgef22dc062016-05-31 15:35:39 -0700130 dependsOn buildAllocationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700131 commandLine "docker", 'tag', 'cord-ip-allocator', "$targetReg/cord-ip-allocator:$targetTag"
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700132}
133
134task publishAllocationImage(type: Exec) {
David K. Bainbridgef22dc062016-05-31 15:35:39 -0700135 dependsOn tagAllocationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700136 commandLine "docker", 'push', "$targetReg/cord-ip-allocator:$targetTag"
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700137}
138
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700139// Provisioner Image
140
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700141task buildProvisionerImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700142 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-provisioner', './provisioner'
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700143}
144
145task tagProvisionerImage(type: Exec) {
146 dependsOn buildProvisionerImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700147 commandLine "docker", 'tag', 'cord-provisioner', "$targetReg/cord-provisioner:$targetTag"
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700148}
149
150task publishProvisionerImage(type: Exec) {
151 dependsOn tagProvisionerImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700152 commandLine "docker", 'push', "$targetReg/cord-provisioner:$targetTag"
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700153}
154
gunjan5e9bdd1d2016-07-13 14:59:33 -0700155// Config Generator Image
156
157task buildConfigGeneratorImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700158 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'config-generator', './config-generator'
gunjan5e9bdd1d2016-07-13 14:59:33 -0700159}
160
161task tagConfigGeneratorImage(type: Exec) {
162 dependsOn buildConfigGeneratorImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700163 commandLine "docker", 'tag', 'config-generator', "$targetReg/config-generator:$targetTag"
gunjan5e9bdd1d2016-07-13 14:59:33 -0700164}
165
166task publishConfigGeneratorImage(type: Exec) {
167 dependsOn tagConfigGeneratorImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700168 commandLine "docker", 'push', "$targetReg/config-generator:$targetTag"
gunjan5e9bdd1d2016-07-13 14:59:33 -0700169}
170
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700171// Automation Image
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700172
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700173task buildAutomationImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700174 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', "cord-maas-automation", "-f", "./automation/Dockerfile", "./automation"
David K. Bainbridgeefa951d2016-05-26 10:54:25 -0700175}
176
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700177task tagAutomationImage(type: Exec) {
178 dependsOn buildAutomationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700179 commandLine "docker", 'tag', 'cord-maas-automation', "$targetReg/cord-maas-automation:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700180}
181
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700182task publishAutomationImage(type: Exec) {
183 dependsOn tagAutomationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700184 commandLine "docker", 'push', "$targetReg/cord-maas-automation:$targetTag"
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700185}
186
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700187// DHCP Harvester Images
188
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700189task buildHarvesterImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700190 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', "cord-dhcp-harvester", "./harvester"
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700191}
192
193task tagHarvesterImage(type: Exec) {
194 dependsOn buildHarvesterImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700195 commandLine "docker", 'tag', 'cord-dhcp-harvester', "$targetReg/cord-dhcp-harvester:$targetTag"
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700196}
197
198task publishHarvesterImage(type: Exec) {
199 dependsOn tagHarvesterImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700200 commandLine "docker", 'push', "$targetReg/cord-dhcp-harvester:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700201}
202
203// ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
204
alshabib462f6252016-08-29 16:15:28 -0700205task updateDocker (type: Exec) {
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700206 commandLine 'sudo', 'utils/enable-remote-docker-registry', "$targetReg"
207}
208
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700209// To be used to fetch upstream binaries, clone repos, etc.
210task fetch(type: Exec) {
211 // this is where we fetch upstream artifacts that we do not need internet for the build phase"
212 // Placeholdr example:
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700213 dependsOn fetchUpstreamImages
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700214 commandLine "docker", "pull", "golang:alpine"
215 commandLine "docker", "pull", "python:2.7-alpine"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700216}
217
218// To be used to generate all needed binaries that need to be present on the target
219// as docker images in the local docker runner.
220task buildImages {
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700221 dependsOn buildBootstrapImage
222 dependsOn buildHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700223 dependsOn buildAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700224 dependsOn buildAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700225 dependsOn buildProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700226 dependsOn buildConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700227 dependsOn buildSwitchqImage
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700228}
229
230task tagImages {
231 dependsOn tagBootstrapImage
232 dependsOn tagHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700233 dependsOn tagAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700234 dependsOn tagAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700235 dependsOn tagProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700236 dependsOn tagConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700237 dependsOn tagSwitchqImage
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700238}
239
240task publish {
alshabib462f6252016-08-29 16:15:28 -0700241 //FIXME: This works because the upstream project primes the nodes before running this.
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700242 comps.each { name, spec -> if (spec.type == 'image') { dependsOn "publish" + name } }
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700243 dependsOn publishBootstrapImage
244 dependsOn publishHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700245 dependsOn publishAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700246 dependsOn publishAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700247 dependsOn publishProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700248 dependsOn publishConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700249 dependsOn publishSwitchqImage
David K. Bainbridgeefa951d2016-05-26 10:54:25 -0700250}
251
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700252
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700253// ~~~~~~~~~~~~~~~~~~~ Deployment / Test Tasks ~~~~~~~~~~~~~~~~~~~~~~~
254
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700255List.metaClass.asParam = { prefix, sep ->
256 if (delegate.size() == 0) {
257 ""
258 }
259 String result = "--" + prefix + "="
260 String p = ""
261 delegate.each {
262 result += p + "${it}"
263 p = sep
264 }
265 result
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700266}
267
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700268List.metaClass.p = { value, name ->
269 if (value != null && value != "") {
270 delegate << name + "=" + value
271 } else {
272 delegate
273 }
274}
275
276List.metaClass.p = { spec ->
277 if (spec != null && spec != "") {
278 delegate += spec
279 } else {
280 delegate
281 }
282}
283
alshabib462f6252016-08-29 16:15:28 -0700284task prime (type: Exec) {
David K. Bainbridgef4181702016-06-17 14:44:03 -0700285 println "Using deployment config: $deployConfig"
286 File configFile = new File(deployConfig)
287 def yaml = new Yaml()
288 def config = yaml.load(configFile.newReader())
289
290 executable = "ansible-playbook"
291 args = ["-i", config.seedServer.ip + ',']
292
293 if ( config.seedServer.user != null && config.seedServer.user != "" ) {
294 args = args << "--user=$config.seedServer.user"
295 }
296
David K. Bainbridge5ba01a92016-08-16 14:58:31 -0700297 if ( config.debug ) {
298 args = args << "-vvvv"
299 }
300
David K. Bainbridgef4181702016-06-17 14:44:03 -0700301 def extraVars = []
302 if (config.seedServer) {
303 extraVars = extraVars.p(config.seedServer.extraVars)
304 .p(config.seedServer.password, "ansible_ssh_pass")
305 .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
306 .p(config.seedServer.fabric_ip, "fabric_ip")
307 .p(config.seedServer.management_ip, "management_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700308 .p(config.seedServer.management_gw, "management_gw")
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700309 .p(config.seedServer.management_bc, "management_bc")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700310 .p(config.seedServer.management_network, "management_network")
311 .p(config.seedServer.management_iface, "management_iface")
312 .p(config.seedServer.external_ip, "external_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700313 .p(config.seedServer.external_gw, "external_gw")
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700314 .p(config.seedServer.external_bc, "external_bc")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700315 .p(config.seedServer.external_network, "external_network")
316 .p(config.seedServer.external_iface, "external_iface")
317 .p(config.seedServer.fabric_ip, "fabric_ip")
318 .p(config.seedServer.fabric_network, "fabric_network")
319 .p(config.seedServer.fabric_iface, "fabric_iface")
David K. Bainbridgede51ce52016-08-22 13:54:24 -0700320 .p(config.seedServer.fabric_iface_spec, "fabric_iface_spec")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700321 .p(config.seedServer.domain, "domain")
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -0700322 .p(config.seedServer.virtualbox_support, "virtualbox_support")
323 .p(config.seedServer.power_helper_user, "power_helper_user")
324 .p(config.seedServer.power_helper_host, "power_helper_host")
325 .p(config.seedServer.port, "ansible_ssh_port")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700326 }
327
328 if (config.otherServers) {
329 extraVars = extraVars.p(config.otherServers.location, "prov_location")
330 .p(config.otherServers.rolesPath, "prov_role_path")
331 .p(config.otherServers.role, "prov_role")
332 }
333
334 if (config.docker) {
335 extraVars = extraVars.p(config.docker.registry, "docker_registry")
336 .p(config.docker.imageVersion, "docker_image_version")
337 }
338
339 def skipTags = [].p(config.seedServer.skipTags)
340
341 args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "prime-node.yml"
342}
343
alshabib462f6252016-08-29 16:15:28 -0700344task deployBase(type: Exec) {
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700345 println "Using deployment config: $deployConfig"
346 File configFile = new File(deployConfig)
347 def yaml = new Yaml()
348 def config = yaml.load(configFile.newReader())
349
350 executable = "ansible-playbook"
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700351 args = ["-i", config.seedServer.ip + ',']
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700352
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700353 if ( config.seedServer.user != null && config.seedServer.user != "" ) {
354 args = args << "--user=$config.seedServer.user"
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700355 }
356
David K. Bainbridge5ba01a92016-08-16 14:58:31 -0700357
358 if ( config.debug ) {
359 args = args << "-vvvv"
360 }
361
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700362 def extraVars = []
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700363 if (config.seedServer) {
364 extraVars = extraVars.p(config.seedServer.extraVars)
365 .p(config.seedServer.password, "ansible_ssh_pass")
366 .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
367 .p(config.seedServer.fabric_ip, "fabric_ip")
368 .p(config.seedServer.management_ip, "management_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700369 .p(config.seedServer.management_gw, "management_gw")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700370 .p(config.seedServer.management_network, "management_network")
371 .p(config.seedServer.management_iface, "management_iface")
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700372 .p(config.seedServer.external_ip, "external_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700373 .p(config.seedServer.external_gw, "external_gw")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700374 .p(config.seedServer.external_network, "external_network")
375 .p(config.seedServer.external_iface, "external_iface")
376 .p(config.seedServer.fabric_ip, "fabric_ip")
377 .p(config.seedServer.fabric_network, "fabric_network")
378 .p(config.seedServer.fabric_iface, "fabric_iface")
David K. Bainbridgede51ce52016-08-22 13:54:24 -0700379 .p(config.seedServer.fabric_iface_spec, "fabric_iface_spec")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700380 .p(config.seedServer.domain, "domain")
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -0700381 .p(config.seedServer.virtualbox_support, "virtualbox_support")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700382 .p(config.seedServer.power_helper_user, "power_helper_user")
383 .p(config.seedServer.power_helper_host, "power_helper_host")
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -0700384 .p(config.seedServer.port, "ansible_ssh_port")
David K. Bainbridge6ea57c12016-06-06 23:29:12 -0700385 }
386
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700387 if (config.otherServers) {
388 extraVars = extraVars.p(config.otherServers.location, "prov_location")
389 .p(config.otherServers.rolesPath, "prov_role_path")
390 .p(config.otherServers.role, "prov_role")
391 }
392
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700393 if (config.docker) {
394 extraVars = extraVars.p(config.docker.registry, "docker_registry")
395 .p(config.docker.imageVersion, "docker_image_version")
396 }
397
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700398 def skipTags = [].p(config.seedServer.skipTags)
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700399
400 args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "head-node.yml"
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700401}
alshabib462f6252016-08-29 16:15:28 -0700402
403prime.dependsOn {
404 updateDocker
405}
406
407tasks.addRule(new DockerFetchRule(project))
408tasks.addRule(new DockerPublishRule(project, project(':maas').prime))
409tasks.addRule(new DockerTagRule(project))
410
411