Skip to content

Instantly share code, notes, and snippets.

@myusuf3
Created July 5, 2012 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myusuf3/3053835 to your computer and use it in GitHub Desktop.
Save myusuf3/3053835 to your computer and use it in GitHub Desktop.
#
# Cookbook Name:: sourcemetrics
# Recipe:: default
#
# Copyright 2012, swixhq.com
#
# All rights reserved - Do Not Redistribute
#
node[:users].each_pair do |username, info|
group username do
gid info[:id]
end
user username do
comment info[:full_name]
uid info[:id]
gid info[:id]
shell "/bin/bash"
supports :manage_home => true
home "/home/#{username}"
end
directory "/home/#{username}/.ssh" do
owner username
group username
mode 0700
end
file "/home/#{username}/.ssh/authorized_keys" do
owner username
group username
mode 0600
content info[:key]
end
end
node[:groups].each_pair do |name, info|
group name do
gid info[:gid]
members info[:members]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment