Sha256: 641e6d66b02ee9201e49ec27333aa251ea4223df8498e2d81cf6414ff62238ab
Contents?: true
Size: 892 Bytes
Versions: 9
Compression:
Stored size: 892 Bytes
Contents
include_recipe "ruby-shadow" if node[:users] node[:users].keys.each do |username| config = node[:users][username] group username do end user username do comment config[:comment] gid username # 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
9 entries across 9 versions & 1 rubygems