diff --git a/manifests/init.pp b/manifests/init.pp index c5f2a6779a4e49ce7e4a3004155f8165dbf23bc2..d6d2443f5b9b24bebc8b472ce6370d562be6c303 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,8 +34,9 @@ class comptoir ( $_file_app_php = "${comptoir_dir}/config/app.php" $_file_comptoir_php = "${comptoir_dir}/config/comptoir.php" $_psql_create_table_cmd = "\\i ${comptoir_dir }/${_sql_create_tables_and_procedure}" - $_barman_dev_cmd = - "/bin/sed -i -e \"s!'from' => 'barman@comptoir-du-libre.org'!'from' => 'barman-DEV@comptoir-du-libre.org'!" + $_my_sed = '/bin/sed -i -e' + $_sed_barman_dev = + "\"s!'from' => 'barman@comptoir-du-libre.org'!'from' => 'barman-DEV@comptoir-du-libre.org'!\"" # Grab source code vcsrepo { $comptoir_dir: @@ -71,7 +72,7 @@ class comptoir ( # Comptoir configuration: APP.PHP --> debug mode if $debug { exec { 'Comptoir APP.PHP enable debug': - command => "/bin/sed -i - e 's!//COMPTOIR-DEBUG!!' ${_file_app_php}", + command => "${_my_sed} 's!//COMPTOIR-DEBUG!!' ${_file_app_php}", cwd => $comptoir_dir, user => $comptoir_user, environment => [ 'HOME=/home/comptoir' ], @@ -79,7 +80,7 @@ class comptoir ( require => Exec['Install app with Composer'], } -> exec { 'Comptoir APP.PHP barman-DEV': - command => "${_barman_dev_cmd} ${_file_app_php}", + command => "${_my_sed} ${_sed_barman_dev} ${_file_app_php}", cwd => $comptoir_dir, user => $comptoir_user, environment => [ 'HOME=/home/comptoir' ], @@ -89,7 +90,7 @@ class comptoir ( # Comptoir configuration: APP.PHP exec { 'Comptoir APP.PHP salt': - command => "/bin/sed -i - e 's/__SALT__/somerandomsalt/' ${_file_app_php}", + command => "${_my_sed} 's/__SALT__/somerandomsalt/' ${_file_app_php}", cwd => $comptoir_dir, user => $comptoir_user, environment => [ 'HOME=/home/comptoir' ], @@ -97,10 +98,10 @@ class comptoir ( require => Exec['Install app with Composer'], } -> exec { 'Comptoir APP.PHP Session default': - command => "/bin/sed -i - e \"s!'php',!env('SESSION_DEFAULTS', 'php'), !'\" ${_file_app_php}", - cwd => $comptoir_dir, - user => $comptoir_user, - unless => "/bin/grep 'SESSION_DEFAULTS' ${_file_app_php}", + command => "${_my_sed} \"s!'php',!env('SESSION_DEFAULTS', 'php'), !\" ${_file_app_php}", + cwd => $comptoir_dir, + user => $comptoir_user, + unless => "/bin/grep 'SESSION_DEFAULTS' ${_file_app_php}", } # Comptoir configuration: COMPTOIR.PHP