Last active
October 6, 2015 11:31
-
-
Save zts/cb07a575d9da45ef1a17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if node["etc"]["passwd"].has_key?(node["rundeck"]["username"]) | |
rundeck_home = node["etc"]["passwd"][node["rundeck"]["username"]]["dir"] | |
else | |
puts "User rundeck not exist" | |
rundeck_home = "/home/#{node["rundeck"]["username"]}" | |
user node["rundeck"]["username"] do | |
action :create | |
home rundeck_home | |
manage_home true | |
system true | |
gid node["rundeck"]["username"] | |
notifies :reload, "ohai[reload_rundeck_user]", :immediately | |
end | |
end | |
directory "#{rundeck_home}/.ssh" do | |
owner node["rundeck"]["username"] | |
group node["rundeck"]["username"] | |
mode '700' | |
action :create | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment