Fix installation of glusterd server
This commit is contained in:
@@ -3,13 +3,19 @@
|
||||
# device; this may be used with UUID= as a more robust way to name devices
|
||||
# that works even if disks are added and removed. See fstab(5).
|
||||
#
|
||||
|
||||
glusterd:
|
||||
version: 9.2-1
|
||||
unit: glusterd
|
||||
envfile: /etc/sysconfig/glusterd
|
||||
|
||||
cluster:
|
||||
- cubox-i
|
||||
nodes:
|
||||
- name: cubox-i
|
||||
uuid: 8c6d97da-f712-41d5-829a-906de5113479
|
||||
- name: home
|
||||
uuid: c59792a8-72d6-463b-8309-e66c6bc96d35
|
||||
#cubox-inodes:
|
||||
# - name: cubox-i
|
||||
# uuid: 8c6d97da-f712-41d5-829a-906de5113479
|
||||
# - name: home
|
||||
# uuid: c59792a8-72d6-463b-8309-e66c6bc96d35
|
||||
|
||||
volumes:
|
||||
brick_folder: brick
|
||||
9
ansible-5/roles/glusterfs-server/handlers/main.yml
Normal file
9
ansible-5/roles/glusterfs-server/handlers/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
# handlers/main.yml
|
||||
# define handlers here
|
||||
|
||||
|
||||
- name: restart glusterd
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ glusterd.unit }}"
|
||||
state: restarted
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# create the cluster
|
||||
|
||||
- name: Create a trusted storage pool
|
||||
gluster.gluster.gluster_peer:
|
||||
state: present
|
||||
nodes: "{{cluster}}"
|
||||
39
ansible-5/roles/glusterfs-server/tasks/install.yaml
Normal file
39
ansible-5/roles/glusterfs-server/tasks/install.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
# install available glusterfs-server
|
||||
|
||||
# install packages
|
||||
- name: Ensure glusterfs server is installed.
|
||||
ansible.builtin.apt:
|
||||
name: "{{ item }}"
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
||||
update_cache_retries: 10
|
||||
state: present
|
||||
with_items:
|
||||
- glusterfs-server={{glusterd.version}}
|
||||
- xfsprogs
|
||||
- xfsdump
|
||||
notify:
|
||||
- restart glusterd
|
||||
|
||||
- name: create systemd environment file
|
||||
ansible.builtin.template:
|
||||
src: systemd/environment.j2
|
||||
dest: "{{glusterd.envfile}}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify:
|
||||
- restart glusterd
|
||||
|
||||
- name: enable systemd unit
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ glusterd.unit }}"
|
||||
enabled: yes
|
||||
notify:
|
||||
- restart glusterd
|
||||
|
||||
- name: start glusterd
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ glusterd.unit }}"
|
||||
state: started
|
||||
@@ -5,7 +5,9 @@
|
||||
# name: geerlingguy.glusterfs
|
||||
# when: ansible_architecture != 'armv7l'
|
||||
|
||||
- include_tasks: install_src.yaml
|
||||
- include_tasks: install.yaml
|
||||
|
||||
- include_tasks: create_cluster.yaml
|
||||
|
||||
#- include_tasks: manage_volumes.yml
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
LOG_LEVEL=INFO
|
||||
GLUSTERD_OPTIONS=
|
||||
Reference in New Issue
Block a user