diff --git a/build.gradle b/build.gradle
index c54afc0..55f7664 100644
--- a/build.gradle
+++ b/build.gradle
@@ -179,7 +179,7 @@
 
 // ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
 
-task updateDocker (type: Exec) {
+task updateDocker (type: Exec)  {
     commandLine 'sudo', 'utils/enable-remote-docker-registry', "$targetReg"
 }
 
@@ -195,7 +195,6 @@
 // To be used to generate all needed binaries that need to be present on the target
 // as docker images in the local docker runner.
 task buildImages {
-    dependsOn fetch
     dependsOn buildBootstrapImage
     dependsOn buildHarvesterImage
     dependsOn buildAutomationImage
@@ -216,6 +215,7 @@
 }
 
 task publish {
+    //FIXME: This works because the upstream project primes the nodes before running this.
     comps.each { name, spec -> if (spec.type == 'image') { dependsOn "publish" + name } }
     dependsOn publishBootstrapImage
     dependsOn publishHarvesterImage
@@ -226,9 +226,6 @@
     dependsOn publishSwitchqImage
 }
 
-tasks.addRule(new DockerFetchRule(project))
-tasks.addRule(new DockerPublishRule(project))
-tasks.addRule(new DockerTagRule(project))
 
 // ~~~~~~~~~~~~~~~~~~~ Deployment / Test Tasks  ~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -261,8 +258,7 @@
   }
 }
 
-task prime (type: Exec) {
-    dependsOn updateDocker
+task prime (type: Exec)  {
     println "Using deployment config: $deployConfig"
     File configFile = new File(deployConfig)
     def yaml = new Yaml()
@@ -320,7 +316,7 @@
     args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "prime-node.yml"
 }
 
-task deployBase (type: Exec) {
+task deployBase(type: Exec)  {
     println "Using deployment config: $deployConfig"
     File configFile = new File(deployConfig)
     def yaml = new Yaml()
@@ -378,3 +374,13 @@
 
     args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "head-node.yml"
 }
+
+prime.dependsOn {
+    updateDocker
+}
+
+tasks.addRule(new DockerFetchRule(project))
+tasks.addRule(new DockerPublishRule(project, project(':maas').prime))
+tasks.addRule(new DockerTagRule(project))
+
+
diff --git a/build.gradle.new b/build.gradle.new
deleted file mode 100644
index 55f7664..0000000
--- a/build.gradle.new
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright 2012 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import org.opencord.gradle.rules.*
-import org.yaml.snakeyaml.Yaml
-
-allprojects {
-    apply plugin: 'base'
-    apply plugin: 'de.gesellix.docker'
-    //apply plugin: 'com.tmiyamon.config'
-
-    docker {
-        // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock'
-        // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
-        // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default"
-        // authConfigPlain = [
-        //   "username"       : "joe",
-        //   "password"       : "some-pw-as-needed",
-        //   "email"          : "joe@acme.com",
-        //   "serveraddress"  : "https://index.docker.io/v1/"
-        //  ]
-    }
-}
-
-ext {
-
-    // Upstream registry to simplify filling out the comps table below
-    upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io'
-
-    // Target registry to be used to publish docker images needed for deployment
-    targetReg = project.hasProperty('targetReg') ? project.getProperty('targetReg') : 'localhost:5000'
-
-    // The tag used to tag the docker images push to the target registry
-    targetTag = project.hasProperty('targetTag') ? project.getProperty('targetTag') : 'candidate'
-
-    // Deployment target config file (yaml format); this can be overwritten from the command line
-    // using the -PdeployConfig=<file-path> syntax.
-    deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'
-
-    dockerPath = project.hasProperty('dockerPath') ? project.getProperty('dockerPath') : '/usr/bin'
-
-    comps = [
-            'consul': [
-                    'type':     'image',
-                    'upstream': upstreamReg,
-                    'name':     'consul',
-                    'digest':   'sha256:0dc990ff3c44d5b5395475bcc5ebdae4fc8b67f69e17942a8b9793b3df74d290'
-            ]
-    ]
-}
-
-task fetchUpstreamImages {
-    comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
-}
-
-// Switch Configuration Image
-
-task buildSwitchqImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', 'cord-maas-switchq', './switchq'
-}
-
-task tagSwitchqImage(type: Exec) {
-   dependsOn buildSwitchqImage
-   commandLine "$dockerPath/docker", 'tag', 'cord-maas-switchq', "$targetReg/cord-maas-switchq:$targetTag"
-}
-
-task publishSwitchqImage(type: Exec) {
-    dependsOn tagSwitchqImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/cord-maas-switchq:$targetTag"
-}
-
-// Bootstrap Image
-
-task buildBootstrapImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', 'cord-maas-bootstrap', './bootstrap'
-}
-
-task tagBootstrapImage(type: Exec) {
-   dependsOn buildBootstrapImage
-   commandLine "$dockerPath/docker", 'tag', 'cord-maas-bootstrap', "$targetReg/cord-maas-bootstrap:$targetTag"
-}
-
-task publishBootstrapImage(type: Exec) {
-    dependsOn tagBootstrapImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/cord-maas-bootstrap:$targetTag"
-}
-
-// IP Allocator Image
-
-task buildAllocationImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', 'cord-ip-allocator', './ip-allocator'
-}
-
-task tagAllocationImage(type: Exec) {
-   dependsOn buildAllocationImage
-   commandLine "$dockerPath/docker", 'tag', 'cord-ip-allocator', "$targetReg/cord-ip-allocator:$targetTag"
-}
-
-task publishAllocationImage(type: Exec) {
-    dependsOn tagAllocationImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/cord-ip-allocator:$targetTag"
-}
-
-// Provisioner Image
-
-task buildProvisionerImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', 'cord-provisioner', './provisioner'
-}
-
-task tagProvisionerImage(type: Exec) {
-   dependsOn buildProvisionerImage
-   commandLine "$dockerPath/docker", 'tag', 'cord-provisioner', "$targetReg/cord-provisioner:$targetTag"
-}
-
-task publishProvisionerImage(type: Exec) {
-    dependsOn tagProvisionerImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/cord-provisioner:$targetTag"
-}
-
-// Config Generator Image
-
-task buildConfigGeneratorImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', 'config-generator', './config-generator'
-}
-
-task tagConfigGeneratorImage(type: Exec) {
-   dependsOn buildConfigGeneratorImage
-   commandLine "$dockerPath/docker", 'tag', 'config-generator', "$targetReg/config-generator:$targetTag"
-}
-
-task publishConfigGeneratorImage(type: Exec) {
-    dependsOn tagConfigGeneratorImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/config-generator:$targetTag"
-}
-
-// Automation Image
-
-task buildAutomationImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', "cord-maas-automation", "-f", "./automation/Dockerfile", "./automation"
-}
-
-task tagAutomationImage(type: Exec) {
-    dependsOn buildAutomationImage
-    commandLine "$dockerPath/docker", 'tag', 'cord-maas-automation', "$targetReg/cord-maas-automation:$targetTag"
-}
-
-task publishAutomationImage(type: Exec) {
-    dependsOn tagAutomationImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/cord-maas-automation:$targetTag"
-}
-
-// DHCP Harvester Images
-
-task buildHarvesterImage(type: Exec) {
-    commandLine "$dockerPath/docker", 'build', '-t', "cord-dhcp-harvester", "./harvester"
-}
-
-task tagHarvesterImage(type: Exec) {
-    dependsOn buildHarvesterImage
-    commandLine "$dockerPath/docker", 'tag', 'cord-dhcp-harvester', "$targetReg/cord-dhcp-harvester:$targetTag"
-}
-
-task publishHarvesterImage(type: Exec) {
-    dependsOn tagHarvesterImage
-    commandLine "$dockerPath/docker", 'push', "$targetReg/cord-dhcp-harvester:$targetTag"
-}
-
-// ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
-
-task updateDocker (type: Exec)  {
-    commandLine 'sudo', 'utils/enable-remote-docker-registry', "$targetReg"
-}
-
-// To be used to fetch upstream binaries, clone repos, etc.
-task fetch(type: Exec) {
-    // this is where we fetch upstream artifacts that we do not need internet for the build phase"
-    // Placeholdr example:
-    dependsOn fetchUpstreamImages
-    commandLine "$dockerPath/docker", "pull", "golang:alpine"
-    commandLine "$dockerPath/docker", "pull", "python:2.7-alpine"
-}
-
-// To be used to generate all needed binaries that need to be present on the target
-// as docker images in the local docker runner.
-task buildImages {
-    dependsOn buildBootstrapImage
-    dependsOn buildHarvesterImage
-    dependsOn buildAutomationImage
-    dependsOn buildAllocationImage
-    dependsOn buildProvisionerImage
-    dependsOn buildConfigGeneratorImage
-    dependsOn buildSwitchqImage
-}
-
-task tagImages {
-    dependsOn tagBootstrapImage
-    dependsOn tagHarvesterImage
-    dependsOn tagAutomationImage
-    dependsOn tagAllocationImage
-    dependsOn tagProvisionerImage
-    dependsOn tagConfigGeneratorImage
-    dependsOn tagSwitchqImage
-}
-
-task publish {
-    //FIXME: This works because the upstream project primes the nodes before running this.
-    comps.each { name, spec -> if (spec.type == 'image') { dependsOn "publish" + name } }
-    dependsOn publishBootstrapImage
-    dependsOn publishHarvesterImage
-    dependsOn publishAutomationImage
-    dependsOn publishAllocationImage
-    dependsOn publishProvisionerImage
-    dependsOn publishConfigGeneratorImage
-    dependsOn publishSwitchqImage
-}
-
-
-// ~~~~~~~~~~~~~~~~~~~ Deployment / Test Tasks  ~~~~~~~~~~~~~~~~~~~~~~~
-
-List.metaClass.asParam = { prefix, sep ->
-  if (delegate.size() == 0) {
-    ""
-  }
-  String result = "--" + prefix + "="
-  String p = ""
-  delegate.each {
-    result += p + "${it}"
-    p = sep
-  }
-  result
-}
-
-List.metaClass.p = { value, name ->
-  if (value != null && value != "") {
-      delegate << name + "=" + value
-  } else {
-      delegate
-  }
-}
-
-List.metaClass.p = { spec ->
-  if (spec != null && spec != "") {
-      delegate += spec
-  } else {
-      delegate
-  }
-}
-
-task prime (type: Exec)  {
-    println "Using deployment config: $deployConfig"
-    File configFile = new File(deployConfig)
-    def yaml = new Yaml()
-    def config = yaml.load(configFile.newReader())
-
-    executable = "ansible-playbook"
-    args = ["-i", config.seedServer.ip + ',']
-
-    if ( config.seedServer.user != null && config.seedServer.user != "" ) {
-        args = args << "--user=$config.seedServer.user"
-    }
-
-    if ( config.debug ) {
-        args = args << "-vvvv"
-    }
-
-    def extraVars = []
-    if (config.seedServer) {
-        extraVars = extraVars.p(config.seedServer.extraVars)
-            .p(config.seedServer.password, "ansible_ssh_pass")
-            .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
-            .p(config.seedServer.fabric_ip, "fabric_ip")
-            .p(config.seedServer.management_ip, "management_ip")
-            .p(config.seedServer.management_gw, "management_gw")
-            .p(config.seedServer.management_network, "management_network")
-            .p(config.seedServer.management_iface, "management_iface")
-            .p(config.seedServer.external_ip, "external_ip")
-            .p(config.seedServer.external_gw, "external_gw")
-            .p(config.seedServer.external_network, "external_network")
-            .p(config.seedServer.external_iface, "external_iface")
-            .p(config.seedServer.fabric_ip, "fabric_ip")
-            .p(config.seedServer.fabric_network, "fabric_network")
-            .p(config.seedServer.fabric_iface, "fabric_iface")
-            .p(config.seedServer.fabric_iface_spec, "fabric_iface_spec")
-            .p(config.seedServer.domain, "domain")
-	    .p(config.seedServer.virtualbox_support, "virtualbox_support")
-            .p(config.seedServer.power_helper_user, "power_helper_user")
-            .p(config.seedServer.power_helper_host, "power_helper_host")
-            .p(config.seedServer.port, "ansible_ssh_port")
-    }
-
-    if (config.otherServers) {
-        extraVars = extraVars.p(config.otherServers.location, "prov_location")
-        .p(config.otherServers.rolesPath, "prov_role_path")
-        .p(config.otherServers.role, "prov_role")
-    }
-
-    if (config.docker) {
-        extraVars = extraVars.p(config.docker.registry, "docker_registry")
-            .p(config.docker.imageVersion, "docker_image_version")
-    }
-
-    def skipTags = [].p(config.seedServer.skipTags)
-
-    args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "prime-node.yml"
-}
-
-task deployBase(type: Exec)  {
-    println "Using deployment config: $deployConfig"
-    File configFile = new File(deployConfig)
-    def yaml = new Yaml()
-    def config = yaml.load(configFile.newReader())
-
-    executable = "ansible-playbook"
-    args = ["-i", config.seedServer.ip + ',']
-
-    if ( config.seedServer.user != null && config.seedServer.user != "" ) {
-        args = args << "--user=$config.seedServer.user"
-    }
-
-
-    if ( config.debug ) {
-        args = args << "-vvvv"
-    }
-
-    def extraVars = []
-    if (config.seedServer) {
-        extraVars = extraVars.p(config.seedServer.extraVars)
-            .p(config.seedServer.password, "ansible_ssh_pass")
-            .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
-            .p(config.seedServer.fabric_ip, "fabric_ip")
-	    .p(config.seedServer.management_ip, "management_ip")
-            .p(config.seedServer.management_gw, "management_gw")
-            .p(config.seedServer.management_network, "management_network")
-	    .p(config.seedServer.management_iface, "management_iface")
-	    .p(config.seedServer.external_ip, "external_ip")
-            .p(config.seedServer.external_gw, "external_gw")
-            .p(config.seedServer.external_network, "external_network")
-            .p(config.seedServer.external_iface, "external_iface")
-	    .p(config.seedServer.fabric_ip, "fabric_ip")
-	    .p(config.seedServer.fabric_network, "fabric_network")
-	    .p(config.seedServer.fabric_iface, "fabric_iface")
-            .p(config.seedServer.fabric_iface_spec, "fabric_iface_spec")
-            .p(config.seedServer.domain, "domain")
-            .p(config.seedServer.virtualbox_support, "virtualbox_support")
-	    .p(config.seedServer.power_helper_user, "power_helper_user")
-	    .p(config.seedServer.power_helper_host, "power_helper_host")
-            .p(config.seedServer.port, "ansible_ssh_port")
-    }
-
-    if (config.otherServers) {
-        extraVars = extraVars.p(config.otherServers.location, "prov_location")
-        .p(config.otherServers.rolesPath, "prov_role_path")
-        .p(config.otherServers.role, "prov_role")
-    }
-
-    if (config.docker) {
-        extraVars = extraVars.p(config.docker.registry, "docker_registry")
-            .p(config.docker.imageVersion, "docker_image_version")
-    }
-
-    def skipTags = [].p(config.seedServer.skipTags)
-
-    args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "head-node.yml"
-}
-
-prime.dependsOn {
-    updateDocker
-}
-
-tasks.addRule(new DockerFetchRule(project))
-tasks.addRule(new DockerPublishRule(project, project(':maas').prime))
-tasks.addRule(new DockerTagRule(project))
-
-
