[CORD-3182]

Pin the version of kubespray to master commit
Check for k8s config file and error if not present

Change-Id: I09a54cb8e03b020adb5bdd3e7ab9d7c92200a8ac
diff --git a/kubespray-installer/k8s-configs.yaml b/kubespray-installer/k8s-configs.yaml
index b998a06..d975633 100644
--- a/kubespray-installer/k8s-configs.yaml
+++ b/kubespray-installer/k8s-configs.yaml
@@ -19,22 +19,16 @@
     kubespray_remote_ssh_user: "cord"
 
   tasks:
+
     # Edit all.yml variable file
-
-    - name: Add default Python interpreter
+    - name: Add lines to the all.yaml variable file
       lineinfile:
         path: inventories/{{ deployment_name }}/group_vars/all.yml
-        line: 'ansible_python_interpreter: /usr/bin/python2.7'
-
-    - name: Add default Ansible user
-      lineinfile:
-        path: inventories/{{ deployment_name }}/group_vars/all.yml
-        line: 'ansible_user: {{ kubespray_remote_ssh_user }}'
-
-    - name: Give sudoer permissions
-      lineinfile:
-        path: inventories/{{ deployment_name }}/group_vars/all.yml
-        line: 'ansible_become: true'
+        line: "{{ item }}"
+      with_items:
+         - 'ansible_python_interpreter: /usr/bin/python2.7'
+         - 'ansible_user: {{ kubespray_remote_ssh_user }}'
+         - 'ansible_become: true'
 
     # Edit k8s-cluster.yml variable file
     - name: Set Docker DNS servers strict to false
@@ -61,3 +55,16 @@
         regexp: 'docker_options'
         line: "docker_options: \"{{ item }} --insecure-registry={{ '{{' }} kube_service_addresses {{ '}}' }} --graph={{ '{{' }} docker_daemon_graph {{ '}}' }}  {{ '{{' }} docker_log_opts {{ '}}' }}\""
       with_items: "{{ k8s_nodes.split(' ') | map('regex_replace', '(.*)', '--insecure-registry=\\1/32') | join(' ') }}"
+
+    - name: Enable local volume provisioner
+      lineinfile:
+        path: inventories/{{ deployment_name }}/group_vars/k8s-cluster.yml
+        regexp: '^local_volume_provisioner_enabled.*'
+        line: 'local_volume_provisioner_enabled: true'
+
+    - name: Enable persistent volumes
+      lineinfile:
+        path: inventories/{{ deployment_name }}/group_vars/k8s-cluster.yml
+        regexp: '^persistent_volumes_enabled.*'
+        line: 'persistent_volumes_enabled: true'
+