Fix installation of glusterd server

This commit is contained in:
2022-08-29 21:13:04 -04:00
parent aedf86ef0a
commit 7ff5dc892f
13 changed files with 77 additions and 7 deletions

View File

@@ -8,11 +8,16 @@
become: true become: true
vars: vars:
glusterd:
version: 9.2-1
unit: glusterd
envfile: /etc/sysconfig/glusterd
# glusterfs_default_release: 6 # glusterfs_default_release: 6
# glusterfs_ppa_version: 6 # glusterfs_ppa_version: 6
# glusterfs_daemon: glusterd # glusterfs_daemon: glusterd
cluster: cluster:
- cubox-i - cubox-i
- cubox-m
move_brick: move_brick:
- gitea - gitea
@@ -23,7 +28,7 @@
# with_items: "{{mounts[inventory_hostname]}}" # with_items: "{{mounts[inventory_hostname]}}"
roles: roles:
- glusterfs - glusterfs-server
post_tasks: post_tasks:
# - name: check service is up # - name: check service is up

View File

@@ -3,13 +3,19 @@
# device; this may be used with UUID= as a more robust way to name devices # 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). # that works even if disks are added and removed. See fstab(5).
# #
glusterd:
version: 9.2-1
unit: glusterd
envfile: /etc/sysconfig/glusterd
cluster: cluster:
- cubox-i - cubox-i
nodes: #cubox-inodes:
- name: cubox-i # - name: cubox-i
uuid: 8c6d97da-f712-41d5-829a-906de5113479 # uuid: 8c6d97da-f712-41d5-829a-906de5113479
- name: home # - name: home
uuid: c59792a8-72d6-463b-8309-e66c6bc96d35 # uuid: c59792a8-72d6-463b-8309-e66c6bc96d35
volumes: volumes:
brick_folder: brick brick_folder: brick

View File

@@ -0,0 +1,9 @@
---
# handlers/main.yml
# define handlers here
- name: restart glusterd
ansible.builtin.systemd:
name: "{{ glusterd.unit }}"
state: restarted

View File

@@ -0,0 +1,7 @@
---
# create the cluster
- name: Create a trusted storage pool
gluster.gluster.gluster_peer:
state: present
nodes: "{{cluster}}"

View 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

View File

@@ -5,7 +5,9 @@
# name: geerlingguy.glusterfs # name: geerlingguy.glusterfs
# when: ansible_architecture != 'armv7l' # when: ansible_architecture != 'armv7l'
- include_tasks: install_src.yaml - include_tasks: install.yaml
- include_tasks: create_cluster.yaml
#- include_tasks: manage_volumes.yml #- include_tasks: manage_volumes.yml

View File

@@ -0,0 +1,2 @@
LOG_LEVEL=INFO
GLUSTERD_OPTIONS=