summaryrefslogtreecommitdiffstats
path: root/roles/gluster/client
diff options
context:
space:
mode:
authorRalph Bean <rbean@redhat.com>2014-02-07 21:36:24 +0000
committerRalph Bean <rbean@redhat.com>2014-02-07 21:36:24 +0000
commit55b08d5a5283ac67b16098a03a0206c1dd80af37 (patch)
tree08be729f40a48817c1076ffe8b61eb028ec65240 /roles/gluster/client
parent00de58c594f1ff446f50e80a17d8af591b1b60c3 (diff)
downloadansible-55b08d5a5283ac67b16098a03a0206c1dd80af37.tar.gz
ansible-55b08d5a5283ac67b16098a03a0206c1dd80af37.tar.xz
ansible-55b08d5a5283ac67b16098a03a0206c1dd80af37.zip
First stab at a gluster role for the nuancier staging nodes.
Diffstat (limited to 'roles/gluster/client')
-rw-r--r--roles/gluster/client/tasks/main.yml23
-rw-r--r--roles/gluster/client/templates/client.config54
2 files changed, 77 insertions, 0 deletions
diff --git a/roles/gluster/client/tasks/main.yml b/roles/gluster/client/tasks/main.yml
new file mode 100644
index 000000000..065161139
--- /dev/null
+++ b/roles/gluster/client/tasks/main.yml
@@ -0,0 +1,23 @@
+---
+
+- name: install needed packages
+ yum: pkg={{ item }} state=installed
+ with_items:
+ - glusterfs-fuse
+ tags:
+ - packages
+
+- name: make the mountdir
+ file: dest={{ mountdir }} owner={{ owner }} group={{ group }}
+
+- name: copy over the client config
+ template: src=client.config dest=/etc/glusterfs/glusterfs.{{name}}.vol
+ #notify:
+ #- remount? no idea...
+
+- name: mount it up
+ mount: >
+ src=/etc/glusterfs/glusterfs.{{name}}.vol
+ state=mounted
+ fstype=glusterfs
+ opts=noatime
diff --git a/roles/gluster/client/templates/client.config b/roles/gluster/client/templates/client.config
new file mode 100644
index 000000000..65c414a3c
--- /dev/null
+++ b/roles/gluster/client/templates/client.config
@@ -0,0 +1,54 @@
+# Config for {{ name }}
+# Generated by ansible
+
+{% for server in servers %}
+volume vol-<%= servers.index(server) %>
+ type protocol/client
+ option transport-type tcp
+ option remote-host <%= server %>
+ option transport.socket.nodelay on
+ option remote-port 6996
+ option remote-subvolume iothreads
+ option username <%= username %>
+ option password <%= password %>
+end-volume
+{% endfor %}
+
+volume mirror-0
+ type cluster/replicate
+ subvolumes {% for i in range(len(servers)) %}vol-#{{i}} {% endfor %}
+ {% if servers.index(ansible_hostname) %}
+ option read-subvolume vol-{{ servers.index(ansible_hostname)}}
+ {% endif %}
+end-volume
+
+volume writebehind
+ type performance/write-behind
+ option cache-size 4MB
+ # option flush-behind on # olecam: increasing the performance of handling lots of small files
+ subvolumes mirror-0
+end-volume
+
+volume iothreads
+ type performance/io-threads
+ option thread-count 16 # default is 16
+ subvolumes writebehind
+end-volume
+
+volume iocache
+ type performance/io-cache
+ option cache-size `grep 'MemTotal' /proc/meminfo | awk '{print $2 * 0.2 / 1024}' | cut -f1 -d.`MB
+ option cache-timeout 30
+ subvolumes iothreads
+end-volume
+
+volume statprefetch
+ type performance/stat-prefetch
+ subvolumes iocache
+end-volume
+
+#volume nfs-server
+# type nfs/server
+# option nfs.dynamic-volumes on
+# subvolumes mirror-0
+#end-volume