Skip to content

Commit c2457e3

Browse files
authored
Merge pull request #567 from GabrielNagy/MODULES-11112/yumrepo-proxy
(MODULES-11112) Add parameter puppet_agent::proxy
2 parents cb6d62f + 304f84f commit c2457e3

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

README.markdown

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
- [`use_alternate_sources`](#use_alternate_sources)
4444
- [`alternate_pe_source`](#alternate_pe_source)
4545
- [`install_dir`](#install_dir)
46+
- [`disable_proxy`](#disable_proxy)
47+
- [`proxy`](#proxy)
4648
- [`install_options`](#install_options)
4749
- [`msi_move_locked_files`](#msi_move_locked_files)
4850
- [`wait_for_pxp_agent_exit`](#wait_for_pxp_agent_exit)
@@ -287,6 +289,20 @@ The directory the puppet agent should be installed to. This is only applicable f
287289
install_dir => 'D:\Program Files\Puppet Labs'
288290
```
289291

292+
##### `disable_proxy`
293+
294+
This setting controls whether or not the Puppet repositories are configured with proxies. Currently this is only supported on RedHat-based OSes.
295+
``` puppet
296+
disable_proxy => true
297+
```
298+
299+
##### `proxy`
300+
301+
This setting specifies the proxy with which to configure the Puppet repos. Currently this is only supported on RedHat-based OSes.
302+
``` puppet
303+
proxy => 'http://myrepo-proxy.example.com'
304+
```
305+
290306
##### `install_options`
291307

292308
An array of additional options to pass when installing puppet-agent. Each option in the array can be either a string or a hash. Each option is automatically quoted when passed to the install command.

manifests/init.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
$alternate_pe_source = undef,
120120
$install_dir = undef,
121121
$disable_proxy = false,
122+
$proxy = undef,
122123
$install_options = [],
123124
$skip_if_unavailable = 'absent',
124125
$msi_move_locked_files = false,

manifests/osfamily/redhat.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
if $::puppet_agent::manage_repo == true {
146146
$_proxy = $::puppet_agent::disable_proxy ? {
147147
true => '_none_',
148-
default => undef,
148+
default => $::puppet_agent::proxy,
149149
}
150150
yumrepo { 'pc_repo':
151151
baseurl => $source,

spec/classes/puppet_agent_osfamily_redhat_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@
201201
is_expected.to contain_yumrepo('pc_repo').with_proxy('_none_')
202202
}
203203
end
204+
describe 'proxy' do
205+
let(:params) {
206+
{
207+
:manage_repo => true,
208+
:package_version => package_version,
209+
:proxy => 'http://myrepo-proxy.example.com',
210+
}
211+
}
212+
it {
213+
is_expected.to contain_yumrepo('pc_repo').with_proxy('http://myrepo-proxy.example.com')
214+
}
215+
end
204216
describe 'skip repo if unavailable' do
205217
let(:params) {
206218
{

0 commit comments

Comments
 (0)