ansible.role.gluster/tasks/main.yml
2019-05-03 15:08:27 +08:00

63 lines
1.2 KiB
YAML

- name: Change tuned profile to throughput-performance
shell: tuned-adm profile throughput-performance
- name: Install EPEL
yum:
name:
- epel-release
state: latest
- name: Write hosts file
blockinfile:
path: /etc/hosts
block: |
10.66.2.47 gluster-s1
10.66.2.178 gluster-s2
10.66.2.107 gluster-a1
- name: Check if /.gluster/brick1 is already created
stat:
path: /.gluster/brick1
register: brickDir
- name: format and mount data disk
block:
- filesystem:
fstype: ext4
dev: /dev/nvme1n1
opts: -O dir_index -Ldata
- file:
path: /.gluster/brick1
state: directory
- mount:
path: /.gluster
src: LABEL=data
fstype: ext4
opts: noatime,nodiratime
state: mounted
- file:
path: /.gluster/brick1
state: directory
when: not brickDir.stat.exists
- name: Install gluster repo
yum:
name:
- centos-release-gluster6
state: latest
- name: Intall glusterfs
yum:
name:
- glusterfs-server
- glusterfs-fuse
- name: Start up glusterd
service:
name: glusterd
state: started
enabled: yes