-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(SIMP-6238) Update to puppet-gitlab v3.0.2 #28
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# ## Class simp_gitlab::install | ||
# | ||
# This class is called from simp_gitlab to configure & run the GitLab Omnibus | ||
# installer. It uses the `vshn/gitlab` module to manage the Omnibus config. | ||
# installer. It uses the `puppet/gitlab` module to manage the Omnibus config. | ||
# | ||
class simp_gitlab::install { | ||
assert_private() | ||
|
@@ -14,13 +14,14 @@ | |
|
||
# If you need to configure the main NGINX server, you can use a `file` | ||
# resource to drop a `.conf` file in `/etc/gitlab/nginx/conf.d/` | ||
file {['/etc/gitlab', '/etc/gitlab/nginx', '/etc/gitlab/nginx/conf.d']: | ||
# (Parent directory, /etc/gitlab, is managed by the gitlab class. | ||
file {['/etc/gitlab/nginx', '/etc/gitlab/nginx/conf.d']: | ||
ensure => directory, | ||
} | ||
|
||
file { '/etc/gitlab/nginx/conf.d/http_access_list.conf': | ||
content => $_http_access_list, | ||
notify => Class['gitlab'], | ||
notify => Class['gitlab::service'], | ||
} | ||
|
||
# Make sure the standard authorized keys file path is used for the | ||
|
@@ -43,8 +44,59 @@ | |
* => deep_merge(simp_gitlab::omnibus_config::gitlab(), $::simp_gitlab::gitlab_options), | ||
} | ||
|
||
# This ill-advised hootenany is a hack until vshn/gitlab exposes ENV for the reconfigure | ||
Exec <| title == 'gitlab_reconfigure' |> { | ||
environment => [ "GITLAB_ROOT_PASSWORD=${simp_gitlab::gitlab_root_passwd}" ], | ||
# The package resource and exec below are explicitly designed to ensure the | ||
# root GitLab password is set as part of the initial gitlab install (very | ||
# first reconfigure action). We can't do this with the gitlab module and, in | ||
# fact, have to painfully work around assumptions built into that module's | ||
# design to make it happen. Unfortunately, this makes simp_gitlab highly | ||
# coupled with the internals of the gitlab module. | ||
# | ||
# To set the root password, we need to ensure the gitlab.rb generated by | ||
# gitlab::omnibus_config is laid down **AFTER** the gitlab-[ce,ee] RPM is | ||
# installed and that an initial reconfigure with the GITLAB_ROOT_PASSWORD | ||
# environment variable set is executed. | ||
# | ||
# The reason the gitlab.rb/RPM ordering is important is as follows: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The details in this explanation would help a lot at voxpupuli/puppet-gitlab#301 |
||
# - The **ONLY** time GITLAB_ROOT_PASSWORD can be used to set the | ||
# root password is during the absolutely **FIRST** gitlab reconfigure | ||
# operation. | ||
# - The %posttrans of the gitlab-ce RPM runs `gitlab-ctl upgrade`, | ||
# which, if the external_url configuration parameter in gitlab.rb | ||
# does not match the dummy value present in the file during a fresh | ||
# RPM install ('http://gitlab.example.com'), executes a reconfigure | ||
# operation under the hood. | ||
# So, as the gitlab module is written, it precludes the GitLab root | ||
# password from being set, unless the environment variable can be | ||
# set during the package install. | ||
# | ||
# Another problem with the gitlab module that we have to work around is | ||
# that the gitlab::service class is written as if at least 1 reconfigure | ||
# has been executed. Specifically, the Exec['gitlab_reconfigure'] | ||
# requires Service['gitlab-runsvdir'], when, in fact the service files | ||
# for that service are created during the initial gitlab reconfigure. | ||
# | ||
if $simp_gitlab::manage_package { | ||
# This resource intentionally has a different title from the package | ||
# title used by gitlab::install ('gitlab-omnibus') to aide debugging. | ||
package { "gitlab-${simp_gitlab::edition}": | ||
ensure => $simp_gitlab::package_ensure, | ||
require => Class['gitlab::omnibus_package_repository'], | ||
before => Class['gitlab::omnibus_config'], | ||
notify => Exec['initial_gitlab_reconfigure'], | ||
} | ||
|
||
exec { 'initial_gitlab_reconfigure': | ||
command => '/usr/bin/gitlab-ctl reconfigure', | ||
environment => [ "GITLAB_ROOT_PASSWORD=${simp_gitlab::gitlab_root_passwd}" ], | ||
logoutput => true, | ||
# If gitlab-runsvdir service file is not present, initial gitlab | ||
# reconfigure has not been executed. That file is create by Chef. | ||
onlyif => '/usr/bin/test ! -e /usr/lib/systemd/system/gitlab-runsvdir.service', | ||
refreshonly => true, | ||
timeout => 1800, | ||
tries => 5, | ||
} | ||
|
||
Class['gitlab::omnibus_config'] -> Exec['initial_gitlab_reconfigure'] -> Class['gitlab::service'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
puppet-gitlab
no longer executesgitlab-ctl reconfigure
explicitly unless you configure it to do so. Your package manager will do this whenever you install or upgrade the omnibus-gitlab package, as that's part of the omnibus'spost-install
script.This same script in the omnibus also starts the gitlab supervisors for the relevant roles defined in the nodes
gitlab.rb
, and as such thepuppet_gitlab
module no longer manages the service explicitly by default.I left some links to relevant info in the issue you opened in our repo. Let me know if you need any other information.