Sha256: 4df37700578cfe2da4051b979ea3bc339bacee0e4df4e80989064290cce26646

Contents?: true

Size: 842 Bytes

Versions: 16

Compression:

Stored size: 842 Bytes

Contents

include_recipe "ruby-shadow"

if node[:users]

  node[:users].keys.each do |username|
    config = node[:users][username]
    user username do
      comment config[:comment]

      # Added config for home in this site specific cookbook:
      if config[:home]
        if config[:home] != '/root'
          parent_dir = config[:home].split("/")[0..-2].join("/")
          FileUtils.mkdir_p(parent_dir) unless File.exists?(parent_dir)
        end

        home_path = config[:home]
        home home_path
      else
        home_path = "/home/#{username}"
        home home_path
      end
      
      Kernel.system "chmod 700 #{home_path}" if config[:hidden_home]
      
      shell "/bin/bash"
      password config[:password]
      supports :manage_home => true
      action [:create, :manage]
    end  
    
    add_keys username
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
solokit-0.1.7 cookbooks/site/users/recipes/default.rb
solokit-0.1.6 cookbooks/site/users/recipes/default.rb
solokit-0.1.5 cookbooks/site/users/recipes/default.rb
solokit-0.1.4 cookbooks/site/users/recipes/default.rb
solokit-0.1.3 cookbooks/site/users/recipes/default.rb
solokit-0.1.2 cookbooks/site/users/recipes/default.rb
solokit-0.1.1 cookbooks/site/users/recipes/default.rb
solokit-0.1.0 cookbooks/site/users/recipes/default.rb
solokit-0.0.9 cookbooks/site/users/recipes/default.rb
solokit-0.0.8 cookbooks/site/users/recipes/default.rb
solokit-0.0.7 cookbooks/site/users/recipes/default.rb
solokit-0.0.6 cookbooks/site/users/recipes/default.rb
solokit-0.0.5 cookbooks/site/users/recipes/default.rb
solokit-0.0.4.1 cookbooks/site/users/recipes/default.rb
solokit-0.0.4 cookbooks/site/users/recipes/default.rb
solokit-0.0.3 cookbooks/site/users/recipes/default.rb