From 67a2c1ea550573cc8f82c95a25c77db1ec9c9796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Wed, 10 Apr 2019 16:38:57 +0200 Subject: [PATCH] Fix the mastodon user variable --- .../kosmos-mastodon/recipes/default.rb | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index c5483f9..14b96f2 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -29,11 +29,13 @@ end mastodon_path = node["kosmos-mastodon"]["directory"] -group "mastodon" do +mastodon_user = "mastodon" + +group mastodon_user do gid 62786 end -user "mastodon" do +user mastodon_user do comment "mastodon user" uid 62786 gid 62786 @@ -59,7 +61,7 @@ end # template "/lib/systemd/system/mastodon-web.service" do source "mastodon-web.systemd.service.erb" - variables user: user, + variables user: mastodon_user, app_dir: mastodon_path, port: node["kosmos-mastodon"]["puma_port"], bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle" @@ -71,7 +73,7 @@ end # template "/lib/systemd/system/mastodon-sidekiq.service" do source "mastodon-sidekiq.systemd.service.erb" - variables user: user, + variables user: mastodon_user, app_dir: mastodon_path, bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle", sidekiq_threads: node["kosmos-mastodon"]["sidekiq_threads"] @@ -83,15 +85,13 @@ end # template "/lib/systemd/system/mastodon-streaming.service" do source "mastodon-streaming.systemd.service.erb" - variables user: user, + variables user: mastodon_user, app_dir: mastodon_path, port: node["kosmos-mastodon"]["streaming_port"] notifies :run, "execute[systemctl daemon-reload]", :immediately notifies :restart, "service[mastodon-streaming]", :delayed end -user = "mastodon" - application mastodon_path do owner "mastodon" group "mastodon" @@ -104,8 +104,8 @@ application mastodon_path do end git do - user user - group user + user mastodon_user + group mastodon_user repository "https://gitea.kosmos.org/kosmos/mastodon.git" revision "production" end @@ -115,8 +115,8 @@ application mastodon_path do template ".env.production" do source "env.production.erb" mode "0640" - owner user - group user + owner mastodon_user + group mastodon_user variables redis_url: node["kosmos-mastodon"]["redis_url"], domain: node["kosmos-mastodon"]["server_name"], paperclip_secret: mastodon_credentials['paperclip_secret'], @@ -136,14 +136,14 @@ application mastodon_path do execute do environment "HOME" => mastodon_path - user user + user mastodon_user cwd mastodon_path command "/opt/ruby_build/builds/#{ruby_version}/bin/bundle install --without development,test --deployment" end execute do environment "HOME" => mastodon_path - user user + user mastodon_user cwd mastodon_path command "yarn install --pure-lockfile" end @@ -156,8 +156,8 @@ application mastodon_path do execute 'rake db:migrate' do environment "RAILS_ENV" => "production", "HOME" => mastodon_path - user user - group user + user mastodon_user + group mastodon_user cwd mastodon_path command "PATH=\"/opt/ruby_build/builds/#{ruby_version}/bin:$PATH\" bundle exec rake db:migrate" end @@ -167,8 +167,8 @@ application mastodon_path do # it cannot find the bundled gems execute 'rake assets:precompile' do environment "RAILS_ENV" => "production", "HOME" => mastodon_path - user user - group user + user mastodon_user + group mastodon_user cwd mastodon_path command "PATH=\"/opt/ruby_build/builds/#{ruby_version}/bin:$PATH\" bundle exec rake assets:precompile" end