Run activate_custom_node_modules.sh from .bashrc
[pixelated-user-agent.git] / provisioning / modules / pixelated / manifests / source / install_useragent.pp
1 # install useragent in a virtualenv
2 # and make sure venv is activated on login
3 class pixelated::source::install_useragent {
4
5   $virtualenv_path = '/home/vagrant/.venvs/pixua'
6
7   exec { 'install-pixelated':
8     # use of "user" parameter doesn't set env variables right,
9     # see https://projects.puppetlabs.com/issues/23053
10     # therefore we need to explicitily set them here
11     environment => [ 'USERNAME=vagrant', 'HOME=/home/vagrant' ],
12     command     => "/vagrant/install-pixelated.sh -v \"${virtualenv_path}\" -n /home/vagrant/boxed_node_modules",
13     cwd         => '/vagrant',
14     user        => 'vagrant',
15     # to debug use this
16     logoutput   => true,
17     timeout     => 0
18   }
19
20   file {
21     '/home/vagrant/.bashrc':
22       owner  => 'vagrant',
23       mode   => '0644',
24       source => 'puppet:///modules/pixelated/.bashrc';
25     '/home/vagrant/activate_custom_node_modules.sh':
26       owner  => 'vagrant',
27       mode   => '0755',
28       source => 'puppet:///modules/pixelated/activate_custom_node_modules.sh';
29   }
30
31 }