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