Skip to content

Instantly share code, notes, and snippets.

Created February 3, 2017 11:08
Show Gist options
  • Save anonymous/1320069d720f17a5ec2f36ca058c1a80 to your computer and use it in GitHub Desktop.
Save anonymous/1320069d720f17a5ec2f36ca058c1a80 to your computer and use it in GitHub Desktop.
include_recipe 'aws'
include_recipe 'user'
node.default['sshusers']['users'].each do |user|
user_account user[:name] do
ssh_keygen false
if user[:locked]
action [:create, :lock]
ssh_keys [""]
else
action [:create, :unlock]
ssh_keys user[:ssh_public_keys]
end
end
end
attributes.rb
default['sshusers']['users'] =
[
{
:name => 'user.name',
:sudo => true,
:ssh_public_keys => ['public_keyxyz']
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment