Skip to content
Snippets Groups Projects
Commit 0de85a4e authored by Matthieu Faure's avatar Matthieu Faure
Browse files

app.php: make it idempotent from a puppet point of view

parent 6efb58c4
No related branches found
No related tags found
1 merge request!5Resolve "Create Comptoir Puppet module"
Pipeline #3966 failed
......@@ -26,6 +26,7 @@ class comptoir (
String $comptoir_db_password = 'comptoir',
String $comptoir_db_host = 'localhost',
String $comptoir_db_port = '5432',
Boolean $debug = false,
) {
# Inner variables
......@@ -48,14 +49,6 @@ class comptoir (
# TODO Improve puppet code to be idempotent,
# TODO ...maybe by creating an idempotent SQL, see https://stackoverflow.com/questions/33631186/how-do-i-make-alter-column-idempotent
# 2019-03-17 MFaure: could no make the connection validation work :(
# postgresql_conn_validator { 'validate my postgres connection':
# host => $comptoir_db_host,
# port => $comptoir_db_port,
# db_username => $comptoir_db_user,
# db_password => $comptoir_db_password,
# db_name => $comptoir_db_name,
# } ->
postgresql_psql { 'Create SQL tables & procedures':
command => "\i ${comptoir_dir}/${_SQL_create_tables_and_procedure}",
db => $comptoir_db_name,
......@@ -72,11 +65,12 @@ class comptoir (
}
# Comptoir configuration: APP.PHP
-> Exec { 'Comptoir remove debug':
-> Exec { 'Comptoir enable debug':
command => "/bin/sed -i -e \"s/\/\/COMPTOIR-DEBUG//\" $_file_app_php",
cwd => $comptoir_dir,
user => $comptoir_user,
environment => [ 'HOME=/home/comptoir' ],
onlyif => [ $debug, "grep '//COMPTOIR-DEBUG' $_file_app_php" ],
}
# Comptoir configuration: COMPTOIR.PHP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment