Skip to content

Commit

Permalink
Run phpbrew init as vagrant user too.
Browse files Browse the repository at this point in the history
  • Loading branch information
iatanasov77 committed May 21, 2020
1 parent 276a247 commit 30bec40
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
subscribe => File['/usr/bin/phpbrew'],
refreshonly => true,
}

file { $php_install_dir:
ensure => 'directory',
require => Exec['init phpbrew'],
Expand All @@ -124,6 +124,19 @@

# Load phpbrew configuration by default.
if $system_wide {
###################################################################
# Init as vagrant user to use when need to switch php
# and use it from vagrant console for example for composer command
###################################################################
exec { 'init phpbrew as vagrant':
command => '/usr/bin/phpbrew init',
creates => '/home/vagrant/.phpbrew/bashrc',
subscribe => File['/usr/bin/phpbrew'],
refreshonly => true,
user => "vagrant",
environment => ["HOME=/home/vagrant"],
}

file { '/opt/phpbrew/bashrc':
ensure => present,
content => template('phpbrew/bashrc.erb'),
Expand Down

0 comments on commit 30bec40

Please sign in to comment.