external_url requires = symbol
Created by: spuder
The file /etc/gitlab/gitlab.rb takes parameters. All of them are separated like so
foo = bar
The one exception is the external_url
parameter which omits the =
symbol.
As pointed out in this issue, (https://github.com/spuder/puppet-gitlab/issues/84
) if you mistakenly include the =
symbol, then /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
will be set to the hostname (not the intended value).
Steps to reproduce
Set the value properly (with no =
), the gitlab.yml will be set as expected
$ cat /etc/gitlab/gitlab.rb | grep external_url
external_url 'http://foo.example.com'
$ gitlab-ctl reconfigure
$ cat /var/opt/gitlab/gitlab-rails/etc/gitlab.yml | grep foo.example.com
# gitlab.yml will show the host: of foo.example.com (expected)
On a fresh install, set the gitlab.rb file without a =
, the gitlab.yml will be set to the hostname
$ cat /etc/gitlab/gitlab.rb | grep external_url
external_url = 'http://foo.example.com'
$ gitlab-ctl reconfigure
$ cat /var/opt/gitlab/gitlab-rails/etc/gitlab.yml | grep foo.example.com
# gitlab.yml will show the host: equal to the fqdn, and not the value of external_url (unexpected)
This bug is subtile, and difficult to catch because almost everything works properly. Users should expect gitlab to either:
- Throw a warning if the
=
is mistakenly provided in the gitlab.rb file - Handle both syntaxes identically.