Skip to content

Instantly share code, notes, and snippets.

@parshap
Created December 5, 2013 23:44
Show Gist options
  • Save parshap/7816222 to your computer and use it in GitHub Desktop.
Save parshap/7816222 to your computer and use it in GitHub Desktop.
Chef cookbook get path to zsh and create user
NAME = "parshap"
# Create a resource to create the user (but do not execute)
create_user = user NAME do
gid NAME
supports :manage_home => true
home HOME
action :nothing
end
# Get path to zsh and execute the create_user resource
ruby_block "#{NAME} create user" do
block do
user_resource.shell `which zsh`.chop
user_resource.run_action(:create)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment