Skip to content

Commit

Permalink
symlink local_secret_token.rb to /etc/foreman
Browse files Browse the repository at this point in the history
  • Loading branch information
sean797 committed Jan 30, 2018
1 parent 05fec4a commit 6d84f86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions foreman/foreman.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6d84f86

Please sign in to comment.