Skip to content

Commit 7557124

Browse files
author
Ivan Atanasov (Accenture)
committed
Commit
1 parent 7577dcd commit 7557124

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

manifests/init.pp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
exec { 'init phpbrew':
101101
command => '/usr/bin/sudo /usr/bin/phpbrew init',
102-
creates => '/root/.phpbrew/bashrc',
102+
creates => '~/.phpbrew/bashrc',
103103
subscribe => File['/usr/bin/phpbrew'],
104104
refreshonly => true,
105105
}
@@ -115,23 +115,35 @@
115115
}
116116

117117
# Specify where versions of PHP will be installed.
118-
file { '/root/.phpbrew/init':
118+
file { '~/.phpbrew/init':
119119
content => "export PHPBREW_ROOT=${php_install_dir}",
120120
require => Exec['init phpbrew']
121+
}->
122+
file_line { 'Append a line to ~/.phpbrew/init':
123+
path => '~/.phpbrew/init',
124+
line => 'export PHPBREW_HOME=${php_install_dir}',
121125
}
122126

127+
file { "/etc/profile.d/phpbrew.sh":
128+
ensure => present,
129+
content => template('phpbrew/phpbrew.sh.erb'),
130+
mode => 'a+x',
131+
require => Exec['init phpbrew']
132+
}
133+
123134
# Load phpbrew configuration by default.
124135
file_line { 'add phpbrew to bashrc':
125-
path => '/root/.bashrc',
126-
line => 'source /root/.phpbrew/bashrc',
136+
path => '~/.bashrc',
137+
line => 'source ~/.phpbrew/bashrc',
127138
require => Exec['init phpbrew'],
128139
}
129140

141+
130142
exec { 'update basbrc':
131143
command => '/bin/bash'
132144
}
133145

134-
file { '/root/.phpbrew/install_extension.sh':
146+
file { '~/.phpbrew/install_extension.sh':
135147
ensure => present,
136148
mode => 'a+x',
137149
source => 'puppet:///modules/phpbrew/install_extension.sh',

templates/phpbrew.sh.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export PHPBREW_ROOT=/opt/phpbrew
2+
export PHPBREW_HOME=/opt/phpbrew
3+
source /opt/phpbrew/bashrc

0 commit comments

Comments
 (0)