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,
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.
@@host { $::hostname :
ensure => present,
ip => $secondary_ip,
}
Also on host A:
Host <<| title == '$::hostname'|>> { ip => $primary_ip }
On host B (the remote host):
Host <<| title == 'hostA'|>>
Kind regards,
kristof
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABS%3Dy9tbe939Dd0OG-3r9Dc-%2B3XHFV9TrwDDt8uKDNizE7JPag%40mail.gmail.com.
Hi,Shall this be a bug? Teorically a exported resource is not applied in the managed node if you don't collect it, so it should not collide with an "applied" resource. thoughs?
You will not be able to collect that resource on the node that exports it (you would again -- and rightfully -- get a duplicate resource complaint), but I think otherwise you should be ok.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b2350416-f2aa-4e0c-8f90-a8c31021e37e%40googlegroups.com.
[snip]You will not be able to collect that resource on the node that exports it (you would again -- and rightfully -- get a duplicate resource complaint), but I think otherwise you should be ok.The documentation for exported resources suggests otherwise:
Any node (including the node that exported it) can then collect the exported resource and manage its own copy of it. [1]
I must say I haven't tried it myself, but unless I misinterpret the sentence above, it should be possible.
It worked as you thought.
Many thanks, perhaps the code is not so nice, but the config applied is, by far, better.
Regards,
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/e05c726c-b0ca-40be-8f5a-a38df765a9cf%40googlegroups.com.
@@host { "${::hostname}_exported" :
name => $::hostname,
ensure => present,
ip => $secondary_ip,
}
host { $::hostname :
ensure => present,
ip => $primary_ip
}To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAF_B3ddtHrbANnKirUdvic9wgC7DxWmgtLy%3D4_TErgEmn5vMWQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAFt4V4n3EW8oWAXTf6xgTF%3DG0%2B_KnU6SHL8CJ-pE02jEXJabZw%40mail.gmail.com.
Hi,this doesn't work. You cannot have two resources with the same name:Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Host[XXXX] is already declared in file XXXXX/init.pp:17; cannot redeclare at XXXX/host.pp:5 on node XXXXX