Skip to content

Instantly share code, notes, and snippets.

user c["username"] do
comment c["username"]
system true
shell "/usr/bin/git-shell"
home "/srv/datas/#{c['username']}"
action :create
end
c_home = File.expand_path("~#{c['username']}")
@abondis
abondis / base.rb
Created July 15, 2011 15:05
base role
{
"name": "base",
"description": "Basic role for any client",
"json_class": "Chef::Role",
"default_attributes": {
"authorization": {
"sudo": {
"groups": [
"sysadmin"
],
@abondis
abondis / chef-websites.rb
Created July 13, 2011 22:52
cookbook/recipes/websites
include_recipe "mysql::client"
node[:websites].each do |website|
db_website = search(:websites, "id:#{website} AND status:enabled").first
puts "apptype: #{db_website}"
case db_website["apptype"]
when "php", "dp", "wp"
document_root="/var/www/#{db_website["client"]}/#{db_website["id"]}"
package "php"
include_recipe "apache2::mod_php5"