|
30 | 30 | ) { |
31 | 31 | include 'apt' |
32 | 32 |
|
33 | | - $repo_key_name = $release ? { |
34 | | - '3.9' => '849512C2CA648EF425048F55C883F50CB2289A17', |
35 | | - '3.10' => 'C784DD0FD61E38B8B1F65E10DAD761554A72C1DF', |
36 | | - '3.11' => 'DE82F0BACC4DB70DBEF95CA65EC2255642304A6E', |
37 | | - '3.12' => '8B7C364430B66F0B084C0B0C55339A4C6A7BD8D4', |
38 | | - '3.13' => '9B5AE8E6FD2581F293104ACC38675E5F30F779AF', |
39 | | - '4.0' => '55F839E173AC06F364120D46FA86EEACB306CEE1', |
40 | | - '4.1' => 'EED3351AFD72E5437C050F0388F6CDEE78FA6D97', |
41 | | - default => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C', |
42 | | - } |
43 | | - |
44 | | - $repo_key_source = "https://download.gluster.org/pub/gluster/glusterfs/${release}/rsa.pub" |
45 | | - |
46 | | - # basic sanity check |
47 | | - if $version == 'LATEST' { |
48 | | - $repo_ver = $version |
49 | | - } elsif $version =~ /^\d\.\d+$/ { |
50 | | - $repo_ver = "${version}/LATEST" |
51 | | - } elsif $version =~ /^(\d)\.(\d+)\.(\d+).*$/ { |
52 | | - $repo_ver = "${1}.${2}/${1}.${2}.${3}" |
53 | | - } else { |
54 | | - fail("${version} doesn't make sense for ${facts['os']['name']}!") |
| 33 | + $_release = versioncmp($release, '4.1') ? { |
| 34 | + 1 => $release.match(/\A[^.]*/)[0], |
| 35 | + default => $release, |
55 | 36 | } |
56 | 37 |
|
57 | 38 | # the Gluster repo only supports x86_64 (amd64) and arm64. The Ubuntu PPA also supports armhf and arm64. |
58 | 39 | case $facts['os']['name'] { |
59 | 40 | 'Debian': { |
| 41 | + $repo_key_name = $release ? { |
| 42 | + '3.9' => '849512C2CA648EF425048F55C883F50CB2289A17', |
| 43 | + '3.10' => 'C784DD0FD61E38B8B1F65E10DAD761554A72C1DF', |
| 44 | + '3.11' => 'DE82F0BACC4DB70DBEF95CA65EC2255642304A6E', |
| 45 | + '3.12' => '8B7C364430B66F0B084C0B0C55339A4C6A7BD8D4', |
| 46 | + '3.13' => '9B5AE8E6FD2581F293104ACC38675E5F30F779AF', |
| 47 | + '4.0' => '55F839E173AC06F364120D46FA86EEACB306CEE1', |
| 48 | + '4.1' => 'EED3351AFD72E5437C050F0388F6CDEE78FA6D97', |
| 49 | + default => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C', |
| 50 | + } |
| 51 | + |
| 52 | + $repo_key_source = "https://download.gluster.org/pub/gluster/glusterfs/${_release}/rsa.pub" |
| 53 | + |
| 54 | + # basic sanity check |
| 55 | + if $version == 'LATEST' { |
| 56 | + $repo_ver = $version |
| 57 | + } elsif $version =~ /^\d\.\d+$/ { |
| 58 | + $repo_ver = "${version}/LATEST" |
| 59 | + } elsif $version =~ /^(\d)\.(\d+)\.(\d+).*$/ { |
| 60 | + $repo_ver = "${1}.${2}/${1}.${2}.${3}" |
| 61 | + } else { |
| 62 | + fail("${version} doesn't make sense for ${facts['os']['name']}!") |
| 63 | + } |
| 64 | + |
60 | 65 | case $facts['os']['distro']['codename'] { |
61 | 66 | 'jessie', 'stretch': { |
62 | 67 | $arch = $facts['os']['architecture'] ? { |
|
69 | 74 | $repo_url = if versioncmp($release, '4.1') < 0 { |
70 | 75 | "${_repo_base}/01.old-releases/${release}/LATEST/Debian/${facts['os']['distro']['codename']}/${arch}/apt/" |
71 | 76 | } else { |
72 | | - $_release = if $release == '4.1' { |
73 | | - $release |
74 | | - } else { |
75 | | - $release[0] |
76 | | - } |
77 | 77 | "${_repo_base}/${_release}/LATEST/Debian/${facts['os']['distro']['codename']}/${arch}/apt/" |
78 | 78 | } |
79 | 79 | } |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | } |
| 85 | + 'Ubuntu': { |
| 86 | + $repo_key_name = 'F7C73FCC930AC9F83B387A5613E01B7B3FE869A9' |
| 87 | + $repo_key_source = undef |
| 88 | + |
| 89 | + unless $version == 'LATEST' { |
| 90 | + fail("Specifying version other than LATEST doesn't make sense for Ubuntu PPA!") |
| 91 | + } |
| 92 | + $repo_ver = $version |
| 93 | + |
| 94 | + $arch = $facts['os']['architecture'] ? { |
| 95 | + 'amd64' => 'amd64', |
| 96 | + 'arm64' => 'arm64', |
| 97 | + 'armhf' => 'armhf', |
| 98 | + 'i386' => 'i386', |
| 99 | + default => false, |
| 100 | + } |
| 101 | + |
| 102 | + $repo_url = "http://ppa.launchpad.net/gluster/glusterfs-${_release}/ubuntu" |
| 103 | + } |
85 | 104 | default: { |
86 | | - fail('gluster::repo::apt currently only works on Debian') |
| 105 | + fail('gluster::repo::apt currently only works on Debian and Ubuntu') |
87 | 106 | } |
88 | 107 | } |
89 | 108 |
|
|
99 | 118 | repos => 'main', |
100 | 119 | key => { |
101 | 120 | id => $repo_key_name, |
102 | | - key_source => $repo_key_source, |
| 121 | + source => $repo_key_source, |
103 | 122 | }, |
104 | 123 | pin => $priority, |
105 | 124 | architecture => $arch, |
|
0 commit comments