summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/openshift-install-cifs.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/playbooks/openshift-install-cifs.yml b/playbooks/openshift-install-cifs.yml
new file mode 100644
index 0000000..92ed09c
--- /dev/null
+++ b/playbooks/openshift-install-cifs.yml
@@ -0,0 +1,40 @@
+---
+
+- hosts: nodes
+ serial: 1
+ vars:
+ vendor_name: openshift.io
+ driver_name: cifs
+ driver_location: "{{ playbook_dir }}/../anslib/openshift-flexvolume-cifs/flexvolume-driver/cifs"
+ volume_plugin_path: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec"
+ openshift_node_service: origin-node
+ install_packages:
+ - cifs-utils
+ tasks:
+ - name: Install required packages
+ package:
+ name: "{{ install_packages }}"
+ state: present
+ - name: Validate driver exists
+ stat:
+ path: "{{ driver_location }}"
+ register: driver_exists
+ delegate_to: localhost
+ - name: Fail if driver not found
+ fail:
+ msg: Driver file not found!
+ when: not driver_exists.stat.exists
+ - name: Create cifs driver directory
+ file:
+ state: directory
+ path: "{{ volume_plugin_path }}/{{ vendor_name }}~{{ driver_name }}"
+ - name: Copy cifs driver
+ copy:
+ src: "{{ driver_location }}"
+ dest: "{{ volume_plugin_path }}/{{ vendor_name }}~{{ driver_name }}/{{ driver_name }}"
+ mode: 0755
+ register: driver_copy
+ - name: Restart OpenShift Node Service
+ service:
+ name: "{{ openshift_node_service }}"
+ state: restarted \ No newline at end of file