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 56
56
# @param repo_proxy Sets the proxy option for the official PostgreSQL yum-repositories only.
57
57
#
58
58
# @param repo_baseurl Sets the baseurl for the PostgreSQL repository. Useful if you host your own mirror of the repository.
59
+ # @param repo_commonurl Sets the url for the PostgreSQL common repository. Useful if you host your own mirror of the repository.
59
60
#
60
61
# @param needs_initdb Explicitly calls the initdb operation after the server package is installed and before the PostgreSQL service is started.
61
62
#
132
133
$postgis_version = undef ,
133
134
$repo_proxy = undef ,
134
135
$repo_baseurl = undef ,
136
+ $repo_commonurl = undef ,
135
137
136
138
$needs_initdb = undef ,
137
139
256
258
# Setup of the repo only makes sense globally, so we are doing this here.
257
259
if ($manage_package_repo ) {
258
260
class { 'postgresql::repo' :
259
- version => $globals_version ,
260
- proxy => $repo_proxy ,
261
- baseurl => $repo_baseurl ,
261
+ version => $globals_version ,
262
+ proxy => $repo_proxy ,
263
+ baseurl => $repo_baseurl ,
264
+ commonurl => $repo_commonurl ,
262
265
}
263
266
}
264
267
}
Original file line number Diff line number Diff line change 3
3
$version = undef ,
4
4
$proxy = undef ,
5
5
$baseurl = undef ,
6
+ $commonurl = undef ,
6
7
) {
7
8
case $::osfamily {
8
9
' RedHat' , ' Linux' : {
Original file line number Diff line number Diff line change 20
20
$label2 = ' rhel'
21
21
}
22
22
$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"
23
24
24
25
$_baseurl = pick($postgresql::repo::baseurl , $default_baseurl )
26
+ $_commonurl = pick($postgresql::repo::commonurl , $default_commonurl )
25
27
26
28
yumrepo { 'yum.postgresql.org' :
27
29
descr => " PostgreSQL ${postgresql::repo::version} \$ releasever - \$ basearch" ,
32
34
proxy => $postgresql::repo::proxy ,
33
35
}
34
36
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
+
35
46
Yumrepo[' yum.postgresql.org' ] -> Package<|tag == ' puppetlabs-postgresql' |>
36
47
}
Original file line number Diff line number Diff line change 71
71
'enabled' => '1' ,
72
72
'proxy' => 'http://proxy-server:8080' ,
73
73
)
74
+ is_expected . to contain_yumrepo ( 'pgdg-common' ) . with (
75
+ 'enabled' => '1' ,
76
+ 'proxy' => 'http://proxy-server:8080' ,
77
+ )
74
78
end
75
79
end
76
80
77
81
describe 'repo_baseurl on RHEL => mirror.localrepo.com' do
78
82
let ( :params ) do
79
83
{
80
84
manage_package_repo : true ,
81
- repo_baseurl : 'http://mirror.localrepo.com' ,
85
+ repo_baseurl : 'http://mirror.localrepo.com/pgdg-postgresql' ,
86
+ repo_commonurl : 'http://mirror.localrepo.com/pgdg-common' ,
82
87
}
83
88
end
84
89
89
94
it do
90
95
is_expected . to contain_yumrepo ( 'yum.postgresql.org' ) . with (
91
96
'enabled' => '1' ,
92
- 'baseurl' => 'http://mirror.localrepo.com' ,
97
+ 'baseurl' => 'http://mirror.localrepo.com/pgdg-postgresql' ,
98
+ )
99
+ is_expected . to contain_yumrepo ( 'pgdg-common' ) . with (
100
+ 'enabled' => '1' ,
101
+ 'baseurl' => 'http://mirror.localrepo.com/pgdg-common' ,
93
102
)
94
103
end
95
104
end
You can’t perform that action at this time.
0 commit comments