From 193b9592e48433dfb09c361ad156ac1b8fc34f62 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Mon, 10 Oct 2016 03:33:10 +1000 Subject: [PATCH 1/8] Update changelog (#118) --- CHANGELOG.md | 18 ++++++++++++++++++ Rakefile | 2 +- metadata.json | 2 +- spec/spec_helper.rb | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b469237..4f95e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +##2016-10-10 - Pete Brown 2.3.0-alpha +###Summary +Numerous bugfixes. +Feature: Configure agents using SRV records @aaron-miller + +####Bugfixes +Fix puppetserver should connect to non SSL puppetdb via http not https @divansantana +Update metadata.json to allow use of zack-r10k version 3.2.0 @rpkish +Define relationship between sysconfig and service in agent @toepi +Deploy puppetdb ssl certs when ssl is enabled @divansantana +Fix r10k manage_ruby_dependency error @divansantana +Fix could not find init script in some cases @divansantana +Support for strict_variables mode @tequeter +define relationship between vhost an package puppetmaster-passenger @toepi +distinguish between Debian and Ubuntu for puppetmaster-passenger setup @toepi +Add support for splay and splaylimit parameters in puppet.conf @paulseward +Fix syntax error on readme @jordigg + ##2016-02-11 - Pete Brown 2.2.1 ###Summary diff --git a/Rakefile b/Rakefile index f90cc02..f4b2fba 100644 --- a/Rakefile +++ b/Rakefile @@ -77,4 +77,4 @@ if RUBY_VERSION >= "2.1.0" then fail "Unable to find a CHANGELOG.md entry for the #{v} release." end end -end \ No newline at end of file +end diff --git a/metadata.json b/metadata.json index 82578d4..71f2085 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "abstractit-puppet", - "version": "2.2.1", + "version": "2.3.0-alpha", "author": "Abstract IT", "license": "Apache-2.0", "summary": "Manage Puppet agent, master, modules and hiera with Puppet", diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 548256c..ddc4d06 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,4 +24,4 @@ end end -at_exit { RSpec::Puppet::Coverage.report! } \ No newline at end of file +at_exit { RSpec::Puppet::Coverage.report! } From 9af2396f5bf3fc403f83e1f2f1876f48af2b9f69 Mon Sep 17 00:00:00 2001 From: chrisowensboston Date: Tue, 11 Oct 2016 08:08:27 -0400 Subject: [PATCH 2/8] Bug fixes plus (#117) * Various tweaks and changes described in CHANGELOG.md * Further bug fixes per changelog * Forcing push to trigger travis ci * Updated Gemfile to limit json_pure version to <2.0.2 when ruby is < 2.0 * Update changelog (#118) * Various tweaks and changes described in CHANGELOG.md * Further bug fixes per changelog * Forcing push to trigger travis ci * Updated Gemfile to limit json_pure version to <2.0.2 when ruby is < 2.0 --- .fixtures.yml | 2 +- .travis.yml | 3 + CHANGELOG.md | 8 ++ Gemfile | 4 + Gemfile.lock | 91 +++++++++++----------- manifests/init.pp | 6 +- manifests/profile/master.pp | 8 ++ manifests/repo.pp | 2 +- spec/classes/puppet_agent_spec.rb | 48 +++++++++--- spec/classes/puppet_profile_master_spec.rb | 22 +++++- 10 files changed, 130 insertions(+), 64 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 1de78a2..7015344 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -5,7 +5,7 @@ fixtures: ref: "1.4.1" concat: repo: "puppetlabs/concat" - ref: "1.2.0" + ref: "'>= 1.2.2 < 2.0.0'" stdlib: repo: "puppetlabs/stdlib" ref: "4.6.0" diff --git a/.travis.yml b/.travis.yml index f033fe8..8476515 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,9 @@ matrix: env: PUPPET_GEM_VERSION="3.8.5" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 1.3" FUTURE_PARSER="yes" - rvm: 2.1.7 env: PUPPET_GEM_VERSION="4.3.2" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.0" + - rvm: 2.2.0 + env: PUPPET_GEM_VERSION="4.7.0" FACTER_GEM_VERSION="~> 2.4.6" HIERA_GEM_VERSION="~> 3.2.1" + notifications: slack: secure: EwJDWYpcaMh5Ebb4EbsVu+nc1QPff/OTT0aYyExl5i7e8YFKUAL6oTNtupo3s/RO1CUBUOcKGvYUmbhuTxo1o/MfKNFviR8xaYNS2sktZ0961jpd5JtLYxaZd91JKLb2ZrMuAckejM17+lMxivu8+PKZnuF7S78DHNLDLVJkBrY= diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f95e6a..bbe0508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ###Summary Numerous bugfixes. Feature: Configure agents using SRV records @aaron-miller +Feature: Added parameter manage_dbserver to profiles/master @chrisowensboston ####Bugfixes Fix puppetserver should connect to non SSL puppetdb via http not https @divansantana @@ -15,6 +16,13 @@ define relationship between vhost an package puppetmaster-passenger @toepi distinguish between Debian and Ubuntu for puppetmaster-passenger setup @toepi Add support for splay and splaylimit parameters in puppet.conf @paulseward Fix syntax error on readme @jordigg +in manifests/repo.pp added include ::puppet, to fix unknown variable puppet::manage_repos @chrisowensboston +in manifests/init.pp added "+ 0" after calls to fqdn_rand, to force conversion to integer. @chrisowensboston +in spec/classes/puppet_agent_spec.rb, Changed tests for interpolated minute values to accommodate different versions of fqdn_rand using different entropy sources. Changed host name from "testy" to "testy2" because "testy" happened to give a 0 using fqdn_rand(14) +In .fixtures.yml, changed puppetlabs/concat version requirement from '1.2.0' to '>= 1.2.2 < 2.0.0', to fix "uknown variable ::is_pe" bug @chrisowensboston +in Gemfile, forced json_pure to be < 2.0.1 when ruby < 2.0 @chrisowensboston +in .travis.yml, added a line for rvm 2.2.0, puppet gem 4.7.0, facter gem 2.4.6, hiera gem 3.2.1 @chrisowensboston + ##2016-02-11 - Pete Brown 2.2.1 ###Summary diff --git a/Gemfile b/Gemfile index b3097be..cd502ee 100644 --- a/Gemfile +++ b/Gemfile @@ -54,6 +54,10 @@ end # gem 'beaker-puppet_install_helper', :require => false # end +# puppet requires json_pure; json_pure > 2.0.1 requires Ruby 2 +# so force the older json_pure in the case of older ruby +gem 'json_pure', '< 2.0.2', :require => false, :platforms => [:ruby_18, :ruby_19] + if puppetversion = ENV['PUPPET_GEM_VERSION'] gem 'puppet', puppetversion, :require => false else diff --git a/Gemfile.lock b/Gemfile.lock index 5d90863..b8d4876 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,36 @@ GIT remote: https://github.com/puppetlabs/puppetlabs_spec_helper - revision: ad39768d69f005c414da1ee9f12a0d350f8b57a3 + revision: 6c8aa5b921f96e860b0f5f92dde13647572122ff specs: - puppetlabs_spec_helper (1.0.1) - mocha - puppet-lint - puppet-syntax - rake - rspec-puppet + puppetlabs_spec_helper (1.2.2) + mocha (~> 1.0) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) GEM remote: https://rubygems.org/ specs: CFPropertyList (2.2.8) addressable (2.4.0) - backports (3.6.7) + backports (3.6.8) coderay (1.0.9) diff-lcs (1.2.5) docile (1.1.5) - domain_name (0.5.25) + domain_name (0.5.20160826) unf (>= 0.0.5, < 1.0.0) - ethon (0.8.1) + ethon (0.9.1) ffi (>= 1.3.0) facter (2.4.6) CFPropertyList (~> 2.2.6) - facterdb (0.3.1) + facterdb (0.3.6) facter jgrep - json faraday (0.9.2) multipart-post (>= 1.2, < 3) faraday_middleware (0.10.0) faraday (>= 0.7.4, < 0.10) - ffi (1.9.10) + ffi (1.9.14) gh (0.14.0) addressable backports @@ -40,12 +38,11 @@ GEM multi_json (~> 1.0) net-http-persistent (>= 2.7) net-http-pipeline - hiera (3.0.6) - json_pure + hiera (3.2.1) highline (1.7.8) http-cookie (1.0.2) domain_name (~> 0.5) - jgrep (1.4.0) + jgrep (1.4.1) json json (1.8.3) json_pure (1.8.3) @@ -56,10 +53,10 @@ GEM json spdx-licenses (~> 1.0) method_source (0.8.2) - mime-types (2.99) + mime-types (2.99.3) mocha (1.1.0) metaclass (~> 0.0.1) - multi_json (1.11.2) + multi_json (1.12.1) multipart-post (2.0.0) net-http-persistent (2.9.4) net-http-pipeline (1.0.1) @@ -68,36 +65,37 @@ GEM coderay (~> 1.0.5) method_source (~> 0.7) slop (>= 2.4.3, < 3) - puppet (4.3.2) + puppet (4.7.0) + CFPropertyList (~> 2.2.6) facter (> 2.0, < 4) hiera (>= 2.0, < 4) - json_pure - puppet-blacksmith (3.3.1) + json_pure (~> 1.8) + puppet-blacksmith (3.4.0) puppet (>= 2.7.16) - rest-client - puppet-lint (1.1.0) - puppet-lint-absolute_classname-check (0.1.3) - puppet-lint (~> 1.0) - puppet-lint-empty_string-check (0.2.1) - puppet-lint (~> 1.0) - puppet-lint-leading_zero-check (0.1.0) - puppet-lint (~> 1.0) - puppet-lint-roles_and_profiles-check (0.1.0) - puppet-lint (~> 1.0) - puppet-lint-spaceship_operator_without_tag-check (0.1.0) - puppet-lint (~> 1.0) - puppet-lint-undef_in_function-check (0.1.0) - puppet-lint (~> 1.0) - puppet-lint-unquoted_string-check (0.2.5) - puppet-lint (~> 1.0) - puppet-lint-variable_contains_upcase (1.0.0) - puppet-lint (~> 1.0) + rest-client (~> 1.8.0) + puppet-lint (2.0.2) + puppet-lint-absolute_classname-check (0.2.4) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-empty_string-check (0.2.2) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-leading_zero-check (0.1.1) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-roles_and_profiles-check (0.1.1) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-spaceship_operator_without_tag-check (0.1.1) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-undef_in_function-check (0.2.1) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-unquoted_string-check (0.3.0) + puppet-lint (>= 1.0, < 3.0) + puppet-lint-variable_contains_upcase (1.0.2) + puppet-lint (>= 1.0, < 3.0) puppet-syntax (2.1.0) rake pusher-client (0.6.2) json websocket (~> 1.0) - rake (10.5.0) + rake (11.3.0) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) @@ -121,14 +119,13 @@ GEM json puppet rspec-support (3.1.2) - simplecov (0.11.1) + simplecov (0.12.0) docile (~> 1.1.0) - json (~> 1.8) + json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slop (2.4.4) - spdx-licenses (1.0.0) - json + spdx-licenses (1.1.0) travis (1.8.2) backports faraday (~> 0.9) @@ -144,8 +141,8 @@ GEM ethon (>= 0.8.0) unf (0.1.4) unf_ext - unf_ext (0.0.7.1) - websocket (1.2.2) + unf_ext (0.0.7.2) + websocket (1.2.3) PLATFORMS ruby @@ -177,4 +174,4 @@ DEPENDENCIES travis-lint BUNDLED WITH - 1.11.2 + 1.13.1 diff --git a/manifests/init.pp b/manifests/init.pp index ce64ffd..feeb011 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -180,16 +180,16 @@ case $agent_cron_min { #provide a co 'two_times_an_hour': { - $min=fqdn_rand(29) + $min=fqdn_rand(29) + 0 # fqdn_rand used to return a string prior to 4.0? $min_2=$min + 30 $agent_cron_min_interpolated = [ $min, $min_2 ] } 'four_times_an_hour': { - $min=fqdn_rand(14) + $min=fqdn_rand(14) + 0 # fqdn_rand used to return a string prior to 4.0? $min_2=$min + 15 $min_3=$min + 30 $min_4=$min + 45 - $agent_cron_min_interpolated = [$min, $min_2, $min_3, $min_4 ] + $agent_cron_min_interpolated = [ $min, $min_2, $min_3, $min_4 ] } default: { #the variable is populated. feed that to the cronjob diff --git a/manifests/profile/master.pp b/manifests/profile/master.pp index b773122..b2f694a 100644 --- a/manifests/profile/master.pp +++ b/manifests/profile/master.pp @@ -3,6 +3,7 @@ # If you want PuppetDB on a separate node please use the puppet::profile::puppetdb class # This and the puppet::profile::puppetdb class are mutually exclusive and will not work on the same node. # + # @param autosign [Boolean] Default: false # Whether or not to enable autosign. # @param autosign_domains [Array] Default: empty @@ -74,6 +75,11 @@ # @param puppetdb [Boolean] Default: false # Whether to setup PuppetDB. # Set this to configure a PuppetDB server on this node. +# @param puppetdb_manage_dbserver [Boolean] Default: true +# Whether to tell PuppetDB to also manage the Postgresql server. +# Set this to false if you are independently configuring a +# Postgresql server, e.g., because you are using it for other +# databases in addition to pupept. # @param puppetdb_server [String] Default: undef # The dns name or ip of the puppetdb server. # Set this to specify which PuppetDB server to connect to. @@ -139,6 +145,7 @@ $server_type = undef, $server_version = 'installed', $puppetdb = false, + $puppetdb_manage_dbserver = true, $puppetdb_server = undef, $puppetdb_version = 'installed', $puppetdb_node_purge_ttl = '0s', @@ -212,6 +219,7 @@ disable_ssl => $puppetdb_disable_ssl, listen_address => $puppetdb_listen_address, ssl_listen_address => $puppetdb_ssl_listen_address, + manage_dbserver => $puppetdb_manage_dbserver, node_ttl => $puppetdb_node_ttl, node_purge_ttl => $puppetdb_node_purge_ttl, report_ttl => $report_ttl, diff --git a/manifests/repo.pp b/manifests/repo.pp index 45de751..8dd6ce5 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,7 +1,7 @@ # Include the proper subclass. class puppet::repo { - + include ::puppet if $::puppet::manage_repos { case $::puppet::manage_repo_method { default,'files': { diff --git a/spec/classes/puppet_agent_spec.rb b/spec/classes/puppet_agent_spec.rb index 6157365..74c79d1 100644 --- a/spec/classes/puppet_agent_spec.rb +++ b/spec/classes/puppet_agent_spec.rb @@ -108,8 +108,10 @@ end end end - context 'when $::puppet::enable_mechanism is cron' do + context 'when $::puppet::enable_mechanism is cron and host is testy.hosty.com ' do let(:pre_condition){"class{'::puppet': enabled => true, enable_mechanism => 'cron', }"} + let(:facts) {facts.merge({:fqdn => 'testy2.hosty.com',})} + it'should contain the puppet service, in a disabled state' do should contain_service('puppet').with({ :name=>"puppet", @@ -130,23 +132,35 @@ }) end end - it 'should enable the cronjob, running puppet twice an hour' do + it 'should enable the cronjob, running puppet twice an hour, not at :00 and :30' do should contain_cron('run_puppet_agent').with({ :ensure=>"present", :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", :special=>"absent", - :minute=>["3", 33], + :hour=>"*" + }) + should_not contain_cron('run_puppet_agent').with({ + :ensure=>"present", + :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", + :special=>"absent", + :minute=>[0, 30], :hour=>"*" }) end context 'when agent_cron_min has the value of two_times_an_hour' do let(:pre_condition){"class{'::puppet': enabled => true, enable_mechanism => 'cron', agent_cron_min => 'two_times_an_hour'}"} - it 'should enable the cronjob, running puppet twice an hour' do + it 'should enable the cronjob, running puppet twice an hour not at :00 and :30' do should contain_cron('run_puppet_agent').with({ :ensure=>"present", :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", :special=>"absent", - :minute=>["3", 33], + :hour=>"*" + }) + should_not contain_cron('run_puppet_agent').with({ + :ensure=>"present", + :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", + :special=>"absent", + :minute=>[0, 30], :hour=>"*" }) end @@ -173,12 +187,18 @@ end context 'when agent_cron_min has the value of four_times_an_hour' do let(:pre_condition){"class{'::puppet': enabled => true, enable_mechanism => 'cron', agent_cron_min => 'four_times_an_hour'}"} - it 'should enable the cronjob, running puppet four times an hour' do + it 'should enable the cronjob, running puppet four times an hour, not at :0, :15, :30:, :45' do should contain_cron('run_puppet_agent').with({ :ensure=>"present", :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", :special=>"absent", - :minute=>["3", 18, 33, 48], + :hour=>"*" + }) + should_not contain_cron('run_puppet_agent').with({ + :ensure=>"present", + :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", + :special=>"absent", + :minute=>[0, 15, 30, 45], :hour=>"*" }) end @@ -237,12 +257,18 @@ end context 'when agent_cron_hour has the value of \'20\'' do let(:pre_condition){"class{'::puppet': enabled => true, enable_mechanism => 'cron', agent_cron_hour => '20'}"} - it 'should enable the cronjob, running puppet twice an hour' do + it 'should enable the cronjob, running puppet twice an hour, not at :0 and :30' do should contain_cron('run_puppet_agent').with({ :ensure=>"present", :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", :special=>"absent", - :minute=>["3", 33], + :hour=>"20" + }) + should_not contain_cron('run_puppet_agent').with({ + :ensure=>"present", + :command=>"#{bin_dir}/puppet agent --no-daemonize --onetime", + :special=>"absent", + :minute=>[0, 45], :hour=>"20" }) end @@ -266,7 +292,7 @@ }) end end - end + end # cron_hour=20 end end context 'when $::puppet::enabled is false' do @@ -299,7 +325,7 @@ :special=>"absent" }) end - end# puppet::enabled + end # puppet::enabled end end end diff --git a/spec/classes/puppet_profile_master_spec.rb b/spec/classes/puppet_profile_master_spec.rb index e2bbcd1..1bc850f 100644 --- a/spec/classes/puppet_profile_master_spec.rb +++ b/spec/classes/puppet_profile_master_spec.rb @@ -15,6 +15,7 @@ { "operatingsystem" => "CentOS", "operatingsystemrelease" => [ + "6", "7" ] } @@ -44,13 +45,32 @@ end end#no params - context 'when puppetdb is true' do + context 'when puppetdb is true and puppetdb_manage_dbserver is unspecified' do let(:pre_condition){"class{'::puppet::profile::master': puppetdb => true}"} it 'should contain class ::puppetdb' do should contain_class('puppetdb').with({ :listen_port => '8080', :ssl_listen_port => '8081', :disable_ssl => false, + :manage_dbserver => true, + :listen_address => '127.0.0.1', + :ssl_listen_address => '0.0.0.0', + :node_ttl => '0s', + :node_purge_ttl => '0s', + :report_ttl => '14d', + }) + end + end + context 'when puppetdb is true and puppetdb_manage_dbserver is false' do + let(:pre_condition) do + "class{'::puppet::profile::master': puppetdb => true, puppetdb_manage_dbserver => false} class{'::postgresql::server':}" + end + it 'should contain class ::puppetdb' do + should contain_class('puppetdb').with({ + :listen_port => '8080', + :ssl_listen_port => '8081', + :disable_ssl => false, + :manage_dbserver => false, :listen_address => '127.0.0.1', :ssl_listen_address => '0.0.0.0', :node_ttl => '0s', From 949bb9d1438f7473a3730d6e39ebc4b9eaf661bd Mon Sep 17 00:00:00 2001 From: RvdH Date: Fri, 14 Oct 2016 15:02:05 +0200 Subject: [PATCH 3/8] Update Puppetlabs repository keys (#120) * Update Puppetlabs repository keys * Also update tests --- manifests/repo/apt.pp | 6 +++--- spec/classes/puppet_repo_apt_spec.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/repo/apt.pp b/manifests/repo/apt.pp index 2044883..323372c 100644 --- a/manifests/repo/apt.pp +++ b/manifests/repo/apt.pp @@ -22,7 +22,7 @@ ensure => 'present', location => 'http://apt.puppetlabs.com', repos => $::puppet::collection, - key => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30', + key => '6F6B15509CF8E59E6E469F327F438280EF8D349F', key_server => 'pgp.mit.edu', } } else { @@ -30,14 +30,14 @@ ensure => $source_ensure, location => 'http://apt.puppetlabs.com', repos => 'main dependencies', - key => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30', + key => '6F6B15509CF8E59E6E469F327F438280EF8D349F', key_server => 'pgp.mit.edu', } apt::source { 'puppetlabs_devel': ensure => $devel_ensure, location => 'http://apt.puppetlabs.com', repos => 'devel', - key => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30', + key => '6F6B15509CF8E59E6E469F327F438280EF8D349F', key_server => 'pgp.mit.edu', } } diff --git a/spec/classes/puppet_repo_apt_spec.rb b/spec/classes/puppet_repo_apt_spec.rb index c119e1f..5190f27 100644 --- a/spec/classes/puppet_repo_apt_spec.rb +++ b/spec/classes/puppet_repo_apt_spec.rb @@ -38,7 +38,7 @@ :ensure=>"present", :location=>"http://apt.puppetlabs.com", :repos=>"main dependencies", - :key=>"47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30", + :key=>"6F6B15509CF8E59E6E469F327F438280EF8D349F", :key_server=>"pgp.mit.edu", :comment=>"puppetlabs", }) @@ -49,7 +49,7 @@ :ensure=>"absent", :location=>"http://apt.puppetlabs.com", :repos=>"devel", - :key=>"47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30", + :key=>"6F6B15509CF8E59E6E469F327F438280EF8D349F", :key_server=>"pgp.mit.edu", :comment=>"puppetlabs_devel", }) @@ -64,7 +64,7 @@ :ensure=>"present", :location=>"http://apt.puppetlabs.com", :repos=>"BOGON", - :key=>"47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30", + :key=>"6F6B15509CF8E59E6E469F327F438280EF8D349F", :key_server=>"pgp.mit.edu", }) should_not contain_apt__source('puppetlabs') @@ -88,7 +88,7 @@ :ensure=>"absent", :location=>"http://apt.puppetlabs.com", :repos=>"devel", - :key=>"47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30", + :key=>"6F6B15509CF8E59E6E469F327F438280EF8D349F", :key_server=>"pgp.mit.edu", :comment=>"puppetlabs_devel", }) @@ -103,7 +103,7 @@ :ensure=>"present", :location=>"http://apt.puppetlabs.com", :repos=>"devel", - :key=>"47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30", + :key=>"6F6B15509CF8E59E6E469F327F438280EF8D349F", :key_server=>"pgp.mit.edu", :comment=>"puppetlabs_devel", }) From acbaedfb38ce0e376f5a82fa9da9ba8e53cd0ff0 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Sat, 25 Mar 2017 19:15:16 -0400 Subject: [PATCH 4/8] Attempt to fix Travis builds (#135) * Attempt to fix Travis builds * Adjust travis version matrix --- .travis.yml | 22 ++++----- Gemfile | 10 ++-- Gemfile.lock | 132 ++++++++++++++++++++++++++++----------------------- 3 files changed, 87 insertions(+), 77 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8476515..6732488 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,27 +6,23 @@ script: bundle exec rake test matrix: fast_finish: true include: - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.1" HIERA_GEM_VERSION="~> 1.3" - rvm: 1.9.3 env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.2" HIERA_GEM_VERSION="~> 1.3" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.1" HIERA_GEM_VERSION="~> 1.3" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.2" HIERA_GEM_VERSION="~> 1.3" - rvm: 2.1.7 env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.1" HIERA_GEM_VERSION="~> 1.3" - rvm: 2.1.7 - env: PUPPET_GEM_VERSION="3.8.5" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 1.3" FUTURE_PARSER="yes" - - rvm: 2.1.7 - env: PUPPET_GEM_VERSION="4.3.2" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.0" - - rvm: 2.2.0 - env: PUPPET_GEM_VERSION="4.7.0" FACTER_GEM_VERSION="~> 2.4.6" HIERA_GEM_VERSION="~> 3.2.1" + env: PUPPET_GEM_VERSION="~> 3.8.5" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 1.3" FUTURE_PARSER="yes" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4.5.0" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.2.0" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4.7.0" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.2.0" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4.8.0" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.2.0" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4.9.0" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 3.3.0" -notifications: - slack: - secure: EwJDWYpcaMh5Ebb4EbsVu+nc1QPff/OTT0aYyExl5i7e8YFKUAL6oTNtupo3s/RO1CUBUOcKGvYUmbhuTxo1o/MfKNFviR8xaYNS2sktZ0961jpd5JtLYxaZd91JKLb2ZrMuAckejM17+lMxivu8+PKZnuF7S78DHNLDLVJkBrY= - email: false deploy: provider: puppetforge user: abstractit diff --git a/Gemfile b/Gemfile index cd502ee..aa99472 100644 --- a/Gemfile +++ b/Gemfile @@ -11,14 +11,14 @@ def location_for(place, fake_version = nil) end group :test do - gem "rspec-core", '3.1.7', :require => false - gem "rspec-puppet", '2.3.2', :require => false - gem 'puppetlabs_spec_helper', :git => 'https://github.com/puppetlabs/puppetlabs_spec_helper', :require => false - gem 'rspec-puppet-facts', '1.3.0', :require => false + gem "rspec-core", '3.5.4', :require => false + gem "rspec-puppet", '2.5.0', :require => false + gem 'puppetlabs_spec_helper', '2.1.0', :require => false + gem 'rspec-puppet-facts', '1.7.1', :require => false gem "puppet-syntax", :require => false gem 'metadata-json-lint', :require => false gem 'simplecov', :require => false - gem 'json', '1.8.3', :require => false + gem 'json', '1.8.5', :require => false gem "puppet-blacksmith", :require => false gem 'pry', '<= 0.9.8', :require => false gem 'puppet-lint', :require => false diff --git a/Gemfile.lock b/Gemfile.lock index b8d4876..93e8a87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,60 +1,62 @@ -GIT - remote: https://github.com/puppetlabs/puppetlabs_spec_helper - revision: 6c8aa5b921f96e860b0f5f92dde13647572122ff - specs: - puppetlabs_spec_helper (1.2.2) - mocha (~> 1.0) - puppet-lint (~> 2.0) - puppet-syntax (~> 2.0) - rspec-puppet (~> 2.0) - GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.2.8) addressable (2.4.0) backports (3.6.8) coderay (1.0.9) - diff-lcs (1.2.5) + diff-lcs (1.3) docile (1.1.5) - domain_name (0.5.20160826) + domain_name (0.5.20170223) unf (>= 0.0.5, < 1.0.0) - ethon (0.9.1) + ethon (0.10.1) ffi (>= 1.3.0) facter (2.4.6) - CFPropertyList (~> 2.2.6) - facterdb (0.3.6) + facterdb (0.3.10) facter jgrep - faraday (0.9.2) + faraday (0.11.0) multipart-post (>= 1.2, < 3) - faraday_middleware (0.10.0) - faraday (>= 0.7.4, < 0.10) - ffi (1.9.14) - gh (0.14.0) - addressable + faraday_middleware (0.11.0.1) + faraday (>= 0.7.4, < 1.0) + fast_gettext (1.1.0) + ffi (1.9.18) + gettext (3.2.2) + locale (>= 2.0.5) + text (>= 1.3.0) + gettext-setup (0.18) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) + locale + gh (0.15.1) + addressable (~> 2.4.0) backports faraday (~> 0.8) multi_json (~> 1.0) - net-http-persistent (>= 2.7) + net-http-persistent (~> 2.9) net-http-pipeline - hiera (3.2.1) + hiera (3.2.2) highline (1.7.8) - http-cookie (1.0.2) + http-cookie (1.0.3) domain_name (~> 0.5) jgrep (1.4.1) json - json (1.8.3) - json_pure (1.8.3) + json (1.8.5) + json_pure (1.8.6) launchy (2.4.3) addressable (~> 2.3) + locale (2.1.2) + mcollective-client (2.10.2) + json + stomp + systemu metaclass (0.0.4) - metadata-json-lint (0.0.11) + metadata-json-lint (1.1.0) json + semantic_puppet (>= 0.1.2, < 2.0.0) spdx-licenses (~> 1.0) method_source (0.8.2) mime-types (2.99.3) - mocha (1.1.0) + mocha (1.2.1) metaclass (~> 0.0.1) multi_json (1.12.1) multipart-post (2.0.0) @@ -66,14 +68,13 @@ GEM method_source (~> 0.7) slop (>= 2.4.3, < 3) 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-lint (2.1.1) puppet-lint-absolute_classname-check (0.2.4) puppet-lint (>= 1.0, < 3.0) puppet-lint-empty_string-check (0.2.2) @@ -88,45 +89,57 @@ GEM puppet-lint (>= 1.0, < 3.0) puppet-lint-unquoted_string-check (0.3.0) puppet-lint (>= 1.0, < 3.0) - puppet-lint-variable_contains_upcase (1.0.2) + puppet-lint-variable_contains_upcase (1.2.0) puppet-lint (>= 1.0, < 3.0) - puppet-syntax (2.1.0) + puppet-syntax (2.4.0) rake + puppetlabs_spec_helper (2.1.0) + mocha (~> 1.0) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) pusher-client (0.6.2) json websocket (~> 1.0) - rake (11.3.0) + rake (12.0.0) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) + 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-mocks (3.5.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-puppet (2.3.2) + rspec-support (~> 3.5.0) + rspec-puppet (2.5.0) rspec - rspec-puppet-facts (1.3.0) + rspec-puppet-facts (1.7.1) facter facterdb (>= 0.3.0) json + mcollective-client puppet - rspec-support (3.1.2) - simplecov (0.12.0) + rspec-support (3.5.0) + semantic_puppet (0.1.4) + gettext-setup (>= 0.3) + simplecov (0.14.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slop (2.4.4) spdx-licenses (1.1.0) - travis (1.8.2) + stomp (1.4.3) + systemu (2.6.5) + text (1.3.1) + travis (1.8.8) backports faraday (~> 0.9) faraday_middleware (~> 0.9, >= 0.9.1) @@ -142,18 +155,19 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.2) - websocket (1.2.3) + websocket (1.2.4) PLATFORMS ruby DEPENDENCIES - facter - hiera - json (= 1.8.3) + facter (~> 2.4.6) + hiera (~> 3.2.1) + json (= 1.8.5) + json_pure (< 2.0.2) metadata-json-lint pry (<= 0.9.8) - puppet + puppet (= 4.7.0) puppet-blacksmith puppet-lint puppet-lint-absolute_classname-check @@ -165,13 +179,13 @@ DEPENDENCIES puppet-lint-unquoted_string-check puppet-lint-variable_contains_upcase puppet-syntax - puppetlabs_spec_helper! - rspec-core (= 3.1.7) - rspec-puppet (= 2.3.2) - rspec-puppet-facts (= 1.3.0) + puppetlabs_spec_helper (= 2.1.0) + rspec-core (= 3.5.4) + rspec-puppet (= 2.5.0) + rspec-puppet-facts (= 1.7.1) simplecov travis travis-lint BUNDLED WITH - 1.13.1 + 1.14.6 From 9570f1f0e3a5e5419cec260a806c4252ce7f5010 Mon Sep 17 00:00:00 2001 From: "Sean S. King" Date: Mon, 27 Mar 2017 11:41:44 -0400 Subject: [PATCH 5/8] fix name of puppet group in puppet4 (#132) --- manifests/defaults.pp | 2 ++ manifests/fact.pp | 2 +- manifests/facts.pp | 2 +- manifests/init.pp | 4 ++-- spec/classes/puppet_spec.rb | 6 ++++-- spec/defines/fact_spec.rb | 4 +++- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/manifests/defaults.pp b/manifests/defaults.pp index 1b0fb24..a5f5312 100644 --- a/manifests/defaults.pp +++ b/manifests/defaults.pp @@ -43,6 +43,7 @@ $puppetdb_etcdir = '/etc/puppetlabs/puppetdb' $puppetdb_test_url = '/pdb/meta/v1/version' $gem_provider = 'puppetserver_gem' + $puppet_group = 'root' } else { $server_type = 'passenger' $confdir = '/etc/puppet' @@ -59,6 +60,7 @@ $puppetdb_etcdir = '/etc/puppetdb' $puppetdb_test_url = '/v3/version' $gem_provider = 'gem' + $puppet_group = 'puppet' } $puppetdb_confdir = "${puppetdb_etcdir}/conf.d" $puppetdb_ssl_dir = "${puppetdb_etcdir}/ssl" diff --git a/manifests/fact.pp b/manifests/fact.pp index 209a220..3298d24 100644 --- a/manifests/fact.pp +++ b/manifests/fact.pp @@ -13,7 +13,7 @@ file { "${facterbasepath}/facts.d/${title}.yaml": ensure => $ensure, owner => 'root', - group => 'puppet', + group => $::puppet::defaults::puppet_group, mode => '0640', content => template('puppet/fact.yaml.erb'), } diff --git a/manifests/facts.pp b/manifests/facts.pp index fb75659..9f1ce3d 100644 --- a/manifests/facts.pp +++ b/manifests/facts.pp @@ -19,7 +19,7 @@ file { "${facterbasepath}/facts.d/local.yaml": ensure => file, owner => 'root', - group => 'puppet', + group => $::puppet::defaults::puppet_group, mode => '0640', content => template('puppet/local_facts.yaml.erb'), } diff --git a/manifests/init.pp b/manifests/init.pp index feeb011..57ad10b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -219,7 +219,7 @@ file { $facterbasepath: ensure => directory, owner => 'root', - group => 'puppet', + group => $::puppet::defaults::puppet_group, mode => '0755', } } @@ -228,7 +228,7 @@ file { "${facterbasepath}/facts.d": ensure => directory, owner => 'root', - group => 'puppet', + group => $::puppet::defaults::puppet_group, mode => '0755', } } diff --git a/spec/classes/puppet_spec.rb b/spec/classes/puppet_spec.rb index 9a5808a..bcd046d 100644 --- a/spec/classes/puppet_spec.rb +++ b/spec/classes/puppet_spec.rb @@ -106,8 +106,10 @@ it { is_expected.to compile.with_all_deps } if Puppet.version.to_f >= 4.0 facterbasepath = '/opt/puppetlabs/facter' + facterbasepath_group = 'root' else facterbasepath = '/etc/facter' + facterbasepath_group = 'puppet' end context 'when fed no parameters' do it 'should instantiate the puppet::repo class with the default params' do @@ -127,13 +129,13 @@ should contain_file("#{facterbasepath}").with({ :ensure=>"directory", :owner=>"root", - :group=>"puppet", + :group=>"#{facterbasepath_group}", :mode=>"0755" }) should contain_file("#{facterbasepath}/facts.d").with({ :ensure=>"directory", :owner=>"root", - :group=>"puppet", + :group=>"#{facterbasepath_group}", :mode=>"0755" }) end diff --git a/spec/defines/fact_spec.rb b/spec/defines/fact_spec.rb index e441a1e..d7831a3 100644 --- a/spec/defines/fact_spec.rb +++ b/spec/defines/fact_spec.rb @@ -79,8 +79,10 @@ if Puppet.version.to_f >= 4.0 facterbasepath = '/opt/puppetlabs/facter' + facterbasepath_group = 'root' else facterbasepath = '/etc/facter' + facterbasepath_group = 'puppet' end context 'when fed no parameters' do let (:title) { 'my_fact'} @@ -90,7 +92,7 @@ :path=>"#{facterbasepath}/facts.d/my_fact.yaml", :ensure=>"present", :owner=>"root", - :group=>"puppet", + :group=>"#{facterbasepath_group}", :mode=>"0640" }).with_content("# custom fact my_fact\n---\nmy_fact: \"my_val\"\n") end From 828d0d72abd2149d46d33fa623e54f5448ba9003 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Fri, 31 Mar 2017 15:42:20 -0400 Subject: [PATCH 6/8] more travis fixes (#137) * Drop log format config for puppetsyntax * Set max version for puppetserevr_gem * Lock puppet-syntax to 2.1.0 * Lock puppet-lint to 2.0.2 * lock concat to 1.2.2 * Code cleanup * cleanup versions --- .fixtures.yml | 2 +- .travis.yml | 2 +- Gemfile | 4 ++-- Gemfile.lock | 14 +++++++------- Rakefile | 1 - metadata.json | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 7015344..e6d6ab6 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -5,7 +5,7 @@ fixtures: ref: "1.4.1" concat: repo: "puppetlabs/concat" - ref: "'>= 1.2.2 < 2.0.0'" + ref: "1.2.2" stdlib: repo: "puppetlabs/stdlib" ref: "4.6.0" diff --git a/.travis.yml b/.travis.yml index 6732488..40cb4fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.2" HIERA_GEM_VERSION="~> 1.3" - rvm: 2.1.7 - env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.1" HIERA_GEM_VERSION="~> 1.3" + env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 2.2" HIERA_GEM_VERSION="~> 1.3" - rvm: 2.1.7 env: PUPPET_GEM_VERSION="~> 3.8.5" FACTER_GEM_VERSION="~> 2.4" HIERA_GEM_VERSION="~> 1.3" FUTURE_PARSER="yes" - rvm: 2.1.9 diff --git a/Gemfile b/Gemfile index aa99472..f650d17 100644 --- a/Gemfile +++ b/Gemfile @@ -15,13 +15,13 @@ group :test do gem "rspec-puppet", '2.5.0', :require => false gem 'puppetlabs_spec_helper', '2.1.0', :require => false gem 'rspec-puppet-facts', '1.7.1', :require => false - gem "puppet-syntax", :require => false + gem "puppet-syntax", '2.1.0', :require => false gem 'metadata-json-lint', :require => false gem 'simplecov', :require => false gem 'json', '1.8.5', :require => false gem "puppet-blacksmith", :require => false gem 'pry', '<= 0.9.8', :require => false - gem 'puppet-lint', :require => false + gem 'puppet-lint', '2.0.2', :require => false gem 'puppet-lint-unquoted_string-check', :require => false gem 'puppet-lint-empty_string-check', :require => false gem 'puppet-lint-leading_zero-check', :require => false diff --git a/Gemfile.lock b/Gemfile.lock index 93e8a87..262779e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,7 +74,7 @@ GEM puppet-blacksmith (3.4.0) puppet (>= 2.7.16) rest-client (~> 1.8.0) - puppet-lint (2.1.1) + puppet-lint (2.0.2) puppet-lint-absolute_classname-check (0.2.4) puppet-lint (>= 1.0, < 3.0) puppet-lint-empty_string-check (0.2.2) @@ -91,7 +91,7 @@ GEM puppet-lint (>= 1.0, < 3.0) puppet-lint-variable_contains_upcase (1.2.0) puppet-lint (>= 1.0, < 3.0) - puppet-syntax (2.4.0) + puppet-syntax (2.1.0) rake puppetlabs_spec_helper (2.1.0) mocha (~> 1.0) @@ -161,15 +161,15 @@ PLATFORMS ruby DEPENDENCIES - facter (~> 2.4.6) - hiera (~> 3.2.1) + facter + hiera json (= 1.8.5) json_pure (< 2.0.2) metadata-json-lint pry (<= 0.9.8) - puppet (= 4.7.0) + puppet puppet-blacksmith - puppet-lint + puppet-lint (= 2.0.2) puppet-lint-absolute_classname-check puppet-lint-empty_string-check puppet-lint-leading_zero-check @@ -178,7 +178,7 @@ DEPENDENCIES puppet-lint-undef_in_function-check puppet-lint-unquoted_string-check puppet-lint-variable_contains_upcase - puppet-syntax + puppet-syntax (= 2.1.0) puppetlabs_spec_helper (= 2.1.0) rspec-core (= 3.5.4) rspec-puppet (= 2.5.0) diff --git a/Rakefile b/Rakefile index f4b2fba..e97f24e 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,6 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') # PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') -PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" exclude_paths = [ "pkg/**/*", diff --git a/metadata.json b/metadata.json index 71f2085..067f4a0 100644 --- a/metadata.json +++ b/metadata.json @@ -77,7 +77,7 @@ }, { "name": "puppetlabs/puppetserver_gem", - "version_requirement": ">=0.1.0" + "version_requirement": ">=0.1.0 <2.0.0" } ] } From 39e4d72bac25c75dfa183a717f4419d8af87e4ea Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Sat, 1 Apr 2017 10:58:39 -0400 Subject: [PATCH 7/8] Add config to setup an ENC (#136) --- manifests/master.pp | 9 +++++- manifests/master/config.pp | 34 ++++++++++++++++++++ manifests/profile/master.pp | 8 +++++ spec/classes/puppet_master_config_spec.rb | 38 +++++++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) diff --git a/manifests/master.pp b/manifests/master.pp index 3521371..b59504d 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -76,13 +76,16 @@ # Specifies weekday to run the report clean cronjob # @param server_type ([String] Default Puppet 4: 'puppetserver' Default Puppet 4: 'passenger') # Specifies the type of server to use puppetserver is always used on Puppet 4 +# @param $external_nodes ([String] Default undef) +# Specifies the script tom use as a node classifier +# @param $node_terminus ([String] Default undef) +# Specifies method to use for the external_nodes # @param module_path **DEPRECATED** ([String] Default: undef) # If this is set, it will be used to populate the basemodulepath parameter in /etc/puppet/puppet.conf. This does not impact [environment.conf](http://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html), which should live in your [r10k](https://github.com/adrienthebo/r10k) environment repo. # @param pre_module_path **DEPRECATED** ([String] Default: undef) # If set, this is prepended to the modulepath parameter *if it is set* and to a static modulepath list if modulepath is unspecified. *A colon separator will be appended to the end of this if needed* # @param r10k_version **DEPRECATED** ([String] Default: undef) # Specifies the version of r10k to install. *It is important to note that the r10k package will be installed via gem* - class puppet::master ( $autosign = false, $autosign_domains = [], @@ -124,6 +127,8 @@ $report_clean_weekday = '0', $server_type = $::puppet::defaults::server_type, $server_version = 'installed', + $external_nodes = undef, + $node_terminus = undef, $module_path = undef, $pre_module_path = undef, $r10k_version = undef, @@ -160,6 +165,8 @@ $passenger_max_requests, $passenger_pool_idle_time, $passenger_stat_throttle_rate, + $external_nodes, + $node_terminus, ) # add deprecation warnings diff --git a/manifests/master/config.pp b/manifests/master/config.pp index 205267c..e4c3f9b 100644 --- a/manifests/master/config.pp +++ b/manifests/master/config.pp @@ -19,6 +19,8 @@ $report_clean_hour = $puppet::master::report_clean_hour $report_clean_min = $puppet::master::report_clean_min $report_clean_weekday = $puppet::master::report_clean_weekday + $external_nodes = $puppet::master::external_nodes + $node_terminus = $puppet::master::node_terminus if ($ca_server != undef) { if ($ca_server == $::fqdn) { @@ -129,4 +131,36 @@ } } + if ( $external_nodes != undef and $node_terminus != undef ){ + # enable external_nodes + ini_setting { 'master external_nodes': + ensure => present, + path => "${confdir}/puppet.conf", + section => 'master', + setting => 'external_nodes', + value => $external_nodes, + } + ini_setting { 'master node_terminus': + ensure => present, + path => "${confdir}/puppet.conf", + section => 'master', + setting => 'node_terminus', + value => $node_terminus, + } + } else { + # disable external_nodes + ini_setting { 'master external_nodes': + ensure => absent, + path => "${confdir}/puppet.conf", + section => 'master', + setting => 'external_nodes', + } + ini_setting { 'master node_terminus': + ensure => absent, + path => "${confdir}/puppet.conf", + section => 'master', + setting => 'node_terminus', + } + } + } diff --git a/manifests/profile/master.pp b/manifests/profile/master.pp index b2f694a..347e89a 100644 --- a/manifests/profile/master.pp +++ b/manifests/profile/master.pp @@ -72,6 +72,10 @@ # Specifies the version of the puppetmaster package to install # @param server_type ([String] Default Puppet 4: 'puppetserver' Default Puppet 4: 'passenger') # Specifies the type of server to use puppetserver is always used on Puppet 4 +# @param $external_nodes ([String] Default undef) +# Specifies the script tom use as a node classifier +# @param $node_terminus ([String] Default undef) +# Specifies method to use for the external_nodes # @param puppetdb [Boolean] Default: false # Whether to setup PuppetDB. # Set this to configure a PuppetDB server on this node. @@ -144,6 +148,8 @@ $puppet_version = 'installed', $server_type = undef, $server_version = 'installed', + $external_nodes = undef, + $node_terminus = undef, $puppetdb = false, $puppetdb_manage_dbserver = true, $puppetdb_server = undef, @@ -192,6 +198,8 @@ passenger_stat_throttle_rate => $passenger_stat_throttle_rate, puppet_fqdn => $puppet_fqdn, server_version => $server_version, + external_nodes => $external_nodes, + node_terminus => $node_terminus, server_type => $server_type, puppet_version => $puppet_version, } diff --git a/spec/classes/puppet_master_config_spec.rb b/spec/classes/puppet_master_config_spec.rb index feb1fbe..e26c1f7 100644 --- a/spec/classes/puppet_master_config_spec.rb +++ b/spec/classes/puppet_master_config_spec.rb @@ -87,6 +87,22 @@ 'weekday' => "0" }) end + it 'should not set the external_nodes param via an ini_setting' do + should contain_ini_setting('master external_nodes').with({ + 'ensure' => 'absent', + 'path' => "#{confdir}/puppet.conf", + 'section' => 'master', + 'setting' => 'external_nodes', + }) + end + it 'should not set the node_terminus param via an ini_setting' do + should contain_ini_setting('master node_terminus').with({ + 'ensure' => 'absent', + 'path' => "#{confdir}/puppet.conf", + 'section' => 'master', + 'setting' => 'node_terminus', + }) + end end#no params context 'when $::puppet::master::autosign_method is off' do @@ -337,6 +353,28 @@ end end # future_parser + context 'when the $::puppet::master::external_nodes and $::puppet::master::node_terminus variables are set' do + let(:pre_condition) {"class{'::puppet::master': external_nodes => '/etc/puppetlabs/puppet/node.rb', node_terminus => 'exec'}"} + it 'should update the external_nodes param via an ini_setting' do + should contain_ini_setting('master external_nodes').with({ + 'ensure' => 'present', + 'path' => "#{confdir}/puppet.conf", + 'section' => 'master', + 'setting' => 'external_nodes', + 'value' => '/etc/puppetlabs/puppet/node.rb' + }) + end + it 'should update the node_terminus param via an ini_setting' do + should contain_ini_setting('master node_terminus').with({ + 'ensure' => 'present', + 'path' => "#{confdir}/puppet.conf", + 'section' => 'master', + 'setting' => 'node_terminus', + 'value' => 'exec' + }) + end + end # external_nodes + end end end From 68d75167066402b54a80c7fcc31caf2914c72c97 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Sat, 1 Apr 2017 15:21:16 -0400 Subject: [PATCH 8/8] Release version 2.3.0 (#138) --- CHANGELOG.md | 2 ++ metadata.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe0508..e4cb211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Feature: Configure agents using SRV records @aaron-miller Feature: Added parameter manage_dbserver to profiles/master @chrisowensboston ####Bugfixes +Fix puppet group in puppet 4 @seanscottking +Update Puppetlabs apt keys @rdvh Fix puppetserver should connect to non SSL puppetdb via http not https @divansantana Update metadata.json to allow use of zack-r10k version 3.2.0 @rpkish Define relationship between sysconfig and service in agent @toepi diff --git a/metadata.json b/metadata.json index 067f4a0..35a20e9 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "abstractit-puppet", - "version": "2.3.0-alpha", + "version": "2.3.0", "author": "Abstract IT", "license": "Apache-2.0", "summary": "Manage Puppet agent, master, modules and hiera with Puppet",