[CORD-2466]
Create a multi-node k8s-compatible scenario

Change-Id: I618a66323672d646847e438f1e0c320962e75642
diff --git a/ansible/prep-kubespray.yml b/ansible/prep-kubespray.yml
new file mode 100644
index 0000000..9521b19
--- /dev/null
+++ b/ansible/prep-kubespray.yml
@@ -0,0 +1,35 @@
+---
+# Copyright 2017-present Open Networking Foundation
+#
+# 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.
+
+# ansible/prep-kubespray.yml
+# prepare to run kubespray on the system
+
+- name: Prep systems for kubespray
+  hosts: head, compute
+  tasks:
+    - name: Disable swap
+      become: yes
+      command: "swapoff -a"
+      tags:
+        - skip_ansible_lint # there isn't a module for this, command is idempotent
+
+- name: Download and configure kubespray
+  hosts: localhost
+  connection: local
+  gather_facts: False
+
+  roles:
+    - prep-kubespray
+
diff --git a/ansible/roles/genconfig/templates/config.mk.j2 b/ansible/roles/genconfig/templates/config.mk.j2
index caf108b..11b614f 100644
--- a/ansible/roles/genconfig/templates/config.mk.j2
+++ b/ansible/roles/genconfig/templates/config.mk.j2
@@ -67,6 +67,9 @@
 {% if prep_headnode_prereqs is defined %}
 PREP_HEADNODE_PREREQS   = $(M)/{{ prep_headnode_prereqs | join(" $(M)/") }}
 {% endif %}
+{% if prep_kubespray_prereqs is defined %}
+PREP_KUBESPRAY_PREREQS   = $(M)/{{ prep_kubespray_prereqs | join(" $(M)/") }}
+{% endif %}
 {% if docker_images_prereqs is defined %}
 DOCKER_IMAGES_PREREQS   = $(M)/{{ docker_images_prereqs | join(" $(M)/") }}
 {% endif %}
diff --git a/ansible/roles/prep-kubespray/defaults/main.yml b/ansible/roles/prep-kubespray/defaults/main.yml
new file mode 100644
index 0000000..6c8266d
--- /dev/null
+++ b/ansible/roles/prep-kubespray/defaults/main.yml
@@ -0,0 +1,20 @@
+---
+# Copyright 2017-present Open Networking Foundation
+#
+# 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.
+
+# prep-kubespray/defaults/main.yml
+
+kubespray_version: "master"
+kubespray_dir: "../kubespray"
+
diff --git a/ansible/roles/prep-kubespray/tasks/main.yml b/ansible/roles/prep-kubespray/tasks/main.yml
new file mode 100644
index 0000000..43a5128
--- /dev/null
+++ b/ansible/roles/prep-kubespray/tasks/main.yml
@@ -0,0 +1,30 @@
+---
+# Copyright 2017-present Open Networking Foundation
+#
+# 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.
+
+# prep-kubespray/tasks/main.yml
+
+- name: Checkout kubespray repo
+  git:
+    repo: "https://github.com/kubernetes-incubator/kubespray"
+    dest: "{{ kubespray_dir }}"
+    version: "{{ kubespray_version }}"
+
+- name: Create kubespray inventory
+  template:
+    src: kubespray_inventory.j2
+    dest: "{{ kubespray_dir }}/inventory/inventory.cord"
+    mode: 0644
+
+
diff --git a/ansible/roles/prep-kubespray/templates/kubespray_inventory.j2 b/ansible/roles/prep-kubespray/templates/kubespray_inventory.j2
new file mode 100644
index 0000000..bb70db4
--- /dev/null
+++ b/ansible/roles/prep-kubespray/templates/kubespray_inventory.j2
@@ -0,0 +1,30 @@
+# created by prep-kubespray/templates/kubespray_inventory.j2
+
+[kube-master]
+{% for node in groups['head'] %}
+{{ node }}
+{% endfor %}
+{% for node in groups['compute'] %}
+{{ node }}
+{% endfor %}
+
+[etcd]
+{% for node in groups['head'] %}
+{{ node }}
+{% endfor %}
+{% for node in groups['compute'] %}
+{{ node }}
+{% endfor %}
+
+[kube-node]
+{% for node in groups['head'] %}
+{{ node }}
+{% endfor %}
+{% for node in groups['compute'] %}
+{{ node }}
+{% endfor %}
+
+[k8s-cluster:children]
+kube-node
+kube-master
+