Created
June 6, 2013 16:34
-
-
Save denisbr/5722903 to your computer and use it in GitHub Desktop.
Pupil + Puppet = Puppil?
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
# Install pupil quick and dirty | |
# https://github.com/pupil-monitoring/pupil | |
package { 'nodejs': | |
ensure => present, | |
} | |
package { 'npm': | |
ensure => present, | |
} | |
package { 'git': | |
ensure => present, | |
} | |
exec { 'Clone Pupil Gitrepo': | |
require => Package['git'], | |
cwd => '/opt', | |
command => '/usr/bin/git clone https://github.com/pupil-monitoring/pupil.git', | |
creates => '/opt/pupil/', | |
notify => Exec['Build Pupil'], | |
} | |
exec { 'node-gyp': | |
require => Package['npm'], | |
command => '/usr/bin/npm install node-gyp -g', | |
creates => '/usr/local/bin/node-gyp', | |
} | |
exec { 'Build Pupil': | |
require => [ Exec['node-gyp'], | |
Exec['Clone Pupil Gitrepo'] ], | |
cwd => '/opt/pupil', | |
command => '/usr/bin/npm install', | |
refreshonly => true, | |
} | |
file { '/etc/init/pupil.conf': | |
ensure => present, | |
require => Exec['Clone Pupil Gitrepo'], | |
source => '/opt/pupil/etc/pupil-upstart.conf', | |
owner => 'root', | |
mode => '0440', | |
} | |
service { 'pupil': | |
ensure => running, | |
enable => true, | |
require => [ Exec['Build Pupil'], | |
File['/etc/init/pupil.conf'] ], | |
} | |
notify { 'URL notify': | |
message => 'Pupil is now installed, check http://localhost:4942', | |
require => Service['pupil'], | |
withpath => false, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment