diff options
author | Anoop C S <anoopcs@redhat.com> | 2019-09-21 19:50:21 +0530 |
---|---|---|
committer | Anoop C S <anoopcs@redhat.com> | 2019-09-21 20:54:07 +0530 |
commit | 4d2f1097aa29677b7e08839cd5ce178796260a14 (patch) | |
tree | ee61ce3282513aeefe3dd622f96bbf4f03281b43 | |
parent | ad253c1ec136a9e647bf53e0415b238246d4b9a7 (diff) | |
download | autocluster-glusterfs-helpers.tar.gz autocluster-glusterfs-helpers.tar.xz autocluster-glusterfs-helpers.zip |
Add GlusterFS and helpersglusterfs-helpers
Signed-off-by: Anoop C S <anoopcs@redhat.com>
5 files changed, 88 insertions, 0 deletions
diff --git a/ansible/node/roles/clusterfs/tasks/redhat/clusterfs-glusterfs.yml b/ansible/node/roles/clusterfs/tasks/redhat/clusterfs-glusterfs.yml new file mode 100644 index 0000000..35305f6 --- /dev/null +++ b/ansible/node/roles/clusterfs/tasks/redhat/clusterfs-glusterfs.yml @@ -0,0 +1,16 @@ +--- +- name: Install GlusterFS rpms + yum: + name: "{{ gluster_rpms }}" + state: latest + vars: + gluster_rpms: + - glusterfs-server + +- name: Install basic tools + yum: + name: "{{ tools }}" + state: latest + vars: + tools: + - lvm2 diff --git a/ansible/node/roles/clusterfs/tasks/redhat/repo.yml b/ansible/node/roles/clusterfs/tasks/redhat/repo.yml index 0000ccd..f93a338 100644 --- a/ansible/node/roles/clusterfs/tasks/redhat/repo.yml +++ b/ansible/node/roles/clusterfs/tasks/redhat/repo.yml @@ -10,3 +10,9 @@ with_list: "{{ repositories }}" loop_control: loop_var: repo + +- name: Enable EPEL repository + yum: + name: epel-release + state: latest + when: clusterfs.type == "glusterfs" diff --git a/ansible/node/roles/nas/tasks/generic/samba-glusterfs-once.yml b/ansible/node/roles/nas/tasks/generic/samba-glusterfs-once.yml new file mode 100644 index 0000000..e722291 --- /dev/null +++ b/ansible/node/roles/nas/tasks/generic/samba-glusterfs-once.yml @@ -0,0 +1,14 @@ +--- +- name: Tweak Samba config for GlusterFS cluster filesystem + command: net conf setparm global "{{ p.param }}" "{{ p.value }}" + with_list: + - param: kernel share modes + value: "no" + - param: kernel oplocks + value: "no" + - param: kernel change notify + value: "no" + - param: posix locking + value: "no" + loop_control: + loop_var: p diff --git a/ansible/node/roles/storage/tasks/generic/clusterfs-glusterfs.yml b/ansible/node/roles/storage/tasks/generic/clusterfs-glusterfs.yml new file mode 100644 index 0000000..1a6b19f --- /dev/null +++ b/ansible/node/roles/storage/tasks/generic/clusterfs-glusterfs.yml @@ -0,0 +1,8 @@ +- name: Include ansible roles for Gluster cluster setup + include_role: + name: '{{ gluster-ansible-roles }}' + with_list: + - gluster.infra + - gluster.cluster + loop_control: + loop_var: gluster-ansible-roles diff --git a/ansible/node/roles/storage/vars/main.yml b/ansible/node/roles/storage/vars/main.yml new file mode 100644 index 0000000..e215ee4 --- /dev/null +++ b/ansible/node/roles/storage/vars/main.yml @@ -0,0 +1,44 @@ +gluster_infra_volume_groups: + - { vgname: 'vg_vdb', pvname: '/dev/vdb' } + - { vgname: 'vg_vdc', pvname: '/dev/vdc' } + +gluster_infra_thinpools: + - {vgname: 'vg_vdb', thinpoolname: 'vg_vdb_thinpool', thinpoolsize: '9G', poolmetadatasize: '100M' } + - {vgname: 'vg_vdc', thinpoolname: 'vg_vdc_thinpool', thinpoolsize: '9G', poolmetadatasize: '100M' } + +gluster_infra_lv_logicalvols: + - { vgname: 'vg_vdb', thinpool: 'vg_vdb_thinpool', lvname: 'vg_vdb_thinlv', lvsize: '9G' } + - { vgname: 'vg_vdc', thinpool: 'vg_vdc_thinpool', lvname: 'vg_vdc_thinlv', lvsize: '9G' } + +gluster_infra_mount_devices: + - { path: '/bricks/brick0', vgname: 'vg_vdb', lvname: 'vg_vdb_thinlv' } + - { path: '/bricks/brick1', vgname: 'vg_vdc', lvname: 'vg_vdc_thinlv' } + +gluster_infra_fw_ports: + - 2049/tcp + - 54321/tcp + - 5900/tcp + - 5900-6923/tcp + - 5666/tcp + - 16514/tcp + +gluster_infra_fw_permanent: true + +gluster_infra_fw_state: enabled + +gluster_infra_fw_zone: public + +gluster_infra_fw_services: + - glusterfs + +gluster_cluster_hosts: + - storage0 + - storage1 + +gluster_cluster_volume: vol + +gluster_cluster_replica_count: 2 + +gluster_cluster_transport: 'tcp' + +gluster_cluster_bricks: '/bricks/brick0/vol,/bricks/brick1/vol' |