File tree Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 10
10
11
11
$_baseurl = pick($postgresql::repo::baseurl , $default_baseurl )
12
12
13
+ # Puppet still supports Ubuntu 18.04, but Postgresql no longer provides
14
+ # specific builds for it. Use the equivalent Debian release.
15
+ $_release = $facts [' os' ][' distro' ][' codename' ] ? {
16
+ ' bionic' => ' buster' ,
17
+ /(.+)/ => $1,
18
+ }
19
+
13
20
apt::pin { 'apt_postgresql_org' :
14
21
originator => ' apt.postgresql.org' ,
15
22
priority => 500,
16
23
}
17
24
-> apt::source { ' apt.postgresql.org' :
18
25
location => $_baseurl,
19
- release => " ${facts['os']['distro']['codename']}-pgdg " ,
26
+ release => $_release ,
20
27
repos => ' main' ,
21
28
architecture => $facts [' os' ][' architecture' ],
22
29
key => {
Original file line number Diff line number Diff line change 3
3
require 'spec_helper'
4
4
5
5
describe 'postgresql::repo' do
6
- include_examples 'Debian 11'
6
+ context 'on debian 11' do
7
+ include_examples 'Debian 11'
7
8
8
- describe 'with no parameters' do
9
- it 'instantiates apt_postgresql_org class' do
10
- expect ( subject ) . to contain_class ( 'postgresql::repo::apt_postgresql_org' )
9
+ describe 'with no parameters' do
10
+ it 'instantiates apt_postgresql_org class' do
11
+ expect ( subject ) . to contain_class ( 'postgresql::repo::apt_postgresql_org' )
12
+ end
13
+
14
+ it { is_expected . to contain_apt__source ( 'apt.postgresql.org' ) . with_release ( facts [ :os ] [ 'distro' ] [ 'codename' ] ) }
15
+
16
+ it { is_expected . to contain_apt__pin ( 'apt_postgresql_org' ) }
17
+ end
18
+ end
19
+
20
+ context 'on ubuntu 18.04' do
21
+ include_examples 'Ubuntu 18.04'
22
+
23
+ describe 'with no parameters' do
24
+ it { is_expected . to contain_apt__source ( 'apt.postgresql.org' ) . with_release ( 'buster' ) }
11
25
end
12
26
end
13
27
end
You can’t perform that action at this time.
0 commit comments