diff --git a/manifests/client.pp b/manifests/client.pp index 1088e1e..cbd583e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -4,7 +4,9 @@ # class glusterfs::client { - package { 'glusterfs-fuse': ensure => installed } + package { 'glusterfs-client': ensure => installed, + require => Class['glusterfs'] + } } diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..87f328e --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,75 @@ +# == Class: glusterfs +# +# Sets up basic packaging for Debian +# +# === Parameters +# +# [*major*] +# major version for glusterfs +# [*minor*] +# minor version for glusterfs +# [*release*] +# release number +# [*gpg_key_id*] +# optional GPG key ID +# +# === Examples +# +# class { 'glusterfs': +# $major => '3', +# $minor => '7', +# $release => '6', +# } +# +# === Authors +# +# Braiins Systems s.r.o. +# +# === Copyright +# +# Copyright 2016 Braiins Systems s.r.o. +# +class glusterfs ( + $major, + $minor, + $release, + $gpg_key_id='A4703C37D3F4DE7F1819E980FE79BB52D5DC52DC', +) { + + $maj_min = "${major}.${minor}" + $download_host = 'download.gluster.org' + $url_base = "https://${download_host}/pub/gluster/glusterfs/old-releases/${maj_min}/${maj_min}.${release}" + # GFS bug: https://github.com/gluster/glusterfs-debian/issues/11 + $ensure = $lsbdistcodename ? { + 'stretch' => absent, + default => present, + } + + # Temp workaround for broken SSL cert: https://github.com/gluster/glusterfs-debian/issues/4 + # fixed on 2017-07-11, since then present with "absent" to remove the file from all hosts + file { '/etc/apt/apt.conf.d/80glusterignorecert': + mode => '0644', + content => "Acquire::https::${download_host}::Verify-Peer \"false\";\n", + ensure => $lsbdistcodename ? { + default => absent, + # 'wheezy' => present # They fixed that already + } + } -> + apt::key { $gpg_key_id: + key_source => "${url_base}/pub.key", + ensure => $ensure, + } -> + apt::source { 'gluster': + location => "${url_base}/Debian/${lsbdistcodename}/apt", + release => $lsbdistcodename, + repos => 'main', + include_src => false, + ensure => $ensure, + } + apt::pin { 'gluster': + priority => '700', + packages => 'gluster*', + origin => $download_host, + ensure => $ensure, + } +} diff --git a/manifests/mount.pp b/manifests/mount.pp index 649a602..c0574db 100644 --- a/manifests/mount.pp +++ b/manifests/mount.pp @@ -20,7 +20,7 @@ device => $device, fstype => 'glusterfs', options => $options, - require => Package['glusterfs-fuse'], + require => Package['glusterfs-client'], } }