Remove hardcoded path for admin.secret file and use the directory defined in configuration
What does this MR do?
This MR replace the hardcoded path for gitlab-pages folder.
If the gitlab-pages dir configuration is not the default one the chef script fail during reconfigure and the gitlab-pages service fail to start
The page folder should not be hardcoded and should use the configuration defined in the gitlab.rb.
Error:
* template[/var/opt/gitlab/gitlab-pages/admin.secret] action create
* Parent directory /var/opt/gitlab/gitlab-pages does not exist.
================================================================================
Error executing action `create` on resource 'template[/var/opt/gitlab/gitlab-pages/admin.secret]'
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
Parent directory /var/opt/gitlab/gitlab-pages does not exist.
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-pages.rb
41: template admin_secret_path do
42: source "secret_token.erb"
43: owner 'root'
44: group account_helper.gitlab_group
45: mode "0640"
46: variables(secret_token: node['gitlab']['gitlab-pages']['admin_secret_token'])
47: notifies :restart, "service[gitlab-pages]"
48: end
49:
Running handlers:
There was an error running gitlab-ctl reconfigure:
template[/var/opt/gitlab/gitlab-pages/admin.secret] (gitlab::gitlab-pages line 41) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/opt/gitlab/gitlab-pages does not exist.
Checklist
-
MR targeting master
branch -
MR has a green pipeline on GitLab.com
Reviewer Checklist
In addition to above, reviewer must:
-
Pipeline is green on dev.gitlab.org if the change is not touching documentation or internal cookbooks
References
Close #3639 (closed)
Edited by julien Millau