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 1010
1111 $_baseurl = pick($postgresql::repo::baseurl , $default_baseurl )
1212
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+
1320 apt::pin { 'apt_postgresql_org' :
1421 originator => ' apt.postgresql.org' ,
1522 priority => 500,
1623 }
1724 -> apt::source { ' apt.postgresql.org' :
1825 location => $_baseurl,
19- release => " ${facts['os']['distro']['codename']}-pgdg " ,
26+ release => $_release ,
2027 repos => ' main' ,
2128 architecture => $facts [' os' ][' architecture' ],
2229 key => {
Original file line number Diff line number Diff line change 33require 'spec_helper'
44
55describe 'postgresql::repo' do
6- include_examples 'Debian 11'
6+ context 'on debian 11' do
7+ include_examples 'Debian 11'
78
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' ) }
1125 end
1226 end
1327end
You can’t perform that action at this time.
0 commit comments