Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to add servers to Storage Pool #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions home/.chezmoi.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ data:
docker:
doRegion: nyc1
domain: "{{ $domain }}"
glusterfs:
peers:
- 10.1.1.10
- 10.1.1.11
- 10.1.1.12
headless: {{ $headless }}
home: "{{ .chezmoi.homeDir }}"
homeParentFolder: "{{ if eq .chezmoi.os "linux" }}/home{{ else if eq .chezmoi.os "darwin" }}/Users{{ else }}C:\Users{{ end }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if (eq .host.distro.family "linux") -}}
#!/usr/bin/env bash
# @file GlusterFS Trusted Storage Pool
# @brief Adds servers to GlusterFS to create/expand a Trusted Storage Pool
# @description
# This script adds the given list of servers/peers to the Trusted Storage Pool. After installing Gluster
# on your servers and before creating a trusted storage pool, each server belongs to a storage pool
# consisting of only that server. This script performs 'peer probing' to add the given list of servers
# forming a Trusted Storage Pool. If a Trusted Storage Pool exists, the given servers are added to it.
#
# ## Configuration Variables
#
# The following chart details the input variable(s) that are used to determine the configuration of the glusterfs:
#
# | Variable | Description |
# |--------------------|------------------------------------------------------------|
# | `glusterfs.peers` | List of servers to be added to the Trusted Storage Pool |

{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}

### Add servers to Trusted Storage Pool
if command -v gluster > /dev/null; then
logg info 'Adding servers to Gluster Trusted Storage Pool'
{{ if and .glusterfs.peers (gt (len .glusterfs.peers) 0) }}
{{- range .glusterfs.peers -}}
sudo gluster peer probe {{ . }} || echo 'Failed adding the peer {{ . }}'
{{ end }}
{{ end }}
else
logg info 'Gluster is not installed or it is not available in the PATH'
fi
{{ end -}}
9 changes: 4 additions & 5 deletions software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,7 @@ softwarePackages:
cask: prezi-video
orbstack:
_bin: orb
_github:
_github:
_name: OrbStack
_when:cask: '! test -d /Applications/OrbStack.app'
cask: orbstack
Expand Down Expand Up @@ -3667,7 +3667,6 @@ softwarePackages:
scoop: glow
yay: glow
glusterfs:
# TODO - The master / peer logic still needs to be implemented in the .chezmoiscripts
_bin: gluster
_desc: '[Gluster](https://www.gluster.org/) is a free and open source software scalable network filesystem. Gluster is a software defined distributed storage that can scale to several petabytes. It provides interfaces for object, block and file storage.'
_docs: https://docs.gluster.org/en/latest/
Expand Down Expand Up @@ -5834,7 +5833,7 @@ softwarePackages:
generator-ngx-rocket:
_bin: ngx
_github: https://github.com/ngx-rocket/generator-ngx-rocket
_name: Angular
_name: Angular
npm: generator-ngx-rocket
ngxtop:
_bin: ngxtop
Expand Down Expand Up @@ -7175,7 +7174,7 @@ softwarePackages:
zypper: xrdp
yay: xrdp
kasmvnc:
_bin:
_bin:
dnf: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
responsively:
_bin: null
Expand Down Expand Up @@ -8372,7 +8371,7 @@ softwarePackages:
scoop: dua
xbps: dua-cli
soduto:
_github:
_github:
_name: Soduto
_when:cask: '! test -d /Applications/Soduto.app'
cask: soduto
Expand Down