Navigation Menu

Skip to content

Commit

Permalink
Support the dns_powerdns plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Sep 2, 2015
1 parent 44c0eca commit b00a5fa
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions .sync.yml
Expand Up @@ -3,3 +3,4 @@ Rakefile:
param_docs_pattern:
- manifests/init.pp
- manifests/plugin/*.pp
- manifests/plugin/dns/*.pp
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -18,7 +18,7 @@ PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}

require 'puppet-lint-param-docs/tasks'
PuppetLintParamDocs.define_selective do |config|
config.pattern = ['manifests/init.pp', 'manifests/plugin/*.pp']
config.pattern = ['manifests/init.pp', 'manifests/plugin/*.pp', 'manifests/plugin/dns/*.pp']
end

task :default => [:validate, :lint, :spec]
32 changes: 32 additions & 0 deletions manifests/plugin/dns/powerdns.pp
@@ -0,0 +1,32 @@
# = Foreman Proxy PowerDNS DNS plugin
#
# This class installs the PowerDNS DNS plugin for Foreman proxy
#
# === Parameters:
#
# $mysql_hostname:: MySQL server hostname
#
# $mysql_username:: MySQL server username
#
# $mysql_password:: MySQL server password
#
# $mysql_database:: MySQL server database
#
# $pdnssec:: pdnssec command to run rectify-zone with. Can be an empty string.
#
class foreman_proxy::plugin::dns::powerdns (
$mysql_hostname = 'localhost',
$mysql_username = 'pdns',
$mysql_password = '',
$mysql_database = 'pdns',
$pdnssec = 'pdnssec',
) {
validate_string($mysql_hostname, $mysql_username, $mysql_password, $mysql_database, $pdnssec)

foreman_proxy::plugin { 'dns_powerdns':
} ->
foreman_proxy::settings_file { 'dns_powerdns':
module => false,
template_path => 'foreman_proxy/plugin/dns_powerdns.yml.erb',
}
}
6 changes: 6 additions & 0 deletions templates/plugin/dns_powerdns.yml.erb
@@ -0,0 +1,6 @@
---
:powerdns_mysql_hostname: "<%= scope.lookupvar('::foreman_proxy::plugin::dns::powerdns::mysql_hostname') %>"
:powerdns_mysql_username: "<%= scope.lookupvar('::foreman_proxy::plugin::dns::powerdns::mysql_username') %>"
:powerdns_mysql_password: "<%= scope.lookupvar('::foreman_proxy::plugin::dns::powerdns::mysql_password') %>"
:powerdns_mysql_database: "<%= scope.lookupvar('::foreman_proxy::plugin::dns::powerdns::mysql_database') %>"
:powerdns_pdnssec: "<%= scope.lookupvar('::foreman_proxy::plugin::dns::powerdns::pdnssec') %>"

0 comments on commit b00a5fa

Please sign in to comment.