Skip to content

Commit 001dd3a

Browse files
Merge branch 'rfletcher-proxy-options'
2 parents 0d434be + c745922 commit 001dd3a

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

manifests/agent.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
# ['cron_minute'] - What minute to run if puppet_run_style is cron
3636
# ['serialization_format'] - defaults to undef, otherwise it sets the preferred_serialization_format param (currently only msgpack is supported)
3737
# ['serialization_package'] - defaults to undef, if provided, we install this package, otherwise we fall back to the gem from 'serialization_format'
38+
# ['http_proxy_host'] - The hostname of an HTTP proxy to use for agent -> master connections
39+
# ['http_proxy_port'] - The port to use when puppet uses an HTTP proxy
3840
#
3941
# Actions:
4042
# - Install and configures the puppet agent

spec/classes/puppet_agent_spec.rb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,4 +577,56 @@
577577
}
578578
end
579579
end
580+
describe 'puppetagenthttpproxyhost' do
581+
let(:facts) do
582+
{
583+
:osfamily => 'RedHat',
584+
:operatingsystem => 'RedHat',
585+
:kernel => 'Linux'
586+
}
587+
end
588+
context 'with http_proxy_host set' do
589+
let(:params) do
590+
{
591+
:http_proxy_host => 'proxy.example.com',
592+
}
593+
end
594+
595+
it{
596+
should contain_ini_setting('puppetagenthttpproxyhost').with(
597+
:ensure => 'present',
598+
:section => 'agent',
599+
:setting => 'http_proxy_host',
600+
:value => 'proxy.example.com',
601+
:path => '/etc/puppet/puppet.conf'
602+
)
603+
}
604+
end
605+
end
606+
describe 'puppetagenthttpproxyport' do
607+
let(:facts) do
608+
{
609+
:osfamily => 'RedHat',
610+
:operatingsystem => 'RedHat',
611+
:kernel => 'Linux'
612+
}
613+
end
614+
context 'with http_proxy_port set' do
615+
let(:params) do
616+
{
617+
:http_proxy_port => '1234',
618+
}
619+
end
620+
621+
it{
622+
should contain_ini_setting('puppetagenthttpproxyport').with(
623+
:ensure => 'present',
624+
:section => 'agent',
625+
:setting => 'http_proxy_port',
626+
:value => '1234',
627+
:path => '/etc/puppet/puppet.conf'
628+
)
629+
}
630+
end
631+
end
580632
end

0 commit comments

Comments
 (0)