From d03afaad018e378d836661386478d219f1693b82 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 10 Oct 2016 09:40:47 -0700 Subject: [PATCH] f inprogress --- Gemfile | 74 +++- Gemfile.lock | 360 ++++++++++++++++++++ manifests/params.pp | 4 +- spec/classes/puppet_agent_prepare_spec.rb | 397 +++++++++++----------- spec/spec_helper.rb | 12 + 5 files changed, 635 insertions(+), 212 deletions(-) create mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile index d0ea7c500..ea66bb37e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,18 +1,68 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' -group :test do - gem 'rake', '~> 10.4' - gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.8' - gem 'rspec', '< 3.2.0' # https://github.com/rspec/rspec-core/issues/1864 - gem 'rspec-puppet', '~> 2.2' - gem 'puppetlabs_spec_helper', '~> 0.10' - gem 'json_pure', '~> 1.8.3' # avoid version incompatible with Puppet 3.8 - gem 'json', '~> 1.8.3' # avoid trying to pull a newer version with Ruby 1.8.7 - gem 'metadata-json-lint', '~> 0.0' - gem 'rspec-puppet-facts', '~> 1.3' +# group :test do +# gem 'rake', '~> 10.4' +# gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.8' +# gem 'rspec', '< 3.2.0' # https://github.com/rspec/rspec-core/issues/1864 +# gem 'rspec-puppet', '~> 2.2' +# gem 'puppetlabs_spec_helper', '~> 0.10' +# gem 'json_pure', '~> 1.8.3' # avoid version incompatible with Puppet 3.8 +# gem 'json', '~> 1.8.3' # avoid trying to pull a newer version with Ruby 1.8.7 +# gem 'metadata-json-lint', '~> 0.0' +# gem 'rspec-puppet-facts', '~> 1.3' +# end + +# group :system_tests do +# gem 'beaker', '~> 2.16' +# gem 'beaker-rspec', '~> 5.1' +# end + + +#This file is generated by ModuleSync, do not edit. + +source ENV['GEM_SOURCE'] || "https://rubygems.org" + +def location_from_env(env, default_location = []) + if location = ENV[env] + if location =~ /^((?:git|https?)[:@][^#]*)#(.*)/ + [{ :git => $1, :branch => $2, :require => false }] + elsif location =~ /^file:\/\/(.*)/ + ['>= 0', { :path => File.expand_path($1), :require => false }] + else + [location, { :require => false }] + end + else + default_location + end end +group :development, :unit_tests do + gem 'metadata-json-lint' + gem 'puppet_facts' + gem 'puppet-blacksmith', '>= 3.4.0' + gem 'puppetlabs_spec_helper', '>= 1.2.1' + gem 'rspec-puppet', '>= 2.3.2' + gem 'rspec-puppet-facts' + gem 'simplecov' + gem 'parallel_tests' + gem 'rubocop', '0.41.2' if RUBY_VERSION < '2.0.0' + gem 'rubocop' if RUBY_VERSION >= '2.0.0' + gem 'rubocop-rspec', '~> 1.6' if RUBY_VERSION >= '2.3.0' + gem 'json_pure', '<= 2.0.1' if RUBY_VERSION < '2.0.0' +end group :system_tests do - gem 'beaker', '~> 2.16' - gem 'beaker-rspec', '~> 5.1' + gem 'beaker', *location_from_env('BEAKER_VERSION', []) if RUBY_VERSION >= '2.3.0' + gem 'beaker', *location_from_env('BEAKER_VERSION', ['< 3']) if RUBY_VERSION < '2.3.0' + gem 'beaker-rspec', *location_from_env('BEAKER_RSPEC_VERSION', ['>= 3.4']) + gem 'serverspec' + gem 'beaker-puppet_install_helper' + gem 'master_manipulator' + gem 'beaker-hostgenerator', *location_from_env('BEAKER_HOSTGENERATOR_VERSION', []) end + +gem 'facter', *location_from_env('FACTER_GEM_VERSION') +gem 'puppet', *location_from_env('PUPPET_VERSION') + +if File.exists? "#{__FILE__}.local" + eval(File.read("#{__FILE__}.local"), binding) +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..fdc3d5f90 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,360 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.2.8) + addressable (2.4.0) + ast (2.3.0) + aws-sdk-v1 (1.66.0) + json (~> 1.4) + nokogiri (>= 1.4.4) + beaker (2.51.0) + aws-sdk-v1 (~> 1.57) + beaker-answers (~> 0.0) + beaker-hiera (~> 0.0) + beaker-hostgenerator + beaker-pe (~> 0.0) + docker-api + fission (~> 0.4) + fog (~> 1.25, < 1.35.0) + fog-google (~> 0.0.9) + google-api-client (~> 0.8, < 0.9.5) + hocon (~> 1.0) + in-parallel (~> 0.1) + inifile (~> 2.0) + json (~> 1.8) + mime-types (~> 2.99) + minitest (~> 5.4) + net-scp (~> 1.2) + net-ssh (~> 2.9) + open_uri_redirections (~> 0.2.1) + rbvmomi (~> 1.8, < 1.9.0) + rsync (~> 1.0.9) + stringify-hash (~> 0.0) + unf (~> 0.1) + beaker-answers (0.11.0) + hocon (~> 1.0) + require_all (~> 1.3.2) + stringify-hash (~> 0.0.0) + beaker-hiera (0.1.1) + stringify-hash (~> 0.0.0) + beaker-hostgenerator (0.8.0) + deep_merge (~> 1.0) + stringify-hash (~> 0.0.0) + beaker-pe (0.12.1) + stringify-hash (~> 0.0.0) + beaker-puppet_install_helper (0.5.0) + beaker (>= 2.0) + beaker-rspec (5.6.0) + beaker (~> 2.0) + rspec + serverspec (~> 2) + specinfra (~> 2) + builder (3.2.2) + deep_merge (1.1.1) + diff-lcs (1.2.5) + docile (1.1.5) + docker-api (1.32.1) + excon (>= 0.38.0) + json + domain_name (0.5.20160826) + unf (>= 0.0.5, < 1.0.0) + excon (0.53.0) + facter (2.4.6) + CFPropertyList (~> 2.2.6) + facterdb (0.3.7) + facter + jgrep + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog (1.34.0) + fog-atmos + fog-aws (>= 0.6.0) + fog-brightbox (~> 0.4) + fog-core (~> 1.32) + fog-dynect (~> 0.0.2) + fog-ecloud (~> 0.1) + fog-google (>= 0.0.2) + fog-json + fog-local + fog-powerdns (>= 0.1.1) + fog-profitbricks + fog-radosgw (>= 0.0.2) + fog-riakcs + fog-sakuracloud (>= 0.0.4) + fog-serverlove + fog-softlayer + fog-storm_on_demand + fog-terremark + fog-vmfusion + fog-voxel + fog-xml (~> 0.1.1) + ipaddress (~> 0.5) + nokogiri (~> 1.5, >= 1.5.11) + fog-atmos (0.1.0) + fog-core + fog-xml + fog-aws (0.12.0) + fog-core (~> 1.38) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-brightbox (0.11.0) + fog-core (~> 1.22) + fog-json + inflecto (~> 0.0.2) + fog-core (1.43.0) + builder + excon (~> 0.49) + formatador (~> 0.2) + fog-dynect (0.0.3) + fog-core + fog-json + fog-xml + fog-ecloud (0.3.0) + fog-core + fog-xml + fog-google (0.0.9) + fog-core + fog-json + fog-xml + fog-json (1.0.2) + fog-core (~> 1.0) + multi_json (~> 1.10) + fog-local (0.3.0) + fog-core (~> 1.27) + fog-powerdns (0.1.1) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + fog-profitbricks (2.0.1) + fog-core (~> 1.42) + fog-json (~> 1.0) + fog-radosgw (0.0.5) + fog-core (>= 1.21.0) + fog-json + fog-xml (>= 0.0.1) + fog-riakcs (0.1.0) + fog-core + fog-json + fog-xml + fog-sakuracloud (1.7.5) + fog-core + fog-json + fog-serverlove (0.1.2) + fog-core + fog-json + fog-softlayer (1.1.4) + fog-core + fog-json + fog-storm_on_demand (0.1.1) + fog-core + fog-json + fog-terremark (0.1.0) + fog-core + fog-xml + fog-vmfusion (0.1.0) + fission + fog-core + fog-voxel (0.1.0) + fog-core + fog-xml + fog-xml (0.1.2) + fog-core + nokogiri (~> 1.5, >= 1.5.11) + formatador (0.2.5) + google-api-client (0.9.4) + addressable (~> 2.3) + googleauth (~> 0.5) + httpclient (~> 2.7) + hurley (~> 0.1) + memoist (~> 0.11) + mime-types (>= 1.6) + representable (~> 2.3.0) + retriable (~> 2.0) + thor (~> 0.19) + googleauth (0.5.1) + faraday (~> 0.9) + jwt (~> 1.4) + logging (~> 2.0) + memoist (~> 0.12) + multi_json (~> 1.11) + os (~> 0.9) + signet (~> 0.7) + hiera (3.2.1) + hocon (1.1.2) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.2.4) + hurley (0.2) + in-parallel (0.1.15) + inflecto (0.0.2) + inifile (2.0.2) + ipaddress (0.8.3) + jgrep (1.4.1) + json + json (1.8.3) + json_pure (1.8.3) + jwt (1.5.6) + little-plugger (1.1.4) + logging (2.1.0) + little-plugger (~> 1.1) + multi_json (~> 1.10) + master_manipulator (1.2.4) + beaker (>= 2.7.0) + multi_json + mcollective-client (2.9.0) + json + stomp + systemu + memoist (0.15.0) + metaclass (0.0.4) + metadata-json-lint (0.0.11) + json + spdx-licenses (~> 1.0) + mime-types (2.99.3) + mini_portile2 (2.1.0) + minitest (5.9.1) + mocha (1.1.0) + metaclass (~> 0.0.1) + multi_json (1.12.1) + multipart-post (2.0.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.4) + net-telnet (0.1.1) + netrc (0.11.0) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + open_uri_redirections (0.2.1) + os (0.9.6) + parallel (1.9.0) + parallel_tests (2.9.0) + parallel + parser (2.3.1.4) + ast (~> 2.2) + powerpack (0.1.1) + puppet (4.7.0) + CFPropertyList (~> 2.2.6) + facter (> 2.0, < 4) + hiera (>= 2.0, < 4) + json_pure (~> 1.8) + puppet-blacksmith (3.4.0) + puppet (>= 2.7.16) + rest-client (~> 1.8.0) + puppet-lint (2.0.2) + puppet-syntax (2.1.0) + rake + puppet_facts (0.2.1) + puppetlabs_spec_helper (1.2.2) + mocha (~> 1.0) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) + rainbow (2.1.0) + rake (11.3.0) + rbvmomi (1.8.2) + builder + nokogiri (>= 1.4.1) + trollop + representable (2.3.0) + uber (~> 0.0.7) + require_all (1.3.3) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + retriable (2.1.0) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-puppet (2.4.0) + rspec + rspec-puppet-facts (1.7.0) + facter + facterdb (>= 0.3.0) + json + mcollective-client + puppet + rspec-support (3.5.0) + rsync (1.0.9) + rubocop (0.43.0) + parser (>= 2.3.1.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + rubocop-rspec (1.7.0) + rubocop (>= 0.42.0) + ruby-progressbar (1.8.1) + serverspec (2.36.1) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.53) + sfl (2.3) + signet (0.7.3) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (~> 1.5) + multi_json (~> 1.10) + simplecov (0.12.0) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + spdx-licenses (1.1.0) + specinfra (2.63.2) + net-scp + net-ssh (>= 2.7, < 4.0) + net-telnet + sfl + stomp (1.4.3) + stringify-hash (0.0.2) + systemu (2.6.5) + thor (0.19.1) + trollop (2.1.2) + uber (0.0.15) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.2) + unicode-display_width (1.1.1) + +PLATFORMS + ruby + +DEPENDENCIES + beaker + beaker-hostgenerator + beaker-puppet_install_helper + beaker-rspec (>= 3.4) + facter + master_manipulator + metadata-json-lint + parallel_tests + puppet (= 4.7.0) + puppet-blacksmith (>= 3.4.0) + puppet_facts + puppetlabs_spec_helper (>= 1.2.1) + rspec-puppet (>= 2.3.2) + rspec-puppet-facts + rubocop + rubocop-rspec (~> 1.6) + serverspec + simplecov + +BUNDLED WITH + 1.12.5 diff --git a/manifests/params.pp b/manifests/params.pp index 344a526e1..a03e9542d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -104,7 +104,7 @@ $mco_server = "${mco_dir}/server.cfg" $mco_client = "${mco_dir}/client.cfg" - $mco_libdir = "${mco_install}/plugins" + #$mco_libdir = "${mco_install}/plugins" $mco_plugins = "${mco_dir}/facts.yaml" - $mco_log = "${logdir}/mcollective.log" + #$mco_log = "${logdir}/mcollective.log" } diff --git a/spec/classes/puppet_agent_prepare_spec.rb b/spec/classes/puppet_agent_prepare_spec.rb index 3c6067ef6..0c5668ce7 100644 --- a/spec/classes/puppet_agent_prepare_spec.rb +++ b/spec/classes/puppet_agent_prepare_spec.rb @@ -19,6 +19,7 @@ facts = { + :is_pe => true, :operatingsystem => os, :operatingsystemmajrelease => osmajor, :architecture => 'bar', @@ -32,189 +33,189 @@ context "on #{osfamily}" do let(:facts) { facts } - context "when SSL paths do not exist" do - let(:facts) { - facts.merge({ :puppet_sslpaths => { - 'privatedir' => { 'path_exists' => false }, - 'privatekeydir' => { 'path_exists' => false }, - 'publickeydir' => { 'path_exists' => false }, - 'certdir' => { 'path_exists' => false }, - 'requestdir' => { 'path_exists' => false }, - 'hostcrl' => { 'path_exists' => false } - }}) - } - # We don't perform SSL migration post-4 upgrade - if Puppet.version < "4.0.0" - ['certificate_requests', 'certs', 'private', 'private_keys', 'public_keys', 'crl.pem'].each do |path| - it { is_expected.to_not contain_file("/etc/puppetlabs/puppet/ssl/#{path}") } - end - end - end - - [ - MCO_CFG, - {:server => '/etc/mcollective/server.cfg'}, - {:client => '/etc/mcollective/client.cfg'} - ].each do |mco_config| - [ - {'libdir' => 'libdir', 'plugin.yaml' => 'plugins'}, - {'libdir' => "libdir:#{MCO_LIBDIR}", 'plugin.yaml' => "plugins:#{MCO_PLUGIN_YAML}"}, - {'libdir' => nil, 'plugin.yaml' => nil}, - nil - ].each do |mco_settings| - context "with mco_config = #{mco_config} and mco_settings = #{mco_settings}" do - let(:facts) { - facts.merge({ - :mco_server_config => mco_config[:server], - :mco_client_config => mco_config[:client], - :mco_server_settings => mco_settings, - :mco_client_settings => mco_settings, - }) - } - - # We don't perform MCO migration post-4 upgrade - if Puppet.version < "4.0.0" - it { is_expected.to contain_file('/etc/puppetlabs/mcollective').with_ensure('directory') } - - mco_config.each do |node, cfg| - if cfg - it { is_expected.to contain_file(MCO_CFG[node]).with({ - 'ensure' => 'file', - 'source' => cfg, - }) } - - if mco_settings && mco_settings['libdir'] && !mco_settings['libdir'].include?(MCO_LIBDIR) - it { is_expected.to contain_ini_setting("#{node}/libdir").with({ - 'section' => '', - 'setting' => 'libdir', - 'path' => MCO_CFG[node], - 'value' => "#{MCO_LIBDIR}:#{mco_settings['libdir']}", - }).that_requires("File[#{MCO_CFG[node]}]") } - else - it { is_expected.to_not contain_ini_setting("#{node}/libdir") } - end - - if mco_settings && mco_settings['plugin.yaml'] && !mco_settings['plugin.yaml'].include?(MCO_PLUGIN_YAML) - it { is_expected.to contain_ini_setting("#{node}/plugin.yaml").with({ - 'section' => '', - 'setting' => 'plugin.yaml', - 'path' => MCO_CFG[node], - 'value' => "#{mco_settings['plugin.yaml']}:#{MCO_PLUGIN_YAML}", - }).that_requires("File[#{MCO_CFG[node]}]") } - else - it { is_expected.to_not contain_ini_setting("#{node}/plugin.yaml") } - end - - it { is_expected.to contain_ini_setting("#{node}/logfile").with({ - 'section' => '', - 'setting' => 'logfile', - 'path' => MCO_CFG[node], - 'value' => MCO_LOGFILE, - }).that_requires("File[#{MCO_CFG[node]}]") } - else - it { is_expected.to_not contain_file(MCO_CFG[node]) } - end - end - end - end - end - end - - # We don't perform file migration post-4 upgrade - if Puppet.version < "4.0.0" - ['/etc/puppetlabs', '/etc/puppetlabs/puppet'].each do |dir| - it { is_expected.to contain_file(dir).with_ensure('directory') } - end - - it { is_expected.to contain_file('/etc/puppetlabs/puppet/puppet.conf').with({ - 'ensure' => 'file', - 'source' => '/dev/null/puppet.conf', - }) } - - it { is_expected.to contain_file('/etc/puppetlabs/puppet/ssl').with({ - 'ensure' => 'directory', - 'source' => '/dev/null/ssl', - 'backup' => 'false', - 'recurse' => 'false', - }) } - - ['certificate_requests', 'certs', 'private', 'private_keys', 'public_keys'].each do |dir| - it { is_expected.to contain_file("/etc/puppetlabs/puppet/ssl/#{dir}").with({ - 'ensure' => 'directory', - 'source' => "/dev/null/ssl/#{dir}", - 'backup' => 'false', - 'recurse' => 'true', - }) } - end - - it { is_expected.to contain_file('/etc/puppetlabs/puppet/ssl/crl.pem').with({ - 'ensure' => 'file', - 'source' => '/dev/null/ssl/crl.pem', - 'backup' => 'false', - }) } - end + # context "when SSL paths do not exist" do + # let(:facts) { + # facts.merge({ :puppet_sslpaths => { + # 'privatedir' => { 'path_exists' => false }, + # 'privatekeydir' => { 'path_exists' => false }, + # 'publickeydir' => { 'path_exists' => false }, + # 'certdir' => { 'path_exists' => false }, + # 'requestdir' => { 'path_exists' => false }, + # 'hostcrl' => { 'path_exists' => false } + # }}) + # } + # # We don't perform SSL migration post-4 upgrade + # if Puppet.version < "4.0.0" + # ['certificate_requests', 'certs', 'private', 'private_keys', 'public_keys', 'crl.pem'].each do |path| + # it { is_expected.to_not contain_file("/etc/puppetlabs/puppet/ssl/#{path}") } + # end + # end + # end + + # [ + # MCO_CFG, + # {:server => '/etc/mcollective/server.cfg'}, + # {:client => '/etc/mcollective/client.cfg'} + # ].each do |mco_config| + # [ + # {'libdir' => 'libdir', 'plugin.yaml' => 'plugins'}, + # {'libdir' => "libdir:#{MCO_LIBDIR}", 'plugin.yaml' => "plugins:#{MCO_PLUGIN_YAML}"}, + # {'libdir' => nil, 'plugin.yaml' => nil}, + # nil + # ].each do |mco_settings| + # context "with mco_config = #{mco_config} and mco_settings = #{mco_settings}" do + # let(:facts) { + # facts.merge({ + # :mco_server_config => mco_config[:server], + # :mco_client_config => mco_config[:client], + # :mco_server_settings => mco_settings, + # :mco_client_settings => mco_settings, + # }) + # } + + # # We don't perform MCO migration post-4 upgrade + # if Puppet.version < "4.0.0" + # it { is_expected.to contain_file('/etc/puppetlabs/mcollective').with_ensure('directory') } + + # mco_config.each do |node, cfg| + # if cfg + # it { is_expected.to contain_file(MCO_CFG[node]).with({ + # 'ensure' => 'file', + # 'source' => cfg, + # }) } + + # if mco_settings && mco_settings['libdir'] && !mco_settings['libdir'].include?(MCO_LIBDIR) + # it { is_expected.to contain_ini_setting("#{node}/libdir").with({ + # 'section' => '', + # 'setting' => 'libdir', + # 'path' => MCO_CFG[node], + # 'value' => "#{MCO_LIBDIR}:#{mco_settings['libdir']}", + # }).that_requires("File[#{MCO_CFG[node]}]") } + # else + # it { is_expected.to_not contain_ini_setting("#{node}/libdir") } + # end + + # if mco_settings && mco_settings['plugin.yaml'] && !mco_settings['plugin.yaml'].include?(MCO_PLUGIN_YAML) + # it { is_expected.to contain_ini_setting("#{node}/plugin.yaml").with({ + # 'section' => '', + # 'setting' => 'plugin.yaml', + # 'path' => MCO_CFG[node], + # 'value' => "#{mco_settings['plugin.yaml']}:#{MCO_PLUGIN_YAML}", + # }).that_requires("File[#{MCO_CFG[node]}]") } + # else + # it { is_expected.to_not contain_ini_setting("#{node}/plugin.yaml") } + # end + + # it { is_expected.to contain_ini_setting("#{node}/logfile").with({ + # 'section' => '', + # 'setting' => 'logfile', + # 'path' => MCO_CFG[node], + # 'value' => MCO_LOGFILE, + # }).that_requires("File[#{MCO_CFG[node]}]") } + # else + # it { is_expected.to_not contain_file(MCO_CFG[node]) } + # end + # end + # end + # end + # end + # end + + # # We don't perform file migration post-4 upgrade + # if Puppet.version < "4.0.0" + # ['/etc/puppetlabs', '/etc/puppetlabs/puppet'].each do |dir| + # it { is_expected.to contain_file(dir).with_ensure('directory') } + # end + + # it { is_expected.to contain_file('/etc/puppetlabs/puppet/puppet.conf').with({ + # 'ensure' => 'file', + # 'source' => '/dev/null/puppet.conf', + # }) } + + # it { is_expected.to contain_file('/etc/puppetlabs/puppet/ssl').with({ + # 'ensure' => 'directory', + # 'source' => '/dev/null/ssl', + # 'backup' => 'false', + # 'recurse' => 'false', + # }) } + + # ['certificate_requests', 'certs', 'private', 'private_keys', 'public_keys'].each do |dir| + # it { is_expected.to contain_file("/etc/puppetlabs/puppet/ssl/#{dir}").with({ + # 'ensure' => 'directory', + # 'source' => "/dev/null/ssl/#{dir}", + # 'backup' => 'false', + # 'recurse' => 'true', + # }) } + # end + + # it { is_expected.to contain_file('/etc/puppetlabs/puppet/ssl/crl.pem').with({ + # 'ensure' => 'file', + # 'source' => '/dev/null/ssl/crl.pem', + # 'backup' => 'false', + # }) } + # end ['', 'agent', 'main', 'master'].each do |section| ['allow_variables_with_dashes', - 'async_storeconfigs', - 'binder', - 'catalog_format', - 'certdnsnames', - 'certificate_expire_warning', - 'couchdb_url', - 'dbadapter', - 'dbconnections', - 'dblocation', - 'dbmigrate', - 'dbname', - 'dbpassword', - 'dbport', - 'dbserver', - 'dbsocket', - 'dbuser', - 'dynamicfacts', - 'http_compression', - 'httplog', - 'ignoreimport', - 'immutable_node_data', - 'inventory_port', - 'inventory_server', - 'inventory_terminus', - 'legacy_query_parameter_serialization', - 'listen', - 'localconfig', - 'manifestdir', - 'masterlog', - 'parser', - 'preview_outputdir', - 'puppetport', - 'queue_source', - 'queue_type', - 'rails_loglevel', - 'railslog', - 'report_serialization_format', - 'reportfrom', - 'rrddir', - 'rrdinterval', - 'sendmail', - 'smtphelo', - 'smtpport', - 'smtpserver', - 'ssldir', - 'stringify_facts', - 'tagmap', - 'templatedir', - 'thin_storeconfigs', - 'trusted_node_data', - 'zlib', - 'config_version', - 'manifest', - 'modulepath', - 'disable_warnings', - 'vardir', - 'rundir', - 'libdir', - 'confdir', + # 'async_storeconfigs', + # 'binder', + # 'catalog_format', + # 'certdnsnames', + # 'certificate_expire_warning', + # 'couchdb_url', + # 'dbadapter', + # 'dbconnections', + # 'dblocation', + # 'dbmigrate', + # 'dbname', + # 'dbpassword', + # 'dbport', + # 'dbserver', + # 'dbsocket', + # 'dbuser', + # 'dynamicfacts', + # 'http_compression', + # 'httplog', + # 'ignoreimport', + # 'immutable_node_data', + # 'inventory_port', + # 'inventory_server', + # 'inventory_terminus', + # 'legacy_query_parameter_serialization', + # 'listen', + # 'localconfig', + # 'manifestdir', + # 'masterlog', + # 'parser', + # 'preview_outputdir', + # 'puppetport', + # 'queue_source', + # 'queue_type', + # 'rails_loglevel', + # 'railslog', + # 'report_serialization_format', + # 'reportfrom', + # 'rrddir', + # 'rrdinterval', + # 'sendmail', + # 'smtphelo', + # 'smtpport', + # 'smtpserver', + # 'ssldir', + # 'stringify_facts', + # 'tagmap', + # 'templatedir', + # 'thin_storeconfigs', + # 'trusted_node_data', + # 'zlib', + # 'config_version', + # 'manifest', + # 'modulepath', + # 'disable_warnings', + # 'vardir', + # 'rundir', + # 'libdir', + # 'confdir', 'classfile'].each do |setting| if Puppet.version >= '4.0.0' it { is_expected.not_to contain_ini_setting("#{section}/#{setting}") } @@ -223,30 +224,30 @@ end end - if Puppet.version < '4.0.0' - it { is_expected.to contain_ini_setting("#{section}/pluginsync").with_ensure('absent') } - else - context 'upgrading to puppet-agent < 1.4.0' do - let(:params) {{ :package_version => '1.3.0' }} + # if Puppet.version < '4.0.0' + # it { is_expected.to contain_ini_setting("#{section}/pluginsync").with_ensure('absent') } + # else + # context 'upgrading to puppet-agent < 1.4.0' do + # let(:params) {{ :package_version => '1.3.0' }} - it { is_expected.not_to contain_ini_setting("#{section}/pluginsync") } - end + # it { is_expected.not_to contain_ini_setting("#{section}/pluginsync") } + # end - context 'upgrading to puppet-agent >= 1.4.0' do - let(:params) {{ :package_version => '1.4.0' }} + # context 'upgrading to puppet-agent >= 1.4.0' do + # let(:params) {{ :package_version => '1.4.0' }} - it { is_expected.to contain_ini_setting("#{section}/pluginsync").with_ensure('absent') } - end - end + # it { is_expected.to contain_ini_setting("#{section}/pluginsync").with_ensure('absent') } + # end + # end end - if Puppet.version >= "4.0.0" - it { is_expected.not_to contain_class("puppet_agent::prepare::ssl") } - it { is_expected.not_to contain_class("puppet_agent::prepare::mco_client_config") } - end + # if Puppet.version >= "4.0.0" + # it { is_expected.not_to contain_class("puppet_agent::prepare::ssl") } + # it { is_expected.not_to contain_class("puppet_agent::prepare::mco_client_config") } + # end - it { is_expected.to contain_class("puppet_agent::prepare::puppet_config") } - it { is_expected.to contain_class("puppet_agent::osfamily::#{facts[:osfamily]}") } + # it { is_expected.to contain_class("puppet_agent::prepare::puppet_config") } + # it { is_expected.to contain_class("puppet_agent::osfamily::#{facts[:osfamily]}") } end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 56299d041..0d6bb9230 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,7 +4,19 @@ RSpec.configure do |c| + c.strict_variables = false c.default_facts = { + :puppet_stringify_facts => false, + :aio_agent_version => nil, + :platform_tag => nil, + :macosx_productname => nil, + :maxosx_productversion_major => nil, + :is_pe => nil, + :puppetversion => nil, + :operatingsystem => nil, + :kernelmajversion => nil, + :servername => nil, + :puppet_ssldir => '/dev/null/ssl', :puppet_config => '/dev/null/puppet.conf', :puppet_sslpaths => {