Created
July 6, 2011 16:24
-
-
Save mikebannister/1067661 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
# | |
# Cookbook Name:: crontab | |
# Definition:: crontab | |
# | |
#sets the crontab for a user | |
define :crontab, :username => :root, :filename => nil do | |
filename = params[:filename] | |
username = params[:username] | |
crontabfile = "/tmp/chef-crontab-#{filename}" | |
template "crontab" do | |
path crontabfile | |
source filename | |
mode 0655 | |
variables(variables) | |
end | |
execute "crontab" do | |
command "crontab -u #{username} #{crontabfile}" | |
action :run | |
timeout 60 | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment