2014-07-12 13:05 GMT+02:00 Jose Luis Ledesma <[email protected]>: > 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 [email protected]. > 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.
Hi, I think there is not better soluction as titles must be unique per resource type [1] Your solution seems ok for me [1]http://docs.puppetlabs.com/puppet/latest/reference/lang_resources.html#title Best regards -------------------------------------------------------------------------------------- Juan Sierra Pons [email protected] Linux User Registered: #257202 Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo GPG key = 0xA110F4FE Key Fingerprint = DF53 7415 0936 244E 9B00 6E66 E934 3406 A110 F4FE -------------------------------------------------------------------------------------- -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABS%3Dy9tbe939Dd0OG-3r9Dc-%2B3XHFV9TrwDDt8uKDNizE7JPag%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
