Skip to content

Commit 23849e4

Browse files
committed
Merge pull request #126 from mcanevet/fix/strict_variables
Add strict_variables support when puppetdb is not on puppetmaster
2 parents 5ad2a6d + 51fcc18 commit 23849e4

6 files changed

Lines changed: 31 additions & 2 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
- PUPPET_GEM_VERSION="~> 2.7"
1515
- PUPPET_GEM_VERSION="~> 3.3"
1616
- PUPPET_GEM_VERSION="> 3.3"
17+
- PUPPET_GEM_VERSION="~> 3.5.0.rc3" STRICT_VARIABLES="yes"
1718
global:
1819
- PUBLISHER_LOGIN=puppetlabs
1920
- secure: "FInoEwh3G4Auqp+OOdIc20lDLqrV6FHzWsM8ercHWjhDRD23VI49B1qqehWjaI8lKM3D5mTvdup23IVQBJo8M0rR/yfju1NhMYFTQ5bcJIrbQ3fn4n/zSaE8gLTOtHwzjSlqTJAYjxOAnp1VdMZngqpU/RYfSk68zJD34NqfovA="

manifests/master/config.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Manage puppet configuration. See README.md for more details.
22
class puppetdb::master::config(
33
$puppetdb_server = $::fqdn,
4-
$puppetdb_port = $puppetdb::disable_ssl ? { true => 8080, default => 8081, },
4+
$puppetdb_port = defined('$puppetdb::disable_ssl') ? {
5+
true => $puppetdb::disable_ssl ? { true => 8080, default => 8081, },
6+
default => 8081,
7+
},
58
$puppetdb_soft_write_failure = false,
69
$manage_routes = true,
710
$manage_storeconfigs = true,

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
}
5252

53-
if $::is_pe == 'true' {
53+
if defined('$::is_pe') and $::is_pe == 'true' {
5454
$puppetdb_package = 'pe-puppetdb'
5555
$puppetdb_service = 'pe-puppetdb'
5656
$confdir = '/etc/puppetlabs/puppetdb/conf.d'

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# Store any environment variables away to be restored later
1414
@old_env = {}
1515
ENV.each_key {|k| @old_env[k] = ENV[k]}
16+
17+
if ENV['STRICT_VARIABLES'] == 'yes'
18+
Puppet.settings[:strict_variables]=true
19+
end
1620
end
1721

1822
c.after :each do

spec/unit/classes/init_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
:operatingsystemrelease => '6.0',
1212
:kernel => 'Linux',
1313
:concat_basedir => '/var/lib/puppet/concat',
14+
:id => 'root',
15+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
1416
}
1517
end
1618

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'spec_helper'
2+
3+
describe 'puppetdb::master::config', :type => :class do
4+
5+
let(:facts) do
6+
{
7+
:osfamily => 'Debian',
8+
:operatingsystem => 'Debian',
9+
:operatingsystemrelease => '6.0',
10+
:kernel => 'Linux',
11+
:concat_basedir => '/var/lib/puppet/concat',
12+
}
13+
end
14+
15+
context 'when using default values' do
16+
it { should compile.with_all_deps }
17+
end
18+
19+
end

0 commit comments

Comments
 (0)