CORD-813
Use the genconfig/config.yml file for one-off runs of ansible
use port for ssh connections

Change-Id: If53b4e9cfa21d6da79b02069c7aa8077a8666aac
diff --git a/build.gradle b/build.gradle
index aa0c3a6..2a59b50 100644
--- a/build.gradle
+++ b/build.gradle
@@ -210,14 +210,14 @@
   dependsOn writeProdInventory
 
   executable = "ansible"
-  args = [ "-i", "genconfig/prod-inv", "-b", "-m", "synchronize", "-a", "src='../../' dest='/opt/cord'", "head" ]
+  args = [ "-i", "genconfig/prod-inv", "-b", "--extra-vars", "@./genconfig/config.yml", "-m", "synchronize", "-a", "src='../../' dest='/opt/cord'", "head" ]
 }
 
 task ChownCord(type: Exec) {
   dependsOn CopyCord
 
   executable = "ansible"
-  args = [ "-i", "genconfig/prod-inv", "-b", "-m", "file", "-a", "state='directory' dest='/opt/cord' recurse='yes' owner='$config.seedServer.ansible_user'", "head" ]
+  args = [ "-i", "genconfig/prod-inv", "-b", "--extra-vars", "@./genconfig/config.yml", "-m", "file", "-a", "state='directory' dest='/opt/cord' recurse='yes' owner='$config.seedServer.ansible_user'", "head" ]
 }
 
 task PIprepPlatform(type: Exec) {
@@ -227,35 +227,35 @@
   def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-prep-platform.yml"
 
   executable = "ssh"
-  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
+  args = ["-p", "$config.seedServer.ansible_ssh_port", "$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
 }
 
 task PIdeployOpenStack (type: Exec) {
   def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-deploy-openstack.yml"
 
   executable = "ssh"
-  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
+  args = ["-p", "$config.seedServer.ansible_ssh_port", "$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
 }
 
 task PIdeployONOS (type: Exec) {
   def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-deploy-onos.yml"
 
   executable = "ssh"
-  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
+  args = ["-p", "$config.seedServer.ansible_ssh_port", "$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
 }
 
 task PIdeployXOS (type: Exec) {
   def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-deploy-xos.yml"
 
   executable = "ssh"
-  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
+  args = ["-p", "$config.seedServer.ansible_ssh_port", "$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
 }
 
 task PIsetupAutomation (type: Exec) {
   def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-automation.yml"
 
   executable = "ssh"
-  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
+  args = ["-p", "$config.seedServer.ansible_ssh_port", "$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
 }
 
 task postDeployTests (type: Exec) {
@@ -263,7 +263,7 @@
   def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-post-deploy-playbook.yml"
 
   executable = "ssh"
-  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
+  args = ["-p", "$config.seedServer.ansible_ssh_port", "$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
 }
 
 project('onos-apps').publishMavenRepoImage.dependsOn project(':maas').prime
diff --git a/config/cord_in_a_box.yml b/config/cord_in_a_box.yml
index a2121ed..3743d3b 100644
--- a/config/cord_in_a_box.yml
+++ b/config/cord_in_a_box.yml
@@ -12,6 +12,7 @@
   # provisioning
   ansible_user: 'vagrant'
   ansible_ssh_pass: 'vagrant'
+  ansible_ssh_port: 22
 
   # Specifies tasks within the head node provisioning not to execute, including:
   #
diff --git a/config/default.yml b/config/default.yml
index 33ceee9..e47182a 100644
--- a/config/default.yml
+++ b/config/default.yml
@@ -10,8 +10,9 @@
 
   # User name and password used by Ansible to connect to the host for remote
   # provisioning
-  user: 'vagrant'
-  password: 'vagrant'
+  ansible_user: 'vagrant'
+  ansible_ssh_pass: 'vagrant'
+  ansible_ssh_port: 22
 
   # Specifies tasks within the head node provisioning not to execute, including:
   #
diff --git a/config/onlab_develop_pod.yml b/config/onlab_develop_pod.yml
index bbe2b5e..ea05cc1 100644
--- a/config/onlab_develop_pod.yml
+++ b/config/onlab_develop_pod.yml
@@ -5,8 +5,10 @@
   # User name and password used by Ansible to connect to the host for remote
   # provisioning. These default values are used for automated testing, change
   # with care.
-  user: 'cord'
-  password: 'cord'
+  ansible_user: 'cord'
+  ansible_ssh_pass: 'cord'
+  ansible_ssh_port: 22
+
   # Network address information for the head node:
   #
   # fabric_ip     - the IP address and mask bits to be used to configure the network
diff --git a/config/sample.yml b/config/sample.yml
index 5736385..d3a261a 100644
--- a/config/sample.yml
+++ b/config/sample.yml
@@ -4,14 +4,11 @@
   # IP address of the head node
   ip: '10.90.0.2'
 
-  # If the head node is being accessed via a tunnel or reponds to SSH on a non-
-  # standard port, the port value should be set.
-  # port: '2022'
-
-  # User name and password used by Ansible to connect to the host for remote
+  # User name, password, and ssh port used by Ansible to connect to the host for remote
   # provisioning
-  user: 'ubuntu'
-  password: 'ubuntu'
+  ansible_user: 'ubuntu'
+  ansible_ssh_pass: 'ubuntu'
+  ansible_ssh_port: 22
 
   # Network address information for the head node:
   #