From e09c3858893d26fb997971f6de83bcb6a758bb23 Mon Sep 17 00:00:00 2001 From: Charles Fulton Date: Sun, 25 Jun 2017 10:49:20 -0400 Subject: [PATCH] Experimental configuration for filescan; fixes #40 --- puppet/manifests/init.pp | 2 +- puppet/modules/filescan/manifests/init.pp | 34 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 puppet/modules/filescan/manifests/init.pp diff --git a/puppet/manifests/init.pp b/puppet/manifests/init.pp index 9d0f5f7..42b055b 100644 --- a/puppet/manifests/init.pp +++ b/puppet/manifests/init.pp @@ -1,3 +1,3 @@ node 'moodlehat' { - include composer, selenium, vim, moodle, ldap, webgrind + include composer, selenium, vim, moodle, ldap, webgrind, filescan } diff --git a/puppet/modules/filescan/manifests/init.pp b/puppet/modules/filescan/manifests/init.pp new file mode 100644 index 0000000..8d46989 --- /dev/null +++ b/puppet/modules/filescan/manifests/init.pp @@ -0,0 +1,34 @@ +class filescan { + vcsrepo { "/var/www/filescan": + ensure => present, + provider => git, + source => 'https://github.com/Swarthmore/filescan-server', + revision => 'master', + group => www-data, + owner => www-data, + } + + exec { 'install-filescan': + command => 'npm install', + path => '/usr/bin', + cwd => '/var/www/filescan', + require => Vcsrepo['/var/www/filescan'], + } + + exec { 'install-pm2': + command => 'npm install -g grunt-cli', + path => '/usr/bin', + require => Package['nodejs'], + creates => '/usr/bin/pm2', + } + + exec { 'run-filescan': + command => 'pm2 start index.js -s', + cwd => '/var/www/filescan', + path => '/usr/bin', + require => [ + Exec['install-pm2'], + Exec['install-filescan'], + ] + } +}