File tree Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 5757# @param repo_proxy Sets the proxy option for the official PostgreSQL yum-repositories only.
5858#
5959# @param repo_baseurl Sets the baseurl for the PostgreSQL repository. Useful if you host your own mirror of the repository.
60+ # @param yum_repo_commonurl Sets the url for the PostgreSQL common Yum repository. Useful if you host your own mirror of the YUM repository.
6061#
6162# @param needs_initdb Explicitly calls the initdb operation after the server package is installed and before the PostgreSQL service is started.
6263#
142143 $postgis_version = undef ,
143144 $repo_proxy = undef ,
144145 $repo_baseurl = undef ,
146+ $yum_repo_commonurl = undef ,
145147
146148 $needs_initdb = undef ,
147149
265267 # Setup of the repo only makes sense globally, so we are doing this here.
266268 if ($manage_package_repo ) {
267269 class { 'postgresql::repo' :
268- version => $globals_version ,
269- proxy => $repo_proxy ,
270- baseurl => $repo_baseurl ,
270+ version => $globals_version ,
271+ proxy => $repo_proxy ,
272+ baseurl => $repo_baseurl ,
273+ commonurl => $yum_repo_commonurl ,
271274 }
272275 }
273276
Original file line number Diff line number Diff line change 33 $version = undef ,
44 $proxy = undef ,
55 $baseurl = undef ,
6+ $commonurl = undef ,
67) {
78 case $facts [' os' ][' family' ] {
89 ' RedHat' , ' Linux' : {
Original file line number Diff line number Diff line change 2020 $label2 = ' rhel'
2121 }
2222 $default_baseurl = " https://download.postgresql.org/pub/repos/yum/${postgresql::repo::version} /${label1} /${label2} -\$ releasever-\$ basearch"
23+ $default_commonurl = " https://download.postgresql.org/pub/repos/yum/common/${label1} /${label2} -\$ releasever-\$ basearch"
2324
2425 $_baseurl = pick($postgresql::repo::baseurl , $default_baseurl )
26+ $_commonurl = pick($postgresql::repo::commonurl , $default_commonurl )
2527
2628 yumrepo { 'yum.postgresql.org' :
2729 descr => " PostgreSQL ${postgresql::repo::version} \$ releasever - \$ basearch" ,
3234 proxy => $postgresql::repo::proxy ,
3335 }
3436
37+ yumrepo { 'pgdg-common' :
38+ descr => " PostgreSQL common RPMs \$ releasever - \$ basearch" ,
39+ baseurl => $_commonurl,
40+ enabled => 1,
41+ gpgcheck => 1,
42+ gpgkey => " file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version} " ,
43+ proxy => $postgresql::repo::proxy ,
44+ }
45+
3546 Yumrepo[' yum.postgresql.org' ] -> Package<|tag == ' puppetlabs-postgresql' |>
3647}
Original file line number Diff line number Diff line change 7575 'enabled' => '1' ,
7676 'proxy' => 'http://proxy-server:8080' ,
7777 )
78+ is_expected . to contain_yumrepo ( 'pgdg-common' ) . with (
79+ 'enabled' => '1' ,
80+ 'proxy' => 'http://proxy-server:8080' ,
81+ )
7882 end
7983 end
8084
8185 describe 'repo_baseurl on RHEL => mirror.localrepo.com' do
8286 let ( :params ) do
8387 {
8488 manage_package_repo : true ,
85- repo_baseurl : 'http://mirror.localrepo.com' ,
89+ repo_baseurl : 'http://mirror.localrepo.com/pgdg-postgresql' ,
90+ yum_repo_commonurl : 'http://mirror.localrepo.com/pgdg-common' ,
8691 }
8792 end
8893
9398 it do
9499 is_expected . to contain_yumrepo ( 'yum.postgresql.org' ) . with (
95100 'enabled' => '1' ,
96- 'baseurl' => 'http://mirror.localrepo.com' ,
101+ 'baseurl' => 'http://mirror.localrepo.com/pgdg-postgresql' ,
102+ )
103+ is_expected . to contain_yumrepo ( 'pgdg-common' ) . with (
104+ 'enabled' => '1' ,
105+ 'baseurl' => 'http://mirror.localrepo.com/pgdg-common' ,
97106 )
98107 end
99108 end
You can’t perform that action at this time.
0 commit comments