diff options
Diffstat (limited to 'vagrant/ansible/roles')
3 files changed, 38 insertions, 25 deletions
diff --git a/vagrant/ansible/roles/glusterfs.setup/tasks/main.yml b/vagrant/ansible/roles/glusterfs.setup/tasks/main.yml index b6e34a5..2210fda 100644 --- a/vagrant/ansible/roles/glusterfs.setup/tasks/main.yml +++ b/vagrant/ansible/roles/glusterfs.setup/tasks/main.yml @@ -7,7 +7,10 @@ - name: Ensure glusterd service is enabled service: name=glusterd state=started enabled=yes -- include_role: - name: gluster.cluster +- include_tasks: + file: "new_volume.yml" vars: - gluster_cluster_hosts: "{{ cluster_hosts }}" + cluster_volume: "{{ replicate_cluster_volume }}" + cluster_bricks: "{{ replicate_cluster_bricks }}" + cluster_replica_count: "{{ replicate_cluster_replica_count }}" + cluster_type: "replicate" diff --git a/vagrant/ansible/roles/glusterfs.setup/tasks/new_volume.yml b/vagrant/ansible/roles/glusterfs.setup/tasks/new_volume.yml new file mode 100644 index 0000000..ec10897 --- /dev/null +++ b/vagrant/ansible/roles/glusterfs.setup/tasks/new_volume.yml @@ -0,0 +1,30 @@ +- name: Create Replicate Volumes + gluster_volume: + state: present + name: "{{ cluster_volume }}" + bricks: '{{ cluster_bricks }}' + cluster: "{{ cluster_hosts }}" + replicas: "{{ cluster_replica_count }}" + run_once: yes + when: cluster_type == 'replicate' + +- name: Set volume options + gluster_volume: + state: present + name: "{{ cluster_volume }}" + options: + { + features.cache-invalidation: 'on', + features.cache-invalidation-timeout: '600', + performance.cache-samba-metadata: 'on', + performance.stat-prefetch: 'on', + performance.cache-invalidation: 'on', + performance.md-cache-timeout: '600', + network.inode-lru-limit: '200000', + performance.nl-cache: 'on', + performance.nl-cache-timeout: '600', + performance.readdir-ahead: 'on', + performance.parallel-readdir: 'on', + } + run_once: true + diff --git a/vagrant/ansible/roles/samba-glusterfs.setup/tasks/main.yml b/vagrant/ansible/roles/samba-glusterfs.setup/tasks/main.yml index 15963e8..2624917 100644 --- a/vagrant/ansible/roles/samba-glusterfs.setup/tasks/main.yml +++ b/vagrant/ansible/roles/samba-glusterfs.setup/tasks/main.yml @@ -46,7 +46,7 @@ src: smb_share.conf.j2 dest: "/etc/samba/smb.shares/{{ samba_share }}.conf" vars: - cluster_volume: "{{ gluster_cluster_volume }}" + cluster_volume: "{{ replicated_cluster_volume }}" - name: Include share configuration into smb.conf lineinfile: @@ -54,32 +54,12 @@ line: "include = /etc/samba/smb.shares/{{ samba_share }}.conf" insertafter: EOF -- name: Set volume options - gluster_volume: - state: present - name: "{{ gluster_cluster_volume }}" - options: - { - features.cache-invalidation: 'on', - features.cache-invalidation-timeout: '600', - performance.cache-samba-metadata: 'on', - performance.stat-prefetch: 'on', - performance.cache-invalidation: 'on', - performance.md-cache-timeout: '600', - network.inode-lru-limit: '200000', - performance.nl-cache: 'on', - performance.nl-cache-timeout: '600', - performance.readdir-ahead: 'on', - performance.parallel-readdir: 'on', - } - run_once: true - - name: Mount glusterfs using fuse mount and set world writable permissions block: - name: Mount gluster volume using glusterfs mount: path: /mnt-fuse - src: 'localhost:/vol' + src: "localhost:/{{ replicated_cluster_volume }}" fstype: glusterfs state: mounted |