From 6d84f8635269646d0deea6dcb7a24ac295e963c6 Mon Sep 17 00:00:00 2001 From: Sean O'Keeffe Date: Tue, 30 Jan 2018 13:33:11 +0000 Subject: [PATCH] symlink local_secret_token.rb to /etc/foreman --- foreman/foreman.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/foreman/foreman.spec b/foreman/foreman.spec index 7e1d52bb85c..5298f6218ca 100644 --- a/foreman/foreman.spec +++ b/foreman/foreman.spec @@ -1106,6 +1106,7 @@ rm -rf %{buildroot} %{_mandir}/man8 %config(noreplace) %{_sysconfdir}/%{name} %ghost %attr(0640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/encryption_key.rb +%ghost %attr(0640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/local_secret_token.rb %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config %{_sysconfdir}/cron.d/%{name} @@ -1140,6 +1141,11 @@ if [ ! -f %{_datadir}/%{name}/config/initializers/local_secret_token.rb ]; then chgrp foreman %{_datadir}/%{name}/config/initializers/local_secret_token.rb %{foreman_rake} security:generate_token >/dev/null 2>&1 || : chmod 0640 %{_datadir}/%{name}/config/initializers/local_secret_token.rb + mv %{_datadir}/%{name}/config/initializers/local_secret_token.rb %{_sysconfdir}/%{name}/ +fi +if [ ! -e %{_datadir}/%{name}/config/initializers/local_secret_token.rb -a \ + -e %{_sysconfdir}/%{name}/local_secret_token.rb ]; then + ln -s %{_sysconfdir}/%{name}/local_secret_token.rb %{_datadir}/%{name}/config/initializers/ fi # encryption key used to encrypt DB contents