]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Dump cryptoportfolio schema
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 21 Feb 2018 13:44:41 +0000 (14:44 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 21 Feb 2018 14:32:21 +0000 (15:32 +0100)
modules/role/manifests/cryptoportfolio.pp

index a1cfde328a7abd76cc133475ac47ed4ab335afcb..9a2bfd2e54c2eae98f9c62e875349ec8ea31d7f3 100644 (file)
@@ -206,7 +206,7 @@ class role::cryptoportfolio {
       target  => $cf_front_app,
       before => File[$cf_front_app],
     } ~>
-    exec { "remove old directory":
+    exec { "remove old ${cf_front_app} directory":
       refreshonly => true,
       user        => $cf_user,
       command     => "/usr/bin/rm -rf ${cf_front_app}",
@@ -257,6 +257,12 @@ class role::cryptoportfolio {
         File["/etc/systemd/system/cryptoportfolio-app.service"],
         Postgresql::Server::Db[$cf_pg_db]
       ],
+    } ~>
+    exec { "dump $cf_pg_db structure":
+      refreshonly => true,
+      user        => $::profile::postgresql::pg_user,
+      group       => $::profile::postgresql::pg_user,
+      command     => "/usr/bin/pg_dump --schema-only --clean --no-publications $cf_pg_db > /var/lib/postgres/${cf_pg_db}.schema",
     }
 
     file { $cf_front_app_api_conf: