From daa9a07620f51ba0fd567389b4eb63e7d17baf13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Capek?= Date: Tue, 12 Jan 2016 17:55:55 +0100 Subject: [PATCH 1/7] Add base class that configures package repositories for a Debian distro --- manifests/init.pp | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 manifests/init.pp diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..12c2642 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,55 @@ +# == 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='D5DC52DC', +) { + + $maj_min = "${major}.${minor}" + $url_base = "http://download.gluster.org/pub/gluster/glusterfs/${maj_min}/${maj_min}.${release}" + apt::key { 'D5DC52DC': + key_source => "${url_base}/pub.key" + } -> + apt::source { 'gluster': + location => "${url_base}/Debian/${lsbdistcodename}/apt", + release => $lsbdistcodename, + repos => 'main', + include_src => false, + } + apt::pin { 'gluster': + priority => '700', + packages => 'gluster*', + codename => $lsbdistcodename, + } +} From a4f96dee6edd1dd8ec2fb558a122903f6629ced8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Capek?= Date: Tue, 12 Jan 2016 17:57:06 +0100 Subject: [PATCH 2/7] client/mount: update package name according to what is provided by glusterfs repositories --- manifests/client.pp | 2 +- manifests/mount.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 1088e1e..ce2fb58 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -4,7 +4,7 @@ # class glusterfs::client { - package { 'glusterfs-fuse': ensure => installed } + package { 'glusterfs-client': ensure => installed } } 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'], } } From d27b66f30c1611b8059b14698469a07e641c4beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Capek?= Date: Wed, 13 Jan 2016 15:33:01 +0100 Subject: [PATCH 3/7] client: require base class first to ensure correct repository setup before installing glusterfs packages --- manifests/client.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index ce2fb58..cbd583e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -4,7 +4,9 @@ # class glusterfs::client { - package { 'glusterfs-client': ensure => installed } + package { 'glusterfs-client': ensure => installed, + require => Class['glusterfs'] + } } From 7e2b6abbe2a7e93069cbf33863095d8654aaa1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Capek?= Date: Thu, 14 Jan 2016 17:01:12 +0100 Subject: [PATCH 4/7] glusterfs: set GPG key correctly --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 12c2642..3d7e513 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -33,12 +33,12 @@ $major, $minor, $release, - $gpg_key_id='D5DC52DC', + $gpg_key_id='A4703C37D3F4DE7F1819E980FE79BB52D5DC52DC', ) { $maj_min = "${major}.${minor}" $url_base = "http://download.gluster.org/pub/gluster/glusterfs/${maj_min}/${maj_min}.${release}" - apt::key { 'D5DC52DC': + apt::key { $gpg_key_id: key_source => "${url_base}/pub.key" } -> apt::source { 'gluster': From 124a6cd5397ffb03a97b3d1a5ba17c1ca5438bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pavl=C3=ADk?= Date: Mon, 30 Jan 2017 15:30:44 +0100 Subject: [PATCH 5/7] Use https repository URL, apt doesn't like 302 redirects --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3d7e513..1e8e17e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -37,7 +37,7 @@ ) { $maj_min = "${major}.${minor}" - $url_base = "http://download.gluster.org/pub/gluster/glusterfs/${maj_min}/${maj_min}.${release}" + $url_base = "https://download.gluster.org/pub/gluster/glusterfs/${maj_min}/${maj_min}.${release}" apt::key { $gpg_key_id: key_source => "${url_base}/pub.key" } -> From 79d75e89ad64bc3e61d673a06f257a13619a944a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pavl=C3=ADk?= Date: Wed, 18 Oct 2017 15:40:01 +0200 Subject: [PATCH 6/7] Disable origin repo for stretch - the packages do have broken dependencies and are not installable, see comment inside the file - changed matching entry for pinning to really distinguish between packages comming from different repos --- manifests/init.pp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1e8e17e..3ea808d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -37,19 +37,29 @@ ) { $maj_min = "${major}.${minor}" - $url_base = "https://download.gluster.org/pub/gluster/glusterfs/${maj_min}/${maj_min}.${release}" + $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, + } + apt::key { $gpg_key_id: - key_source => "${url_base}/pub.key" + 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*', - codename => $lsbdistcodename, + origin => $download_host, + ensure => $ensure, } } From 2d9dde5b58a1988796cbc9fe592727df1f3ffd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pavl=C3=ADk?= Date: Wed, 18 Oct 2017 15:43:09 +0200 Subject: [PATCH 7/7] Temp turn off invalid SSL cert check --- manifests/init.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 3ea808d..87f328e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -45,6 +45,16 @@ 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,