diff --git a/build.gradle b/build.gradle
index d27c237..2b1f1db 100644
--- a/build.gradle
+++ b/build.gradle
@@ -170,40 +170,42 @@
 }
 
 task deploy (dependsOn: publishMavenRepoImage, type: Exec) {
-    println "Using deployment config: $deployConfig"
-    File configFile = new File(deployConfig)
-    def yaml = new Yaml()
-    def config = yaml.load(configFile.newReader())
+    doLast {
+        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 + ',']
+        executable = "ansible-playbook"
+        args = ["-i", config.seedServer.ip + ',']
 
-    if ( config.seedServer.user != null && config.seedServer.user != "" ) {
-        args = args << "--user=$config.seedServer.user"
+        if ( config.seedServer.user != null && config.seedServer.user != "" ) {
+            args = args << "--user=$config.seedServer.user"
+        }
+
+        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.domain, "domain")
+        }
+
+        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", " ")) << "mavenrepo.yml"   
     }
-
-    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.domain, "domain")
-    }
-
-    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", " ")) << "mavenrepo.yml"   
 }
 
 
