From d29fbf4c35aa59876f5763a7451d34dc430f24c0 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Tue, 28 Nov 2023 18:48:39 +0200 Subject: [PATCH] setup db --- manifests/init.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 9b14242..cabca92 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -261,6 +261,18 @@ class mastodon ( ], } # RAILS_ENV=production rails db:setup + exec { 'db_setup': + command => "rails db:setup > ${mastodon_home}/db_setup_done", + creates => "${mastodon_home}/db_setup_done", + environment => [ + 'RAILS_ENV=production', + ], + user => $mastodon_user, + group => $mastodon_group, + pwd => "${mastodon_home}/live", + timeout => 0, + require => File["${mastodon_home}/live/.env.production"], + } # db:create # RAILS_ENV=production rails assets:precompile }