1

Hope someone could help me with my issue )

So, I have several VHost which managed by puppet, including DNS (unbound). One vhost was deleted some time ago and and recreated recently with new IP address (I can't use old IP :( ). But, when puppet running on dns server I got next error:

Nov 17 15:30:19 dns puppet-agent[39154]: Could not retrieve catalog
from remote server: Error 400 on SERVER: Duplicate declaration:
Unbound::Record[host.example.com] is already declared in file
puppetdb_entry.pp:13; cannot redeclare at puppetdb_entry.pp:13 
on node dns.example.com

Here is content of puppetdb_entry.pp:

define component::unbound::puppetdb_entry (
  $hostname,
  $ipaddress_eth0,
  $fqdn = $name
) {
  $desired_fqdn =
 "${hostname}.${component::unbound::puppetdb_hosts::mock_domain}"

  unbound::record { $desired_fqdn:
    type    => 'A',
    content => $ipaddress_eth0,
    ttl     => 380
  }
}

I've read related topics on serverfault but most of them has declaring parameters twice but I'm not (at least I can't see where I declare twice).

So I hope you guys could help me understand where I'm wrong.

Thanks in advance!

Serge
  • 11
  • 2
  • Do two servers share the same FQDN? In that case $desired_fqdn would not be unique. – mzhaase Nov 17 '16 at 16:35
  • Yes they do, new server has the same name/FQDN as old. But why that is the problem? Also tried delete old host from UBNDOUND chache (with ubnound restart) - without luck. – Serge Nov 18 '16 at 07:14
  • Because resource names have to be unique. This is called by the old and the new server, so its not unique anymore. – mzhaase Nov 18 '16 at 09:02
  • _Because resource names have to be unique_ Yes, I understand that, I can't understand what should I do to replace old value with new (IP address in this case). – Serge Nov 18 '16 at 09:15
  • I mean, I know in what way it could be done if **unbound** will managed manually, in case it managed by puppet I'm confused, because I'm new with it – Serge Nov 18 '16 at 09:21
  • 1
    puppet node deactivate – mzhaase Nov 18 '16 at 09:22

0 Answers0