Comments (3)
Thanks, but that's not what I'm asking, I need to have only simple line on site.pp for each domain, I don't want to paste all that code there. That's why I'm creating a "define"
Also, even if I paste that at the beggining of the site.pp, I still need to add the zone to the zone hash, I mean, to add a domain I have to add it in two places, that's what I want to avoid.
from puppet-bind.
@pablokbs last one wouldn't work so i deleted it something like this should work though (untested and probably syntax spelling errors but you should get the idea)
site.pp
$domains => {
example.com => { domain_ip => '10.0.0.1', spf => true, dkim => true, mx => "mx" },
example.org => { domain_ip => '10.0.0.1', spf => true, dkim => true, mx => "mx" }
}
class {'::custom_bind':
domains => $domains
}
custom_bind/init.pp
class custom_bind ($domains) {
include bind
bind::server::conf { '/etc/named.conf':
listen_on_addr => [ 'any' ],
listen_on_v6_addr => [ 'any' ],
forwarders => [ '8.8.8.8', '8.8.4.4' ],
allow_query => [ 'localnets' ],
includes => [ '/etc/named/zones.conf' ]
}
create_resources(custom_bind::domain, $domains)
file {'/etc/named/zones.conf':
ensure => present,
content => template('bind/zones.conf.erb'),
}
}
custom_bind/domain.pp
define custom_bind::domain ($domain_ip, $spf, $dkim, $mx) {
bind::server::file { "${name}.zone":
zone_type => "master",
content => template('bind/zone.erb'),
}
}
zone.conf.erb
<% @domains.each_key do |zone| -%>
zone <%= zone %> {
type master;
file <%= zone %>;
};
from puppet-bind.
I had to make some adjustments but it worked perfectly, thank you very much.
from puppet-bind.
Related Issues (20)
- Hiera Support HOT 1
- on Debain bullseye file_bindkeys is not '/etc/named.iscdlv.key'
- Support for response-policy? HOT 1
- BIND does not load configuration due to rmeoved dnssec-enable and dnssec-lookaside options HOT 1
- Upstream release with Puppet 8 support? HOT 1
- missing controls clause in named.conf HOT 2
- Ubuntu 16.04 HOT 2
- dynamic overwrite? HOT 3
- Views are sorted alphabetically, not in file order HOT 2
- please consider supporting replace for bind:.server::file
- Support 'forward' configuration option
- Add also_notify to options HOT 1
- tsig/keys documentation
- Hard coded logging locations HOT 5
- Undefined method for 'join'
- Assistance tweaking this package for Ubuntu? HOT 1
- Please add support for statistics-channels
- split config files in directory
- Puppet 5.x support HOT 1
- rndc freeze|thaw
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-bind.