Jose Luis Ledesma
2014-Jul-12 11:05 UTC
[Puppet Users] duplicated resource with an exported resource
Hi all,
I have found a problem setting up exported resources. The problem is
that for every hosts I want to define in its /etc/hosts the primary ip, but
I want to export a secondary ip with the same hostname that will be
collected just by one server. So I defined:
@@host { $::hostname :
ensure => present,
ip => $secondary_ip,
}
host { $::hostname :
ensure => present,
ip => $primary_ip
}
but when I launch puppet a duplicated resource arises:
# puppet agent -t
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Duplicate declaration: Host[XXXXX] is already declared in file
/etc/puppet/manifests/init.pp:15; cannot redeclare at
/etc/puppet/manifests/init.pp:5 on node XXXX
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
I have just implemented a workaround:
@@host { "${::hostname}-secondary" :
ensure => present,
ip => $secondary_ip,
host_alises => $::hostname,
}
but I wanted to know if there is a better solution.
thanks,
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/bc657bc3-9659-46b4-b713-26d9ebea9f64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.