[CORD-2094]
Remove dependency of copy_cord target on Vagrant init

Change-Id: Ib780c83d24d098734f4cee9125fc7f1c71f27ce5
diff --git a/Makefile b/Makefile
index ff1c297..91f92cd 100644
--- a/Makefile
+++ b/Makefile
@@ -64,14 +64,15 @@
 
 # Ansible args, for verbosity and other runtime parameters
 ANSIBLE_ARGS     ?=
+EXTRA_VARS       ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml"
 
 # Commands
 SHELL            = bash -o pipefail
 VAGRANT          ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
 ANSIBLE          ?= ansible -i $(INVENTORY)
 ANSIBLE_PB       ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG)
-ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost --extra-vars "@/opt/cord_profile/genconfig/config.yml"
-ANSIBLE_PB_MAAS  ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory --extra-vars "@/opt/cord_profile/genconfig/config.yml"
+ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS)
+ANSIBLE_PB_MAAS  ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory $(EXTRA_VARS)
 IMAGEBUILDER     ?= python $(BUILD)/scripts/imagebuilder.py
 LOGCMD           ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F)
 SSH_HEAD         ?= ssh $(HEADNODE)
@@ -97,10 +98,11 @@
 	@echo "Scenario: '$(SCENARIO)'"
 	@echo "Profile: '$(PROFILE)'"
 
-# Primary Targets
+# == BUILD TARGET == #
+# This is entirely determined by the podconfig/scenario, and should generally
+# be set to only one value - everything else should be a dependency
 build: $(BUILD_TARGETS)
 
-
 # Utility targets
 ansible-ping:
 	$(ANSIBLE) -m ping all $(LOGCMD)
@@ -172,10 +174,11 @@
 START_XOS_PREREQS        ?=
 BUILD_ONOS_APPS_PREREQS  ?=
 DEPLOY_ONOS_PREREQS      ?=
-DEPLOY_OPENSTACK_PREREQS ?=
 DEPLOY_MAVENREPO_PREREQS ?=
+DEPLOY_OPENSTACK_PREREQS ?=
 SETUP_AUTOMATION_PREREQS ?=
 
+
 # == MILESTONES == #
 # empty target files are touched in the milestones dir to indicate completion
 
@@ -205,26 +208,26 @@
 	$(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
 	touch $@
 
-$(M)/copy-cord: | $(M)/vagrant-ssh-install $(COPY_CORD_PREREQS)
+$(M)/copy-cord: | $(COPY_CORD_PREREQS)
 	$(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
 	touch $@
 
-$(M)/cord-config: | $(M)/vagrant-ssh-install $(CORD_CONFIG_PREREQS)
+$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
 	$(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
 	cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
 	touch $@
 
-$(M)/copy-config: | $(COPY_CONFIG_PREREQS)
+$(M)/copy-config: | $(M)/cord-config
 	$(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
 	touch $@
 
-$(M)/prep-buildnode: | $(M)/vagrant-ssh-install $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
+$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
 	$(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
 	@echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
 	sleep 20
 	touch $@
 
-$(M)/prep-headnode: | $(M)/vagrant-ssh-install $(M)/cord-config $(PREP_HEADNODE_PREREQS)
+$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
 	$(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
 	touch $@
 
diff --git a/scenarios/cord/config.yml b/scenarios/cord/config.yml
index a7632e4..c67e385 100644
--- a/scenarios/cord/config.yml
+++ b/scenarios/cord/config.yml
@@ -1,5 +1,4 @@
 ---
-
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -47,11 +46,12 @@
 build_targets:
  - setup-automation
 
-cord_config_prereqs:
-  - copy-cord
+copy_cord_prereqs:
+  - vagrant-ssh-install
 
-copy_config_prereqs:
-  - cord-config
+cord_config_prereqs:
+  - vagrant-ssh-install
+  - copy-cord
 
 prep_headnode_prereqs:
   - copy-cord
diff --git a/scenarios/local/config.yml b/scenarios/local/config.yml
index 052acb1..dfe7349 100644
--- a/scenarios/local/config.yml
+++ b/scenarios/local/config.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # local Scenario
 # Brings up a minimal set of containers on the host currently being run on
 
diff --git a/scenarios/mock/config.yml b/scenarios/mock/config.yml
index 1b85a9d..03c6ef9 100644
--- a/scenarios/mock/config.yml
+++ b/scenarios/mock/config.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # mock ("mockup") scenario
 # Brings up just core containers without synchronizers, for API tests and GUI dev
 
@@ -45,6 +43,9 @@
 build_targets:
   - onboard-profile
 
+cord_config_prereqs:
+  - vagrant-ssh-install
+
 prep_headnode_prereqs:
   - prep-buildnode
 
diff --git a/scenarios/opencloud/config.yml b/scenarios/opencloud/config.yml
index c3812a9..13909fa 100644
--- a/scenarios/opencloud/config.yml
+++ b/scenarios/opencloud/config.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # opencloud Scenario
 # For a virtual install, physical does not use VMs
 
@@ -32,19 +30,17 @@
 
 # Make build config
 build_targets:
- - onos-debug
- - onboard-openstack
+  - onos-debug
+  - onboard-openstack
 
 vagrant_up_prereqs:
   - prereqs-check
 
 # Copy cord and config to physical/virtual nodes
 cord_config_prereqs:
+  - vagrant-ssh-install
   - copy-cord
 
-copy_config_prereqs:
-  - cord-config
-
 prep_buildnode_prereqs:
   - copy-cord
   - copy-config
diff --git a/scenarios/single/config.yml b/scenarios/single/config.yml
index 88395be..488a772 100644
--- a/scenarios/single/config.yml
+++ b/scenarios/single/config.yml
@@ -45,6 +45,9 @@
 build_targets:
   - onboard-profile
 
+cord_config_prereqs:
+  - vagrant-ssh-install
+
 prep_headnode_prereqs:
   - prep-buildnode