Use pkg rather than yum, for future proofing with dnf
---
roles/gluster/client/tasks/main.yml | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/roles/gluster/client/tasks/main.yml b/roles/gluster/client/tasks/main.yml
index 2ecc5cf..8db6025 100644
--- a/roles/gluster/client/tasks/main.yml
+++ b/roles/gluster/client/tasks/main.yml
@@ -1,24 +1,33 @@
---
- name: install needed packages
- yum: pkg={{ item }} state=present
+ pkg:
+ name: "{{ item }}"
+ state: present
with_items:
- glusterfs-fuse
tags:
- packages
- name: make the mountdir
- file: state=directory path={{ mountdir }} owner={{ owner }} group={{ group }}
+ file:
+ state: directory
+ path: "{{ mountdir }}"
+ owner: "{{ owner }}"
+ group: "{{ group }}"
- name: copy over the client config
- template: src=client.config dest=/etc/glusterfs/glusterfs.{{name}}.vol mode=0640
+ template:
+ src: client.config
+ dest: /etc/glusterfs/glusterfs.{{name}}.vol
+ mode: 0640
#notify:
#- remount? no idea...
- name: mount it up
- mount: >
- src=/etc/glusterfs/glusterfs.{{name}}.vol
- state=mounted
- fstype=glusterfs
- name={{mountdir}}
+ mount:
+ src: /etc/glusterfs/glusterfs.{{name}}.vol
+ state: mounted
+ fstype: glusterfs
+ name: "{{mountdir}}"
ignore_errors: True
--
1.8.3.1
Show replies by thread
Asking to gluster devs, they were surprised this would be
working in the first place.
---
roles/gluster/client/templates/client.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roles/gluster/client/templates/client.config
b/roles/gluster/client/templates/client.config
index 668aa6a..ffd059e 100644
--- a/roles/gluster/client/templates/client.config
+++ b/roles/gluster/client/templates/client.config
@@ -38,7 +38,7 @@ 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-size {{ (ansible_memtotal_mb / 5) |round |int }}MB
option cache-timeout 30
subvolumes iothreads
end-volume
--
1.8.3.1