Hi all,
I''d like to add one ssh_key to several (1500) user accounts.
Accounts share some prefix, so I was thinking on a regular expression,
but after reading language_guide, I understood that I cannot use
reg.expr for that.
So, I have a couple of ideas:
1.) define authorized_keys file like:
file { [ ''/home/XXXuser1'' ,
''/home/XXXuser2'' .... ] :
content => $key,
mode => ...
2.-) exec some kind of script which creates the .ssh dir and adds
content.
3.-) define 1500 authorized keys
Anyone could give more elegant/efficient ideas for this purpose?
TIA,
Arnau
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Hey. have a look at my last posting: http://groups.google.com/group/puppet-users/browse_thread/thread/d74262daca8c0e8f I wrote a small wrapper that might help you here. Best, ccm. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Arnau Bria
2011-Apr-07 09:17 UTC
Re: [Puppet Users] Re: add ssh key to several user accounts
On Thu, 7 Apr 2011 02:07:52 -0700 (PDT) ccm ccm wrote:> Hey.Hi ccm.> have a look at my last posting: > > http://groups.google.com/group/puppet-users/browse_thread/thread/d74262daca8c0e8f > > I wrote a small wrapper that might help you here.Nice, but how to add same key to several accounts? cause in your last example: $team = [ ''admin@domain.tld'', ''user2@domain.tld'' ] sshauthkeys{ user2: keys => $team } sshauthkeys{ user3: keys => $team } I have to define user2/3/.... so I''ll have to define my 1500 accounts, am I right? or am I missunderstanding your code?> Best, > > ccm.Thanks! Arnau -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi again,
I''ve been thinking a little more and got more ideas, but I
don''t know if they''re possible, so I''ll appreciate
some expert opinion
on them:
1.-) modify authorized_key provider (create my own) where user
param accepts an array of elements (users)
user => [ ''user1'' , ''user2'' , ...]
I''m not sure if this is correct (or even possible, I don''t
know all
puppet types, but I don''t remember any param that accepts and array
and forces the execution of the provider several times ).
2.-) New type/provider where name is user in place of ssh_key.
Something like:
my_own_ssh_authorized_key { '' [ ''user1'',
''user2'', ''user3'' .... ] :
source => me@mycomputer
key => jkladbglbsdlgb
type => ....
}
this makes more sense as the provider will be called for each user, and
the code seems easy to implement (I''m ruby begginer) cause is an
adaptaion of current type/provider ....
Any advice?
TIA,
Arnau
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.