Skip to content

Instantly share code, notes, and snippets.

@denisbr
Created June 6, 2013 16:34
Show Gist options
  • Save denisbr/5722903 to your computer and use it in GitHub Desktop.
Save denisbr/5722903 to your computer and use it in GitHub Desktop.
Pupil + Puppet = Puppil?
# 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