wip glusterfs

This commit is contained in:
2021-12-24 22:45:48 -05:00
parent d3d692865c
commit 697b00fa4e
22 changed files with 560 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
---
- name: Override glusterfs_daemon for Ubuntu 14.04.
set_fact:
glusterfs_daemon: glusterfs-server
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_version == "14.04"
# Setup/install tasks.
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include: setup-{{ ansible_distribution }}.yml
when: ansible_os_family == 'Debian'
- name: Ensure GlusterFS is started and enabled at boot.
service: "name={{ glusterfs_daemon }} state=started enabled=yes"

View File

@@ -0,0 +1,45 @@
---
- name: Ensure dependencies are installed.
apt:
name:
- gnupg2
- apt-transport-https
- ca-certificates
state: present
- name: Ensure repository pubkey for GlusterFS is present.
apt_key:
url: 'https://download.gluster.org/pub/gluster/glusterfs/{{ glusterfs_gpg_key_version }}/rsa.pub'
state: present
register: glusterfs_pub_key_added
- name: Get the DEB architecture.
command: dpkg --print-architecture
changed_when: false
register: deb_architecture
- name: Ensure debian repo is present.
apt_repository:
repo: "deb https://download.gluster.org/pub/gluster/glusterfs/{{ glusterfs_deb_version }}/Debian/\
{{ ansible_distribution_release }}/{{ deb_architecture.stdout }}/apt {{ ansible_distribution_release }} \
main"
state: present
filename: gluster
register: glusterfs_deb_source_added
- name: Ensure GlusterFS will reinstall if the DEB source was just added.
apt:
name:
- glusterfs-server
- glusterfs-client
state: absent
when: glusterfs_deb_source_added.changed
tags: ['skip_ansible_lint']
- name: Ensure GlusterFS is installed.
apt:
name:
- glusterfs-server
- glusterfs-client
state: present
default_release: "{{ glusterfs_default_release }}"

View File

@@ -0,0 +1,12 @@
---
- name: Ensure dependencies are installed.
yum:
name: "centos-release-gluster{{ glusterfs_default_release }}"
state: present
- name: Ensure Gluster packages are installed.
yum:
name:
- glusterfs-server
- glusterfs-client
state: present

View File

@@ -0,0 +1,30 @@
---
- name: Ensure dependencies are installed.
apt:
name: dirmngr
state: present
- name: Ensure PPA for GlusterFS is present.
apt_repository:
repo: 'ppa:gluster/glusterfs-{{ glusterfs_ppa_version }}'
state: present
update_cache: true
register: glusterfs_ppa_added
when: glusterfs_ppa_use
- name: Ensure GlusterFS will reinstall if the PPA was just added.
apt:
name:
- glusterfs-server
- glusterfs-client
state: absent
when: glusterfs_ppa_added.changed
tags: ['skip_ansible_lint']
- name: Ensure GlusterFS is installed.
apt:
name:
- glusterfs-server
- glusterfs-client
state: present
default_release: "{{ glusterfs_default_release }}"