Skip to content

Instantly share code, notes, and snippets.

@Sauraus
Created June 26, 2015 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sauraus/5bbb5952aad2682ba7fc to your computer and use it in GitHub Desktop.
Save Sauraus/5bbb5952aad2682ba7fc to your computer and use it in GitHub Desktop.
# Support whyrun
def whyrun_supported?
true
end
action :create do
if @current_resource.exists
Chef::Log.info "#{ @current_resource } already exists - nothing to do."
else
converge_by("Create #{ @current_resource }") do
create_user
end
end
end
def create_user
user current_resource.name do
comment current_resource.comment
supports manage_home: true
ignore_failure true
end
....
my_lwrp 'eng' do
comment user[:comment]
ssh_keys user[:ssh_keys]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment