diff options
author | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-06-02 10:57:16 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-02 10:57:16 -0300 |
commit | 72af667b0b9d2383ed42688f4cf11075a85c81e2 (patch) | |
tree | 661b3fdc57835f746732b3011fb46124d413013d /provisioning/modules/pixelated/manifests/source | |
parent | 377ffe8bc17bbcf00b6342428bb91eb3f2e41a20 (diff) | |
parent | 8659b2e6f9b405e2d763fc1fa3d3afc47d8e44ea (diff) |
Merge pull request #1078 from pixelated/fix-vagrant
Reverted code that broke vagrant configurations
Diffstat (limited to 'provisioning/modules/pixelated/manifests/source')
-rw-r--r-- | provisioning/modules/pixelated/manifests/source/install_useragent.pp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/provisioning/modules/pixelated/manifests/source/install_useragent.pp b/provisioning/modules/pixelated/manifests/source/install_useragent.pp index d79d4144..8afbac0c 100644 --- a/provisioning/modules/pixelated/manifests/source/install_useragent.pp +++ b/provisioning/modules/pixelated/manifests/source/install_useragent.pp @@ -1,4 +1,4 @@ -# install useragent in a virtualenv +# install useragent in a virtualenv, deploy helper script # and make sure venv is activated on login class pixelated::source::install_useragent { @@ -9,18 +9,34 @@ class pixelated::source::install_useragent { # see https://projects.puppetlabs.com/issues/23053 # therefore we need to explicitily set them here environment => [ 'USERNAME=vagrant', 'HOME=/home/vagrant' ], - command => '/usr/bin/make install', + command => "/vagrant/install-pixelated.sh -v \"${virtualenv_path}\" -n /home/vagrant/boxed_node_modules", cwd => '/vagrant', user => 'vagrant', # to debug use this - logoutput => true, + # logoutput => true, timeout => 0 } - file { '/home/vagrant/.bashrc': + file { '/home/vagrant/activate_custom_node_modules.sh': owner => 'vagrant', - mode => '0644', - source => 'puppet:///modules/pixelated/.bashrc', + mode => '0755', + source => 'puppet:///modules/pixelated/activate_custom_node_modules.sh', } + exec { 'add_custom_node_modules_to_bashrc': + command => "/bin/bash -c 'echo \"source ${virtualenv_path}/bin/activate\" >> /home/vagrant/.bashrc'", + unless => "/bin/grep \"source ${virtualenv_path}/bin/activate\" /home/vagrant/.bashrc", + user => 'vagrant', + require => [Exec['install-pixelated'], File['/home/vagrant/activate_custom_node_modules.sh']] + } + exec { 'add_custom_node_path_to_bashrc': + command => "/bin/bash -c 'echo NODE_PATH=/home/vagrant/boxed_node_modules/node_modules/ >> /home/vagrant/.bashrc'", + unless => '/bin/grep NODE_PATH /home/vagrant/.bashrc', + user => 'vagrant', + } + exec { 'add_rule_to_change_to_vagrant_folder_on_login': + command => "/bin/echo 'cd /vagrant' >> /home/vagrant/.bashrc", + unless => "/bin/grep 'cd /vagrant' /home/vagrant/.bashrc", + user => 'vagrant', + } } |