Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   user u['id'] do
  2.     uid u['uid']
  3.     gid u['gid']
  4.     shell u['shell']
  5.     comment u['comment']
  6.     supports :manage_home => true
  7.     home home_dir
  8.     action u['disabled'] ? :lock : :create
  9.     notifies :create, "ruby_block[reset group list]", :immediately
  10.   end
  11.  
  12.  
  13.   if u['disabled']
  14.     file "#{home_dir}/.ssh/authorized_keys" do
  15.       action :delete
  16.     end
  17.   else
  18.     template "#{home_dir}/.ssh/authorized_keys" do
  19.       source "authorized_keys.erb"
  20.       owner u['id']
  21.       group u['gid'] || u['id']
  22.       mode "0600"
  23.       variables :ssh_keys => u['ssh_keys']
  24.     end
  25.   end