spuder / puppet-gitlab

A puppet module to install gitlab 7
Apache License 2.0
36 stars 44 forks source link

Gitlab package name changed with 7.10.0, breaking idempotency and causing constant re-installation of Gitlab #149

Closed antaflos closed 9 years ago

antaflos commented 9 years ago

The packages are now no longer named "gitlab" but "gitlab-ce" or "gitlab-ee". See https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/CHANGELOG.md for confirmation.

This breaks idempotency and Puppet (re)installs Gitlab on every run, because it doesn't find the expected package installed:

# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for gitlab.example.com
Info: Applying configuration version '1430360716'
Notice: /Stage[main]/Gitlab::Install/Package[gitlab]/ensure: ensure changed 'purged' to 'latest'
Info: /Package[gitlab]: Scheduling refresh of Exec[stop gitlab]
Info: /Package[gitlab]: Scheduling refresh of Exec[/usr/bin/gitlab-ctl reconfigure]
Notice: /Stage[main]/Gitlab::Config/Exec[stop gitlab]: Triggered 'refresh' from 1 events
Info: /Stage[main]/Gitlab::Config/Exec[stop gitlab]: Scheduling refresh of Exec[/usr/bin/gitlab-ctl reconfigure]
Info: /Stage[main]/Gitlab::Config/Exec[stop gitlab]: Scheduling refresh of Exec[/usr/bin/gitlab-ctl reconfigure]
Notice: /Stage[main]/Gitlab::Config/Exec[/usr/bin/gitlab-ctl reconfigure]: Triggered 'refresh' from 3 events
Notice: /Stage[main]/Gitlab::Config/Exec[start gitlab]/returns: executed successfully

Puppet calls /usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n' gitlab to find the package and its status and version, and this command fails because the package is now named "gitlab-ce" and not "gitlab".

Unfortunately I have no immediately great idea how to work around this problem, other than relying on parsing the value of gitlab::gitlab_branch and/or gitlab::gitlab_download_link. As in something like this:

if versioncmp($gitlab::gitlab_branch, '7.10.0') == 0 
  or versioncmp($gitlab::gitlab_branch, '7.10.0') == 1 {

  $package_name = "gitlab-ce"
} else {
  $package_name = "gitlab"
}

...

package { 'gitlab':
  ensure   => latest,
  name     => $package_name,
  source   => "${download_location}/${omnibus_filename}",
  provider => $package_manager,
  require  => Exec['download gitlab'],
}

I find changing the package name to be a really bad move on GitLab B.V.'s part, especially for a supposedly backwards-compatible feature release.

igalic commented 9 years ago

perhaps a better fix would be to use the apt/yum repositories?

antaflos commented 9 years ago

Not, it would not. The package name issue would be the same (or possibly even worse), regardless of where the .deb or .rpm file was downloaded from.

igalic commented 9 years ago

well, you haven't seen my fix yet :P

ahuffman commented 9 years ago

This is already open as #140. I have a fix we we're working on because both the rpm names and package names change to include gitlab-ce.

ahuffman commented 9 years ago

@antaflos https://github.com/spuder/puppet-gitlab/compare/master...ahuffman:issue_140. Check out my proposed changes there. It fixes the gitlab and gitlab-ce issue as well as the default package name changes when using the gitlab_branch param.

spuder commented 9 years ago

Closing as duplicate of #140