Created
October 14, 2010 13:52
-
-
Save glarizza/626193 to your computer and use it in GitHub Desktop.
This file contains 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
# /etc/puppet/manifests/classes/crankd.pp | |
class crankd { | |
# Global File defaults | |
File { owner => "root", group => "wheel", } | |
# Ensure the required directories | |
file { "/Library/HuronHS": | |
ensure => directory, | |
} | |
file { "/usr/local/sbin": | |
ensure => directory, | |
} | |
# Copy down the required Python2.5 folder | |
file { "/Library/HuronHS/Python2.5": | |
recurse => true, | |
source => "puppet:///files/crankd/HuronHS/", | |
require => File["/Library/HuronHS"], | |
mode => 0755, | |
} | |
# Copy down the crankd folder | |
file { "/Library/Application Support/crankd": | |
recurse => true, | |
source => "puppet:///files/crankd/Application Support/", | |
mode => 0755, | |
} | |
# This is the plist that crankd uses for listening to events | |
file { "/Library/Preferences/com.huronhs.crankd.plist": | |
ensure => file, | |
source => "puppet:///files/crankd/crankd-config.plist", | |
mode => 0644, | |
} | |
# This is the crankd.py script itself | |
file { "/usr/local/sbin/crankd.py": | |
ensure => file, | |
source => "puppet:///files/crankd/crankd.py", | |
mode => 0755, | |
before => File["/Library/Preferences/com.huronhs.crankd.plist"], | |
require => [File["/Library/Application Support/crankd"], File["/Library/HuronHS/Python2.5"]], | |
} | |
# This launchdaemon keeps crankd.py running | |
file { "/Library/LaunchDaemons/com.huronhs.crankd.plist": | |
ensure => file, | |
source => "puppet:///files/crankd/com.huronhs.crankd.plist", | |
mode => 0644, | |
require => File["/Library/Preferences/com.huronhs.crankd.plist"], | |
} | |
# We setup a service for the launchd plist file we created above and ensure that it's running | |
service { "com.huronhs.crankd.plist": | |
enable => true, | |
ensure => running, | |
subscribe => File["/Library/LaunchDaemons/com.huronhs.crankd.plist"], | |
require => File["/Library/LaunchDaemons/com.huronhs.crankd.plist"], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rather than
file { "/Library/Preferences/com.huronhs.crankd.plist":
ensure => file,
source => "puppet:///files/crankd/crankd-config.plist",
mode => 0644,
}
do
file { "/Library/Preferences/com.huronhs.crankd.plist":
ensure => file,
source => "puppet:///files/crankd/crankd-config.plist",
mode => 0644,
}