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

regards,


On Wed, Jul 30, 2014 at 2:42 PM, Jason Antman <[email protected]> wrote:

> Just in case anyone comes by this in the future, maybe I'm missing
> something, but why not keep this really simple (did you read the type
> reference docs for host?):
>
> @@host { "${::hostname}_exported" :
>
>   name    => $::hostname,
>
>   ensure  => present,
>
>   ip         => $secondary_ip,
>
> }
>
>
>
> host { $::hostname :
>
>   ensure  => present,
>
>   ip      => $primary_ip
> }
>
>
> On Tue, Jul 15, 2014 at 3:22 PM, José Luis Ledesma <
> [email protected]> wrote:
>
>> It worked as you thought.
>>
>> Many thanks, perhaps the code is not so nice, but the config applied is,
>> by far, better.
>>
>> Regards,
>> El 15/07/2014 15:24, "jcbollinger" <[email protected]> escribió:
>>
>>
>>>
>>> On Monday, July 14, 2014 8:55:38 AM UTC-5, Kristof Willaert wrote:
>>>>
>>>> [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.
>>>>
>>>
>>>
>>> You're not misinterpreting the docs, but you *are* misinterpreting my
>>> statement.  Although *generally* the node exporting a resource can
>>> collect that resource, if the OP used the approach I described then his
>>> nodes would not be able to collect the Site::Secondary_host resources they
>>> declare themselves.  If they tried to collect their own, then it would
>>> yield a duplicate Host resource (from the defined type body; because he
>>> already, separately, declares a Host for the node itself).  The key there
>>> is that -- I think -- the type's body will not be evaluated by the
>>> declaring node for instances that it does not collect, even those that it
>>> declares itself.
>>>
>>>
>>> John
>>>
>>>  --
>>> 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/e05c726c-b0ca-40be-8f5a-a38df765a9cf%40googlegroups.com
>>> <https://groups.google.com/d/msgid/puppet-users/e05c726c-b0ca-40be-8f5a-a38df765a9cf%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  --
>> 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/CAF_B3ddtHrbANnKirUdvic9wgC7DxWmgtLy%3D4_TErgEmn5vMWQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/puppet-users/CAF_B3ddtHrbANnKirUdvic9wgC7DxWmgtLy%3D4_TErgEmn5vMWQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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/CAFt4V4n3EW8oWAXTf6xgTF%3DG0%2B_KnU6SHL8CJ-pE02jEXJabZw%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CAFt4V4n3EW8oWAXTf6xgTF%3DG0%2B_KnU6SHL8CJ-pE02jEXJabZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
José Luis Ledesma

-- 
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/CAF_B3ddgTFE-yj%2B9Af-SokHdGkK1HXgz_Ef%2B4hwtr%3D4Oj1xq-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to