adding proxy option for yum repositories
This commit is contained in:
parent
7981b0950e
commit
1eb45d07f1
6 changed files with 78 additions and 23 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
## Unreleased
|
||||||
|
### Summary
|
||||||
|
- support setting a proxy for yum operations
|
||||||
|
|
||||||
## 2015-07-07 - Supported Release 4.4.2
|
## 2015-07-07 - Supported Release 4.4.2
|
||||||
### Summary
|
### Summary
|
||||||
This release fixes a bug introduced in 4.4.0.
|
This release fixes a bug introduced in 4.4.0.
|
||||||
|
|
|
@ -301,6 +301,10 @@ This will set the default encoding encoding for all databases created with this
|
||||||
####`locale`
|
####`locale`
|
||||||
This will set the default database locale for all databases created with this module. On certain operating systems this will be used during the `template1` initialization as well so it becomes a default outside of the module as well. Defaults to `undef` which is effectively `C`.
|
This will set the default database locale for all databases created with this module. On certain operating systems this will be used during the `template1` initialization as well so it becomes a default outside of the module as well. Defaults to `undef` which is effectively `C`.
|
||||||
|
|
||||||
|
####`repo_proxy`
|
||||||
|
This will set the proxy option for the official PostgreSQL yum-repositories only, Debian is currently not supported. This is useful if your server is behind a corporate firewall and needs to use proxyservers for outside connectivity.
|
||||||
|
|
||||||
|
|
||||||
#####Debian
|
#####Debian
|
||||||
|
|
||||||
On Debian you'll need to ensure that the 'locales-all' package is installed for full functionality of Postgres.
|
On Debian you'll need to ensure that the 'locales-all' package is installed for full functionality of Postgres.
|
||||||
|
|
|
@ -41,6 +41,7 @@ class postgresql::globals (
|
||||||
|
|
||||||
$version = undef,
|
$version = undef,
|
||||||
$postgis_version = undef,
|
$postgis_version = undef,
|
||||||
|
$repo_proxy = undef,
|
||||||
|
|
||||||
$needs_initdb = undef,
|
$needs_initdb = undef,
|
||||||
|
|
||||||
|
@ -70,6 +71,12 @@ class postgresql::globals (
|
||||||
/^5\./ => '8.1',
|
/^5\./ => '8.1',
|
||||||
default => undef,
|
default => undef,
|
||||||
},
|
},
|
||||||
|
default => $::operatingsystemrelease ? {
|
||||||
|
/^7\./ => '9.2',
|
||||||
|
/^6\./ => '8.4',
|
||||||
|
/^5\./ => '8.1',
|
||||||
|
default => undef,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'Debian' => $::operatingsystem ? {
|
'Debian' => $::operatingsystem ? {
|
||||||
'Debian' => $::operatingsystemrelease ? {
|
'Debian' => $::operatingsystemrelease ? {
|
||||||
|
@ -131,7 +138,8 @@ class postgresql::globals (
|
||||||
# Setup of the repo only makes sense globally, so we are doing this here.
|
# Setup of the repo only makes sense globally, so we are doing this here.
|
||||||
if($manage_package_repo) {
|
if($manage_package_repo) {
|
||||||
class { 'postgresql::repo':
|
class { 'postgresql::repo':
|
||||||
version => $globals_version
|
version => $globals_version,
|
||||||
|
proxy => $repo_proxy,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# PRIVATE CLASS: do not use directly
|
# PRIVATE CLASS: do not use directly
|
||||||
class postgresql::repo (
|
class postgresql::repo (
|
||||||
$version = undef
|
$version = undef,
|
||||||
|
$proxy = undef,
|
||||||
) inherits postgresql::params {
|
) inherits postgresql::params {
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'RedHat', 'Linux': {
|
'RedHat', 'Linux': {
|
||||||
|
|
|
@ -23,6 +23,7 @@ class postgresql::repo::yum_postgresql_org inherits postgresql::repo {
|
||||||
enabled => 1,
|
enabled => 1,
|
||||||
gpgcheck => 1,
|
gpgcheck => 1,
|
||||||
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}",
|
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}",
|
||||||
|
proxy => $postgresql::repo::proxy,
|
||||||
}
|
}
|
||||||
|
|
||||||
Yumrepo['yum.postgresql.org'] -> Package<|tag == 'postgresql'|>
|
Yumrepo['yum.postgresql.org'] -> Package<|tag == 'postgresql'|>
|
||||||
|
|
|
@ -1,30 +1,67 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'postgresql::globals', :type => :class do
|
describe 'postgresql::globals', :type => :class do
|
||||||
let :facts do
|
context "on a debian 6" do
|
||||||
{
|
let (:facts) do
|
||||||
:osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Debian',
|
|
||||||
:operatingsystemrelease => '6.0',
|
|
||||||
:lsbdistid => 'Debian',
|
|
||||||
:lsbdistcodename => 'squeeze',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'with no parameters' do
|
|
||||||
it 'should work' do
|
|
||||||
is_expected.to contain_class("postgresql::globals")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'manage_package_repo => true' do
|
|
||||||
let(:params) do
|
|
||||||
{
|
{
|
||||||
:manage_package_repo => true,
|
:osfamily => 'Debian',
|
||||||
|
:operatingsystem => 'Debian',
|
||||||
|
:operatingsystemrelease => '6.0',
|
||||||
|
:lsbdistid => 'Debian',
|
||||||
|
:lsbdistcodename => 'squeeze',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it 'should pull in class postgresql::repo' do
|
|
||||||
is_expected.to contain_class("postgresql::repo")
|
describe 'with no parameters' do
|
||||||
|
it 'should work' do
|
||||||
|
is_expected.to contain_class("postgresql::globals")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'manage_package_repo => true' do
|
||||||
|
let(:params) do
|
||||||
|
{
|
||||||
|
:manage_package_repo => true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it 'should pull in class postgresql::repo' do
|
||||||
|
is_expected.to contain_class("postgresql::repo")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'on redhat family systems' do
|
||||||
|
let (:facts) do
|
||||||
|
{
|
||||||
|
:osfamily => 'RedHat',
|
||||||
|
:operatingsystem => 'RedHat',
|
||||||
|
:operatingsystemrelease => '7.1',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
describe 'with no parameters' do
|
||||||
|
it 'should work' do
|
||||||
|
is_expected.to contain_class("postgresql::globals")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'manage_package_repo on RHEL => true' do
|
||||||
|
let(:params) do
|
||||||
|
{
|
||||||
|
:manage_package_repo => true,
|
||||||
|
:repo_proxy => 'http://proxy-server:8080',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should pull in class postgresql::repo' do
|
||||||
|
is_expected.to contain_class("postgresql::repo")
|
||||||
|
end
|
||||||
|
|
||||||
|
it do
|
||||||
|
should contain_yumrepo('yum.postgresql.org').with(
|
||||||
|
'enabled' => '1',
|
||||||
|
'proxy' => 'http://proxy-server:8080'
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue