Skip to content

Instantly share code, notes, and snippets.

@reidmv
Created March 3, 2014 16:39
Show Gist options
  • Save reidmv/9328890 to your computer and use it in GitHub Desktop.
Save reidmv/9328890 to your computer and use it in GitHub Desktop.
Simple example of an "app" as it might look being managed by a non-root Puppet agent
class app (
$ensure = running,
) {
file { '/tmp/example.txt':
ensure => present,
content => "valuable words\n",
mode => '0644',
}
service { 'app':
ensure => $ensure,
start => '/bin/bash -c \'while true ; do echo -e "HTTP/1.1 200 OK\n\n ExampleApp $(date)" | nc -l 1500; done &\'',
stop => '/usr/bin/pkill -f ExampleApp',
status => '/usr/bin/pgrep -lf ExampleApp',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment