summaryrefslogtreecommitdiffstats
path: root/roles/kube_nfs_volumes/tasks/main.yml
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-05-22 11:04:14 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-05-22 11:04:14 -0400
commit5f784b42fb779d8feca2f4c4906966d159278811 (patch)
treebd22b603c9000656f9e885004c666e065e80cb49 /roles/kube_nfs_volumes/tasks/main.yml
parent09717b94a0b76d03db38baee793b141e1a651cdd (diff)
parent98acbb6d24921ded065fca3b57943ef1ae7fb15f (diff)
downloadopenshift-5f784b42fb779d8feca2f4c4906966d159278811.tar.gz
openshift-5f784b42fb779d8feca2f4c4906966d159278811.tar.bz2
openshift-5f784b42fb779d8feca2f4c4906966d159278811.tar.xz
openshift-5f784b42fb779d8feca2f4c4906966d159278811.zip
Merge pull request #233 from jsafrane/devel/nfs-volumes
Add nfs-volumes role.
Diffstat (limited to 'roles/kube_nfs_volumes/tasks/main.yml')
-rw-r--r--roles/kube_nfs_volumes/tasks/main.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/kube_nfs_volumes/tasks/main.yml b/roles/kube_nfs_volumes/tasks/main.yml
new file mode 100644
index 000000000..23b228d32
--- /dev/null
+++ b/roles/kube_nfs_volumes/tasks/main.yml
@@ -0,0 +1,25 @@
+---
+- name: Install pyparted (RedHat/Fedora)
+ yum: name=pyparted,python-httplib2 state=installed
+
+- name: partition the drives
+ partitionpool: disks={{ disks }} force={{ force }} sizes={{ sizes }}
+
+- name: create filesystem
+ filesystem: fstype=ext4 dev=/dev/{{ item.name }}
+ with_items: partition_pool
+
+- name: mount
+ mount: name={{mount_dir}}/{{ item.name }} src=/dev/{{ item.name }} state=mounted fstype=ext4 passno=2
+ with_items: partition_pool
+
+- include: nfs.yml
+
+- name: export physical volumes
+ uri: url={{ kubernetes_url }}/api/v1beta3/persistentvolumes
+ method=POST
+ body='{{ lookup("template", "../templates/nfs.json.j2") }}'
+ body_format=json
+ status_code=201
+ HEADER_Authorization="Bearer {{ kubernetes_token }}"
+ with_items: partition_pool