Skip to content

Commit

Permalink
Merge remote-tracking branch 'ajjahn/master' into el-compatible
Browse files Browse the repository at this point in the history
Conflicts:
	manifests/key.pp
	manifests/record.pp
	manifests/server/config.pp
	manifests/server/params.pp
	manifests/zone.pp
	spec/defines/dns__acl_spec.rb
	spec/defines/dns_zone_spec.rb
  • Loading branch information
Benoît Marcelin committed May 21, 2014
2 parents b4d1966 + ae3305c commit 743a689
Show file tree
Hide file tree
Showing 38 changed files with 522 additions and 357 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
pkg/
vendor/
.bundle
.*.sw?
pkg
spec/fixtures
Gemfile.lock
.rspec_system
.vagrant
42 changes: 24 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,30 @@ rvm:
- 1.8.7
- 1.9.3
- 2.0.0
script: bundle exec rake spec

- 2.1.0
script: bundle exec rake test
env:
matrix:
- PUPPET_GEM_VERSION="~> 2.7.0"
- PUPPET_GEM_VERSION="~> 3.0.0"
- PUPPET_GEM_VERSION="~> 3.1.0"
- PUPPET_GEM_VERSION="~> 3.2.0"

- PUPPET_VERSION="~> 2.7.0"
- PUPPET_VERSION="~> 3.1.0"
- PUPPET_VERSION="~> 3.2.0"
- PUPPET_VERSION="~> 3.3.0"
- PUPPET_VERSION="~> 3.4.0"
- PUPPET_VERSION="~> 3.5.0"
matrix:
exclude:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_VERSION="~> 3.1.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.1.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.2.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.3.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.4.0"
20 changes: 9 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rake'
gem 'puppet-lint'
gem 'rspec-puppet'
gem 'rspec-system-puppet'
gem 'puppetlabs_spec_helper'
gem 'travis'
gem 'travis-lint'
gem 'puppet-syntax'
gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.2.0'
gem 'vagrant-wrapper'
group :test do
gem "rake"
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
gem "puppet-lint"
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
end
114 changes: 18 additions & 96 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,54 +1,22 @@
GIT
remote: https://github.com/rodjek/rspec-puppet.git
revision: 03e94422fb9bbdd950d5a0bec6ead5d76e06616b
specs:
rspec-puppet (1.0.1)
rspec

GEM
remote: https://rubygems.org/
specs:
addressable (2.3.5)
backports (3.3.3)
builder (3.2.2)
coderay (1.0.9)
diff-lcs (1.2.4)
ethon (0.6.0)
ffi (>= 1.3.0)
mime-types (~> 1.18)
facter (1.7.2)
faraday (0.8.8)
multipart-post (~> 1.2.0)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
ffi (1.9.0)
gh (0.11.3)
addressable
backports
faraday (~> 0.8)
multi_json (~> 1.0)
net-http-persistent (>= 2.7)
net-http-pipeline
hashr (0.0.22)
hiera (1.2.1)
diff-lcs (1.2.5)
facter (1.7.5)
hiera (1.3.2)
json_pure
highline (1.6.19)
json_pure (1.8.0)
kwalify (0.7.2)
launchy (2.3.0)
addressable (~> 2.3)
json_pure (1.8.1)
metaclass (0.0.1)
method_source (0.8.2)
mime-types (1.24)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.7.9)
multipart-post (1.2.0)
net-http-persistent (2.9)
net-http-pipeline (1.0.1)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.6.8)
netrc (0.7.7)
nokogiri (1.5.10)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
puppet (3.2.4)
puppet (3.4.3)
facter (~> 1.6)
hiera (~> 1.0)
rgen (~> 0.6.5)
Expand All @@ -61,70 +29,24 @@ GEM
rake
rspec (>= 2.9.0)
rspec-puppet (>= 0.1.1)
pusher-client (0.3.1)
ruby-hmac (~> 0.4.0)
websocket (~> 1.0.0)
rake (10.1.0)
rbvmomi (1.6.0)
builder
nokogiri (>= 1.4.1)
trollop
rgen (0.6.5)
rgen (0.6.6)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.5)
rspec-expectations (2.14.2)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.3)
rspec-puppet (0.1.6)
rspec
rspec-system (2.2.0)
kwalify (~> 0.7.2)
net-scp (~> 1.1)
net-ssh (~> 2.6)
nokogiri (~> 1.5.9)
rbvmomi (~> 1.6)
rspec (~> 2.13)
systemu (~> 2.5)
rspec-system-puppet (2.1.0)
rspec-system (~> 2.0)
ruby-hmac (0.4.0)
slop (3.4.6)
systemu (2.5.2)
travis (1.5.1)
backports
faraday (~> 0.8.7)
faraday_middleware (~> 0.9)
gh
highline (~> 1.6)
launchy (~> 2.1)
netrc (~> 0.7)
pry (~> 0.9)
pusher-client (~> 0.3, >= 0.3.1)
typhoeus (~> 0.5)
websocket-native (~> 1.0)
travis-lint (1.7.0)
hashr (~> 0.0.22)
trollop (2.0)
typhoeus (0.6.4)
ethon (~> 0.6.0)
vagrant-wrapper (1.2.1.1)
websocket (1.0.7)
websocket-native (1.0.0)
rspec-mocks (2.14.6)

PLATFORMS
ruby

DEPENDENCIES
puppet (~> 3.2.0)
puppet (~> 3.4.0)
puppet-lint
puppet-syntax
puppetlabs_spec_helper
rake
rspec-puppet
rspec-system-puppet
travis
travis-lint
vagrant-wrapper
rspec-puppet!
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ You can also declare forwarders for a specific zone, if you don't have one in th
nameservers => ["ns1"]
}

You can change the checking of the domain name. The policy can be either warn fail or ignore.

dns::option {
check_name_master = 'fail'
check_name_slave = 'warn'
check_name_remote = 'ignore'
}

### Exported resource patterns
node default {
# Other nodes export an A record for thier hostname
Expand Down
28 changes: 20 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
require 'rspec-system/rake_task'

# These two gems aren't always present, for instance
# on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
end

PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
PuppetLint.configuration.fail_on_warnings = true

# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
# http://puppet-lint.com/checks/class_parameter_defaults/
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('disable_class_inherits_from_params_class')

exclude_paths = [
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths

desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end

desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:spec,
:syntax,
:lint,
:spec,
]
2 changes: 1 addition & 1 deletion manifests/acl.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# dns::acl { 'trusted':
# ensure => present,
# data => [ 10.0.0.0/8, 172.16.2.0/24, ]
# data => [ '10.0.0.0/8', '172.16.2.0/24', ]
# }
#
define dns::acl (
Expand Down
44 changes: 15 additions & 29 deletions manifests/key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
include dns::server::params
$cfg_dir = $dns::server::params::cfg_dir # Used in a template

file {"/tmp/${name}-secret.sh":
ensure => file,
file { "/tmp/${name}-secret.sh":
ensure => file,
mode => '0777',
content => template('dns/secret.erb'),
notify => Exec["dnssec-keygen-${name}"],
notify => Exec["dnssec-keygen-${name}"],
}


exec {"dnssec-keygen-${name}":
exec { "dnssec-keygen-${name}":
command => "/usr/sbin/dnssec-keygen -a HMAC-MD5 -r /dev/urandom -b 128 -n USER ${name}",
cwd => "${cfg_dir}/bind.keys.d",
require => [
Expand All @@ -21,13 +20,13 @@
notify => Exec["get-secret-from-${name}"],
}

exec {"get-secret-from-${name}":
exec { "get-secret-from-${name}":
command => "/tmp/${name}-secret.sh",
cwd => "${cfg_dir}/bind.keys.d",
creates => "${cfg_dir}/bind.keys.d/${name}.secret",
require => [
Exec["dnssec-keygen-${name}"],
File["${cfg_dir}/bind.keys.dr"],
File["${cfg_dir}/bind.keys.d"]
File["/tmp/${name}-secret.sh"],
],
refreshonly => true,
Expand All @@ -45,41 +44,28 @@
notify => Class['dns::server::service']
}

concat::fragment { "${name}.key-header":
Concat::Fragment {
ensure => present,
target => "${cfg_dir}/bind.keys.d/${name}.key",
order => 1,
content => template('dns/key.erb'),
require => [
Exec["get-secret-from-${name}"],
File["${cfg_dir}/bind.keys.d/${name}.secret"],
],
}

concat::fragment { "${name}.key-header":
order => 1,
content => template('dns/key.erb'),
}

concat::fragment { "${name}.key-secret":
ensure => present,
target => "${cfg_dir}/bind.keys.d/${name}.key",
order => 2,
# content => template("/etc/bind/bind.keys.d/${name}.secret"),
source => "${cfg_dir}/bind.keys.d/${name}.secret",
require => [
Exec["get-secret-from-${name}"],
File["${cfg_dir}/bind.keys.d/${name}.secret"]
],
}

concat::fragment { "${name}.key-footer":
ensure => present,
target => "${cfg_dir}/bind.keys.d/${name}.key",
order => 3,
content => '}:',
require => [
Exec["get-secret-from-${name}"],
File["${cfg_dir}/bind.keys.d/${name}.secret"],
],
content => '}:',
}
#concat::fragment{"named.conf.local.${name}.key":
# ensure => present,
# target => "${cfg_dir}/named.conf.local",
# content => templates
#}

}
10 changes: 1 addition & 9 deletions manifests/member.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
class dns::member {
@@member { $::fqdn:
domain => $::domain,
hostname => $::hostname,
ipaddress => $::ipaddress
}
}

define member ($domain, $hostname, $ipaddress) {
define dns::member ($domain, $hostname, $ipaddress) {
dns::record::a { $hostname:
zone => $domain,
data => $ipaddress,
Expand Down
Loading

0 comments on commit 743a689

Please sign in to comment.