voxpupuli / puppet-gitlab

Puppet module to manage Gitlab (Omnibus)
https://forge.puppet.com/puppet/gitlab/
BSD 3-Clause "New" or "Revised" License
74 stars 164 forks source link

unable to specify listen_port and listen_https #413

Closed rbos closed 1 year ago

rbos commented 1 year ago

Feature request (or correction, if I just can't find it):

I'm running Gitlab behind a reverse proxy, so I need to specify:

nginx['listen_port'] = 80 nginx['listen_https'] = false

but there doesn't seem to be any way to do that in the Puppet module. Am I just missing something?

smortex commented 1 year ago

Have you tried:

    nginx                   => {
      listen_port  => 80,
      listen_https => false,
    },

But if you already have a proxy, no need to run nginx bundled with GitLab. You can do something like this:

  class { 'gitlab':    
    external_url            => "https://${hostname}",    
    # ...
    nginx                   => {
      enable => false,
    },
    gitlab_workhorse        => {
      enable         => true,
      listen_network => 'tcp',
      listen_addr    => '127.0.0.1:8181',
    },
  }    
rbos commented 1 year ago

The reverse proxy isn't on the same machine - it's a load-balancer that handles traffic on a virtual IP with an attached SSL certificate. Does that matter?

Would I then configure gitlab_workhorse to listen on the machine's public interface on port 80?

edit: Yeah, I've tried specifying it using Heira:

gitlab::external_url: '[url]'
gitlab::listen_port: 80
gitlab::listen_https: false

and on the puppet agent -t --noop run, it tries to remove the settings.

-nginx['listen_port'] = 80
-nginx['listen_https'] = false

edit 2: gitlab::nginx::listen_port: 80 also doesn't work.

smortex commented 1 year ago

The parameter of the gitlab module is nginx and is a hash. So if using Hiera, this should be something like:

gitlab::nginx:
  listen_port: 80
  listen_https: false
rbos commented 1 year ago

That does it; thanks.