From 6750381bbf99ce1cbe837eacac55a8e2801e7394 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 10 Feb 2015 09:31:02 +0100 Subject: Use wheezy for vagrant source box #272 --- .../manifests/source/install_useragent.pp | 30 ++++++++++++++++++++++ .../modules/pixelated/manifests/source/npm.pp | 9 +++++++ 2 files changed, 39 insertions(+) create mode 100644 provisioning/modules/pixelated/manifests/source/install_useragent.pp create mode 100644 provisioning/modules/pixelated/manifests/source/npm.pp (limited to 'provisioning/modules/pixelated/manifests/source') diff --git a/provisioning/modules/pixelated/manifests/source/install_useragent.pp b/provisioning/modules/pixelated/manifests/source/install_useragent.pp new file mode 100644 index 00000000..8661f655 --- /dev/null +++ b/provisioning/modules/pixelated/manifests/source/install_useragent.pp @@ -0,0 +1,30 @@ +class pixelated::source::install_useragent { + + $virtualenv_path = '/home/vagrant/user-agent-venv' + + exec { 'install-pixelated': + # use of "user" parameter doesn't set env variables right, + # see https://projects.puppetlabs.com/issues/23053 + # therefore we need to explicitily set them here + environment => [ 'USERNAME=vagrant', 'HOME=/home/vagrant' ], + command => "/vagrant/install-pixelated.sh -v \"${virtualenv_path}\" -n /home/vagrant/boxed_node_modules", + cwd => '/vagrant', + user => 'vagrant', + # to debug use this + # logoutput => true, + timeout => 0 + } + + file { '/home/vagrant/.activate_custom_node_modules.sh': + owner => 'vagrant', + mode => '0600', + source => 'puppet:///modules/pixelated/activate_custom_node_modules.sh', + } + + exec { 'add_custom_node_modules_to_bashrc': + command => "/bin/bash -c 'echo \"source /home/vagrant/.activate_custom_node_modules.sh\" >> /home/vagrant/.bashrc'", + unless => "/bin/grep \"source /home/vagrant/.activate_custom_node_modules.sh\" /home/vagrant/.bashrc", + user => 'vagrant', + require => [Exec['install-pixelated'], File['/home/vagrant/.activate_custom_node_modules.sh']] + } +} diff --git a/provisioning/modules/pixelated/manifests/source/npm.pp b/provisioning/modules/pixelated/manifests/source/npm.pp new file mode 100644 index 00000000..8926d6fd --- /dev/null +++ b/provisioning/modules/pixelated/manifests/source/npm.pp @@ -0,0 +1,9 @@ +# installs npm from source +class pixelated::source::npm { + + exec { 'install_npm': + command => '/usr/bin/curl -s -L https://npmjs.org/install.sh | /bin/sh', + unless => '/usr/bin/test -e /usr/bin/npm', + require => Package['nodejs-legacy']; + } +} -- cgit v1.2.3