Skip to content

Commit cf60d6e

Browse files
committed
Puppetserver update:
Update all modules to the latest version. Replace stephenrjohnson/puppet with jlambert121/puppet. Hiera setup injected into globals.yaml and puppet_role/puppet.yaml. Modify the sample network to 10.0.1.0/24. Bootstrap script: Re-ordered the download to prevent version conflicts. Update module versions and downloads Migrate from 'service' to 'systemctl' (systemd) for services controls. Work around two bugs in hiera interpolation in hiera.pp. Remove puppetdb from master bootstrap. Refactor puppet_master profile. Update webhook and padmin hiera data.
1 parent 299113a commit cf60d6e

26 files changed

+206
-158
lines changed

.travis.yml

+2-20
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,7 @@ notifications:
1111
email: false
1212
rvm:
1313
- 1.9.3
14-
- 2.0.0
1514
- 2.1.0
1615
env:
17-
- PUPPET_GEM_VERSION="~> 3.3.0"
18-
- PUPPET_GEM_VERSION="~> 3.4.0"
19-
- PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES=yes
20-
- PUPPET_GEM_VERSION="~> 3.6.0" STRICT_VARIABLES=yes
21-
- PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES=yes
22-
- PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes
23-
- PUPPET_GEM_VERSION="~> 4.0.0" STRICT_VARIABLES=yes
24-
matrix:
25-
exclude:
26-
# Ruby 2.1.0
27-
- rvm: 2.1.0
28-
env: PUPPET_GEM_VERSION="~> 3.2.0"
29-
- rvm: 2.1.0
30-
env: PUPPET_GEM_VERSION="~> 3.3.0"
31-
- rvm: 2.1.0
32-
env: PUPPET_GEM_VERSION="~> 3.4.0"
33-
allow_failures:
34-
- env: PUPPET_GEM_VERSION="~> 4.0.0" STRICT_VARIABLES=yes
35-
- env: PUPPET_GEM_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes
16+
- PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes
17+
- PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES=yes

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ source "https://rubygems.org"
22

33
group :test do
44
gem "rake"
5-
gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 3.8.0'
5+
gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 4.0'
66
gem "rspec", '< 3.2.0'
7-
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
7+
gem "rspec-puppet"
88
gem "puppetlabs_spec_helper"
99
gem "metadata-json-lint"
1010
gem "rspec-puppet-facts"

Puppetfile

+41-38
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,51 @@
11
forge 'http://forge.puppetlabs.com'
22

3-
# Modules from the Puppet Forge
4-
mod 'ajjahn/dhcp', '0.2.0'
3+
# Modules discovered by generate-puppetfile
4+
mod 'ajjahn/dhcp', '1.0.0'
55
mod 'croddy/make', '0.0.5'
66
mod 'garethr/erlang', '0.3.0'
7-
mod 'gentoo/portage', '2.2.0'
8-
mod 'maestrodev/rvm', '1.6.6'
9-
mod 'nanliu/staging', '1.0.2'
10-
mod 'palli/createrepo', '0.9.5'
11-
mod 'puppetlabs/activemq', '0.2.0'
12-
mod 'puppetlabs/apache', '1.2.0'
13-
mod 'puppetlabs/apt', '1.5.0'
14-
mod 'puppetlabs/concat', '1.1.2'
15-
mod 'puppetlabs/firewall', '1.1.2'
16-
mod 'puppetlabs/gcc', '0.1.0'
17-
mod 'puppetlabs/git', '0.1.0'
18-
mod 'puppetlabs/inifile', '1.1.0'
19-
mod 'puppetlabs/java', '1.1.1'
20-
mod 'puppetlabs/java_ks', '1.2.4'
21-
mod 'puppetlabs/lvm', '0.4.0'
22-
mod 'puppetlabs/mcollective', '1.1.5'
23-
mod 'puppetlabs/mysql', '3.1.0'
24-
mod 'puppetlabs/ntp', '3.1.1'
25-
mod 'puppetlabs/pe_gem', '0.0.1'
26-
mod 'puppetlabs/postgresql', '3.3.3'
27-
mod 'puppetlabs/puppetdb', '3.0.1'
28-
mod 'puppetlabs/rabbitmq', '4.0.0'
7+
mod 'gentoo/portage', '2.3.0'
8+
mod 'golja/gnupg', '1.2.3'
9+
mod 'hunner/hiera', '2.0.1'
10+
mod 'jlambert121/puppet', '0.7.0'
11+
mod 'maestrodev/rvm', '1.12.1'
12+
mod 'nanliu/staging', '1.0.3'
13+
mod 'palli/createrepo', '1.1.0'
14+
mod 'puppetlabs/activemq', '0.4.0'
15+
mod 'puppetlabs/apache', '1.8.0'
16+
mod 'puppetlabs/apt', '2.2.1'
17+
mod 'puppetlabs/concat', '1.2.5'
18+
mod 'puppetlabs/firewall', '1.7.2'
19+
mod 'puppetlabs/gcc', '0.3.0'
20+
mod 'puppetlabs/git', '0.4.0'
21+
mod 'puppetlabs/inifile', '1.4.3'
22+
mod 'puppetlabs/java', '1.4.3'
23+
mod 'puppetlabs/java_ks', '1.4.0'
24+
mod 'puppetlabs/lvm', '0.7.0'
25+
mod 'puppetlabs/mcollective', '99.99.99'
26+
mod 'puppetlabs/mysql', '3.6.2'
27+
mod 'puppetlabs/ntp', '4.1.2'
28+
mod 'puppetlabs/pe_gem', '0.2.0'
29+
mod 'puppetlabs/postgresql', '4.7.0'
30+
mod 'puppetlabs/puppetdb', '5.0.0'
31+
mod 'puppetlabs/rabbitmq', '5.3.1'
2932
mod 'puppetlabs/ruby', '0.4.0'
30-
mod 'puppetlabs/stdlib', '4.5.0'
33+
mod 'puppetlabs/stdlib', '4.11.0'
3134
mod 'puppetlabs/tftp', '0.2.3'
32-
mod 'puppetlabs/vcsrepo', '1.0.1'
33-
mod 'puppetlabs/xinetd', '1.4.0'
34-
mod 'richardc/datacat', '0.4.3'
35-
mod 'rnelson0/certs', '0.6.1'
36-
mod 'rnelson0/local_user', '0.9.3'
37-
mod 'saz/ssh', '2.4.0'
38-
mod 'saz/sudo', '3.0.6'
39-
mod 'stahnma/epel', '0.1.0'
40-
mod 'stephenrjohnson/puppet', '0.0.23'
41-
mod 'thias/bind', '0.5.1'
35+
mod 'puppetlabs/vcsrepo', '1.3.2'
36+
mod 'puppetlabs/xinetd', '1.5.0'
37+
mod 'richardc/datacat', '0.5.0'
38+
mod 'rnelson0/certs', '0.7.0'
39+
mod 'rnelson0/local_user', '1.0.7'
40+
mod 'saz/ssh', '2.8.1'
41+
mod 'saz/sudo', '3.1.0'
42+
mod 'stahnma/epel', '1.2.2'
43+
mod 'thias/bind', '0.5.2'
4244
mod 'yguenane/augeas', '0.1.1'
4345
mod 'yguenane/ygrpms', '0.1.0'
44-
mod 'zack/r10k', '2.8.0'
45-
46+
mod 'zack/r10k', '3.2.0'
47+
# Discovered elements from existing Puppetfile
4648
# Modules from Github
4749
mod 'lab_config',
48-
:git => '[email protected]:puppetinabox/lab_config.git'
50+
:git => '[email protected]:puppetinabox/lab_config.git',
51+
:branch => 'puppetserver'

bootstrap.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# Add bootstrap modules
44
mkdir -p /root/bootstrap/modules
5-
puppet module install --modulepath=/root/bootstrap/modules zack/r10k --version 2.5.4
6-
puppet module install --modulepath=/root/bootstrap/modules stahnma/epel --version 1.0.2
7-
puppet module install --modulepath=/root/bootstrap/modules stephenrjohnson/puppet --version 1.3.1
8-
puppet module install --modulepath=/root/bootstrap/modules hunner/hiera --version 1.1.1
5+
puppet module install --modulepath=/root/bootstrap/modules jlambert121/puppet --version 0.7.0
6+
puppet module install --modulepath=/root/bootstrap/modules zack/r10k --version 3.2.0
7+
puppet module install --modulepath=/root/bootstrap/modules stahnma/epel --version 1.2.2
8+
puppet module install --modulepath=/root/bootstrap/modules hunner/hiera --version 1.4.1
99

1010
# Configure the master, hiera, and r10k services
1111
puppet apply --modulepath=/root/bootstrap/modules master.pp && \
@@ -14,12 +14,15 @@ puppet apply --modulepath=/root/bootstrap/modules r10k_installation.pp && \
1414
# If everything went well, deploy using r10k
1515
r10k deploy environment -p
1616

17+
1718
# If everything is successful, run puppet, otherwise alert
1819
if [ $? -eq 0 ]
1920
then
21+
# Ensure changes to hiera and the master configuration are in place before continuing
22+
systemctl restart puppetserver
2023
puppet agent -t
21-
chkconfig puppet on
22-
service puppet start
24+
systemctl enable puppet
25+
systemctl start puppet
2326
else
2427
echo "Some part of the bootstrap process failed. Investigate the errors and proceed with manual bootstrapping."
2528
echo ""

dist/profile/.fixtures.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ fixtures:
55
apache: 'git://github.com/puppetlabs/puppetlabs-apache'
66
bind: 'git://github.com/thias/puppet-bind'
77
certs: 'git://github.com/rnelson0/puppet-certs'
8-
concat:
9-
repo: 'git://github.com/puppetlabs/puppetlabs-concat'
10-
ref: '1.2.0'
8+
concat: 'git://github.com/puppetlabs/puppetlabs-concat'
119
createrepo: 'git://github.com/pall-valmundsson/puppet-createrepo'
1210
dhcp: 'git://github.com/ajjahn/puppet-dhcp'
1311
epel: 'git://github.com/stahnma/puppet-module-epel'
@@ -19,7 +17,7 @@ fixtures:
1917
mysql: 'git://github.com/puppetlabs/puppetlabs-mysql'
2018
ntp: 'git://github.com/puppetlabs/puppetlabs-ntp'
2119
postgresql: 'git://github.com/puppetlabs/puppetlabs-postgresql'
22-
puppet: 'git://github.com/stephenrjohnson/puppetmodule'
20+
puppet: https://github.com/jlambert121/jlambert121-puppet
2321
puppetdb: 'git://github.com/puppetlabs/puppetlabs-puppetdb'
2422
r10k: 'git://github.com/acidprime/r10k'
2523
ruby: 'git://github.com/puppetlabs/puppetlabs-ruby'

dist/profile/manifests/puppet_master.pp

+3-10
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,16 @@
1111
# Copyright 2015 Rob Nelson
1212
#
1313
class profile::puppet_master {
14-
package { 'mcollective-common':
15-
ensure => present,
16-
}
1714
include ::epel
18-
include ::puppet::master
15+
include ::puppet
1916

2017
include ::r10k
2118
include ::r10k::webhook::config
2219
include ::r10k::webhook
23-
Package['mcollective-common'] -> Class['r10k::webhook']
2420
Class['r10k::webhook::config'] -> Class['r10k::webhook']
21+
Package['puppetdb'] -> Service[webhook]
2522

26-
firewall { '100 allow agent checkins':
27-
dport => 8140,
28-
proto => tcp,
29-
action => accept,
30-
}
23+
# evenup/puppet includes a firewall rule for the puppetserver service
3124
firewall { '110 zack-r10k web hook':
3225
dport => 8088,
3326
proto => tcp,

dist/profile/spec/classes/base_spec.rb

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
describe 'profile::base', :type => :class do
33
let :facts do
44
{
5-
:id => 'root',
6-
:kernel => 'Linux',
7-
:osfamily => 'RedHat',
8-
:operatingsystem => 'RedHat',
9-
:operatingsystemrelease => '6',
10-
:concat_basedir => '/dne',
11-
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
12-
}
5+
:id => 'root',
6+
:kernel => 'Linux',
7+
:osfamily => 'RedHat',
8+
:operatingsystem => 'RedHat',
9+
:operatingsystemrelease => '7.2',
10+
:operatingsystemmajrelease => '7',
11+
:concat_basedir => '/dne',
12+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
13+
:puppetversion => '4.3.1',
14+
:sudoversion => '1.8.6p7',
15+
}
1316
end
1417

1518
context 'with defaults for all parameters' do

dist/profile/spec/classes/dhcp_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
context 'with defaults for all parameters' do
1717
it { is_expected.to create_class('profile::dhcp') }
1818
it { is_expected.to contain_package('dhcp') }
19-
it { is_expected.to contain_dhcp__server__subnet('10.0.0.0') }
19+
it { is_expected.to contain_dhcp__server__subnet('10.0.1.0') }
2020
it { is_expected.to contain_dhcp__server__host('sample') }
2121
end
2222
end

dist/profile/spec/classes/mysql/mysql_client_spec.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
require 'spec_helper'
22
describe 'profile::mysql::client', :type => :class do
3-
let :facts do {
4-
:osfamily => 'RedHat',
5-
:operatingsystem => 'RedHat',
6-
:operatingsystemrelease => '6',
7-
}
3+
let :facts do
4+
{
5+
:osfamily => 'RedHat',
6+
:operatingsystem => 'RedHat',
7+
:operatingsystemrelease => '7.2',
8+
:operatingsystemmajrelease => '7',
9+
}
810
end
911

1012
context 'with defaults for all parameters' do

dist/profile/spec/classes/mysql/mysql_server_spec.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
describe 'profile::mysql::server', :type => :class do
33
let :facts do
44
{
5-
:clientcert => 'mysql',
6-
:osfamily => 'RedHat',
7-
:operatingsystem => 'RedHat',
8-
:operatingsystemrelease => '6',
9-
}
5+
:clientcert => 'mysql',
6+
:osfamily => 'RedHat',
7+
:operatingsystem => 'RedHat',
8+
:operatingsystemrelease => '7.2',
9+
:operatingsystemmajrelease => '7',
10+
:puppetversion => '4.3.1',
11+
}
1012
end
1113

1214
context 'with defaults for all parameters' do
+26-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
11
require 'spec_helper'
22
describe 'profile::puppet_master', :type => :class do
3-
let :facts do
3+
let (:facts) do
44
{
5-
:osfamily => 'RedHat',
6-
:operatingsystemrelease => '6.5',
7-
:concat_basedir => '/dne/',
5+
:kernel => 'Linux',
6+
:osfamily => 'RedHat',
7+
:operatingsystem => 'RedHat',
8+
:operatingsystemmajrelease => '7',
9+
:operatingsystemrelease => '7.2',
10+
:processors => {
11+
"count" => 2,
12+
"models" => ["Intel(R) Xeon(R) CPU E31220 @ 3.10GHz", "Intel(R) Xeon(R) CPU E31220 @ 3.10GHz"],
13+
"physicalcount" => 2
14+
},
15+
:puppetversion => '4.3.1',
16+
:concat_basedir => '/dne',
17+
:clientcert => 'puppet.example.com',
818
}
919
end
1020

21+
let (:pre_condition) {
22+
"package('puppetdb': ensure => present, }"
23+
}
24+
1125
context 'with defaults for all parameters' do
1226
it { is_expected.to create_class('profile::puppet_master') }
13-
it { is_expected.to contain_package('mcollective-common') }
1427
it { is_expected.to contain_class('epel') }
28+
it { is_expected.to contain_class('puppet') }
29+
30+
# These resources are included based on hieradata
31+
it { is_expected.to contain_class('puppet::server') }
32+
it { is_expected.to contain_package('puppetserver').
33+
with_ensure('latest')
34+
}
35+
1536
it { is_expected.to contain_class('r10k') }
1637
it { is_expected.to contain_class('r10k::webhook') }
1738
it { is_expected.to contain_class('r10k::webhook::config') }
18-
it { is_expected.to contain_firewall('100 allow agent checkins') }
1939
it { is_expected.to contain_firewall('110 zack-r10k web hook') }
2040
end
2141
end

dist/profile/spec/classes/puppetdb_spec.rb

+13-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22
describe 'profile::puppetdb', :type => :class do
33
let :facts do
44
{
5-
:osfamily => 'RedHat',
6-
:concat_basedir => '/dne',
7-
:kernel => 'Linux',
5+
:kernel => 'Linux',
6+
:osfamily => 'RedHat',
7+
:operatingsystem => 'RedHat',
8+
:operatingsystemmajrelease => '7',
9+
:operatingsystemrelease => '7.2',
10+
:processors => {
11+
"count" => 2,
12+
"models" => ["Intel(R) Xeon(R) CPU E31220 @ 3.10GHz", "Intel(R) Xeon(R) CPU E31220 @ 3.10GHz"],
13+
"physicalcount" => 2
14+
},
15+
:puppetversion => '4.0.0',
16+
:concat_basedir => '/dne',
17+
:clientcert => 'puppet.example.com',
818
}
919
end
1020

dist/profile/spec/fixtures/hieradata/default.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,19 @@ local_users:
1212
- 'group1'
1313
- 'group2'
1414
password: 'encryptedstring'
15+
ssh::server::options:
16+
'PermitRootLogin' : 'yes'
17+
'Protocol' : '2'
18+
'SyslogFacility' : 'AUTHPRIV'
19+
'PasswordAuthentication' : 'yes'
20+
'GSSAPIAuthentication' : 'yes'
21+
'GSSAPICleanupCredentials' : 'yes'
22+
'AcceptEnv' : 'LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL LANGUAGE XMODIFIERS'
23+
'Subsystem' : ' sftp /usr/libexec/openssh/sftp-server'
24+
'Banner' : '/etc/issue.net'
25+
ssh::client::options:
26+
'Host *' :
27+
'SendEnv' : 'LANG LC_*'
28+
'HashKnownHosts' : 'yes'
29+
'GSSAPIAuthentication' : 'yes'
30+
'GSSAPIDelegateCredentials' : 'no'
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
dhcp_server_subnets:
3-
'10.0.0.0':
4-
broadcast : '10.0.0.255'
3+
'10.0.1.0':
4+
broadcast : '10.0.1.255'
55
netmask : '255.255.255.0'
6-
routers : '10.0.0.1'
7-
range_begin : '10.0.0.100'
8-
range_end : '10.0.0.150'
6+
routers : '10.0.1.1'
7+
range_begin : '10.0.1.100'
8+
range_end : '10.0.1.150'
99
dns_servers :
10-
- '10.0.0.1'
10+
- '10.0.1.1'
1111
dhcp_server_hosts:
1212
sample:
13-
address: 10.0.0.254
13+
address: 10.0.1.254
1414
hwaddress: 00:00:00:00:00:0a

0 commit comments

Comments
 (0)