尝试使用人偶模块camptocamp绑定创建主从(冗余)DNS。在从属配置文件中,我已将 transfer_source =>'192.168.1.20'设置为主控IP:192.168.1.20。然后,它应该同步dns记录并将其从主机复制到从机。
但是我抱怨说它只能被设置为奴隶区。我遵循了来自伪造的自述文件中的自述文件:https://forge.puppet.com/camptocamp/bind/readme
dnsmaster.pp
class profile::dnsbind::server {
include 'bind'
bind::zone {'example.com':
ensure => 'present',
zone_contact => 'contact.example.com',
zone_ns => ['ns0.example.com'],
zone_serial => '2012112901',
zone_ttl => '604800',
zone_origin => 'example.com',
}
bind::a { 'example.com':
ensure => 'present',
zone => 'example.com',
ptr => false,
hash_data => {
'host1' => { owner => '192.168.0.1', },
'host2' => { owner => '192.168.0.2', },
},
}
}
dnsslave.pp
class profile::dnsbind::server_slave {
include 'bind'
bind::zone {'example.com':
ensure => 'present',
zone_contact => 'contact.example.com',
zone_ns => ['ns0.example.com'],
zone_serial => '2012112901',
zone_ttl => '604800',
zone_origin => 'example.com',
transfer_source => '192.168.1.20',
}
}
错误消息:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Zone 'example.com': transfer_source can be set only for slave zones! at /etc/puppetlabs/code/environments/production/modules/bind/manifests/zone.pp:80:5 at /etc/puppetlabs/code/environments/production/manifests/profile_dns2.pp:5 on node centos7-3
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
答案 0 :(得分:1)
然后应将dns记录从主同步并复制到 奴隶。
但是我抱怨说它只能设置为奴隶区。
很明显,模块无法识别您正在尝试配置从属区域。您想怎么知道?好吧,显然不是来自transfer_source
属性的存在。
我遵循了来自puppet forge的自述文件: https://forge.puppet.com/camptocamp/bind/readme
我相信您是从自述文件中提取示例区域定义(对于主区域)开始的,并且我同意您认为本模块的文档有点伪劣。但是,尽管如此,还是要考虑真正地仔细阅读文档,而不仅仅是浏览文档。完成后,您会在zone_type
参数的文档之后立即找到transfer_source
参数的文档:
$ zone_type = master
指定区域是否为主/从/正向。
使用它来指定您正在配置从属区域。