Assign multipe PublicKeys to multiple System Users

21 views
Skip to first unread message

tommodore

unread,
May 23, 2012, 8:51:15 AM5/23/12
to Puppet Users
Hi,

I'm trying to assign PublicKeys from a set of users to multiple System
Users like

node example.example.com {
include ssh::auth
ssh::auth::server { ["thomas", "peter", "steve", ]: user =>
"appuser" }
ssh::auth::server { ["thomas", "peter", ]: user => "admin" }
}

I got following error:
Could not retrieve catalog from remote server: Error 400 on SERVER:
Duplicate definition: Ssh::Auth::Server[thomas] is already defined in
file /etc/puppet/manifests/nodes.pp

Does anyone knows a workaround for this?

Thanks
Thomas

jcbollinger

unread,
May 24, 2012, 9:19:51 AM5/24/12
to Puppet Users
Much depends on the definition of ssh::auth:server, which you did not
provide. I took a quick look around for a public release of it
somewhere, but nothing turned up. I can therefore speak only in
generalities. There are three possibilities:

1) If the ssh::auth::server definition supports it, you can specify
the "user" property as an array:
node example.example.com {
include ssh::auth
ssh::auth::server { 'steve': user => 'appuser' }
ssh::auth::server { ['thomas', 'peter', ]: user => ['admin',
'appuser'] }
}

2) Alternatively, it may be possible to separate the resource title
from the system user. It could be something similar to this:

node example.example.com {
include ssh::auth
ssh::auth::server { 'steve': user => 'appuser' }
ssh::auth::server { 'thomas-admin':
sys_user => 'thomas',
user => 'admin'
}
ssh::auth::server { 'peter-admin':
sys_user => 'peter',
user => 'admin'
}
ssh::auth::server { 'thomas-appuser':
sys_user => 'thomas',
user => 'appuser'
}
ssh::auth::server { 'peter-appuser':
sys_user => 'peter',
user => 'appuser'
}
}

3) If the ssh::auth::user type does not support either of the above
approaches, then you'll need to modify it to do so or replace it with
something different that does.


John
Reply all
Reply to author
Forward
0 new messages