Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reports to be disabled #587

Merged
merged 3 commits into from Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/agent/config.pp
Expand Up @@ -4,7 +4,7 @@
'classfile': value => $::puppet::classfile;
'localconfig': value => '$vardir/localconfig';
'default_schedules': value => false;
'report': value => true;
'report': value => $::puppet::report;
'pluginsync': value => $::puppet::pluginsync;
'masterport': value => $::puppet::port;
'environment': value => $::puppet::environment;
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Expand Up @@ -199,6 +199,8 @@
# $dir_group:: Group of the base puppet directory, used when
# puppet::server is false.
#
# $report:: Send reports to the Puppet Master
#
# == puppet::server parameters
#
# $server:: Should a puppet master be installed as well as the client
Expand Down Expand Up @@ -608,6 +610,7 @@
Variant[String, Array[String]] $client_package = $puppet::params::client_package,
Boolean $agent = $puppet::params::agent,
Boolean $remove_lock = $puppet::params::remove_lock,
Boolean $report = $puppet::params::report,
Variant[String, Boolean] $client_certname = $puppet::params::client_certname,
Optional[String] $puppetmaster = $puppet::params::puppetmaster,
String $systemd_unit_name = $puppet::params::systemd_unit_name,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Expand Up @@ -15,6 +15,7 @@
$splaylimit = '1800'
$runinterval = 1800
$runmode = 'service'
$report = true

# Not defined here as the commands depend on module parameter "dir"
$cron_cmd = undef
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/puppet_agent_config_spec.rb
Expand Up @@ -29,6 +29,7 @@
end

it { should contain_puppet__config__agent('certname').with(facts[:certname]) }
it { should contain_puppet__config__agent('report').with({'value'=>'true'}) }
end

context 'with runmode => cron', :unless => (facts[:osfamily] == 'Archlinux') do
Expand Down Expand Up @@ -79,6 +80,14 @@

it { should_not contain_puppet__config__agent('certname') }
end

context 'with report => false' do
let :pre_condition do
'class { "::puppet": report => false }'
end

it { should contain_puppet__config__agent('report').with({'value'=>'false'}) }
end
end
end
end