Issue #3809 has been updated by James Turnbull.

Okay I think the problem here is that you're overriding twice.  That doesn't 
work.  You should only override once and then call realize on the user.
----------------------------------------
Bug #3809: Problem with virtual resources
http://projects.puppetlabs.com/issues/3809

Author: Matteo Cerutti
Status: Needs more information
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.25.4
Keywords: 
Branch: 


Hi,

I'm trying to manage ssh authorized keys through the use of virtual resources.

<pre>
  class ssh::keys {
    @ssh_authorized_key {"us...@hosta":
                            key  => "...";

                         "us...@hostb":
                            key  => "...";

                         "us...@hostc":
                            key  => "...";
   }
}
</pre>

Now i set up a few user classes which I will include in a node definition. I 
realize inside the user classes the ssh keys I am interested in importing into 
their authorized_keys file, this happens by overriding the user parameter.

<pre>
 class users::testA {
    Ssh_authorized_key <| title == "us...@hosta" |> {
        user    => "testA"
    }

    Ssh_authorized_key <| title == "us...@hostb" |> {
        user    => "testA"
    }
}

class users::testB {
    Ssh_authorized_key <| title == "us...@hostb" |> {
        user    => "testB"
    }
}

</pre>

# Now I include the user classes.

<pre>

node test {
    include users::testA
    include users::testB
}
</pre>

Note that the is not connection between usernames and hostnames.

This setup works but apparently I cannot realize the same resource twice on the 
same machine. Let me explain, for the user testA
<pre>
    Ssh_authorized_key <| title == "us...@hostb" |> {
        user    => "testA"
    }
</pre>

this will be realized but the second virtual resource for the user testB does 
not seem to the realized as I cannot see anything is the authorized_keys. This 
is true for the same resource, if I comment one or the other out then the one 
left out will be realized.

Any idea?

Thanks.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to