Giter Site home page Giter Site logo

geerlingguy / ansible-role-gitlab Goto Github PK

View Code? Open in Web Editor NEW
666.0 16.0 454.0 145 KB

Ansible Role - GitLab

Home Page: https://galaxy.ansible.com/geerlingguy/gitlab/

License: MIT License

Jinja 100.00%
ansible role gitlab ruby vcs hosting code git ci-cd

ansible-role-gitlab's Introduction

Ansible Role: GitLab

Deprecated: In September 2023, I deprecated this role as I am no longer maintaining any GitLab instances, and use Gitea instead for my personal work. Please consider forking this role or use someone else's GitLab role.

CI

Installs GitLab, a Ruby-based front-end to Git, on any RedHat/CentOS or Debian/Ubuntu linux system.

GitLab's default administrator account details are below; be sure to login immediately after installation and change these credentials!

root
5iveL!fe

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

gitlab_domain: gitlab
gitlab_external_url: "https://{{ gitlab_domain }}/"

The domain and URL at which the GitLab instance will be accessible. This is set as the external_url configuration setting in gitlab.rb, and if you want to run GitLab on a different port (besides 80/443), you can specify the port here (e.g. https://gitlab:8443/ for port 8443).

gitlab_git_data_dir: "/var/opt/gitlab/git-data"

The gitlab_git_data_dir is the location where all the Git repositories will be stored. You can use a shared drive or any path on the system.

gitlab_backup_path: "/var/opt/gitlab/backups"

The gitlab_backup_path is the location where Gitlab backups will be stored.

gitlab_edition: "gitlab-ce"

The edition of GitLab to install. Usually either gitlab-ce (Community Edition) or gitlab-ee (Enterprise Edition).

gitlab_version: ''

If you'd like to install a specific version, set the version here (e.g. 11.4.0-ce.0 for Debian/Ubuntu, or 11.4.0-ce.0.el7 for RedHat/CentOS).

gitlab_config_template: "gitlab.rb.j2"

The gitlab.rb.j2 template packaged with this role is meant to be very generic and serve a variety of use cases. However, many people would like to have a much more customized version, and so you can override this role's default template with your own, adding any additional customizations you need. To do this:

  • Create a templates directory at the same level as your playbook.
  • Create a templates\mygitlab.rb.j2 file (just choose a different name from the default template).
  • Set the variable like: gitlab_config_template: mygitlab.rb.j2 (with the name of your custom template).

SSL Configuration.

gitlab_redirect_http_to_https: true
gitlab_ssl_certificate: "/etc/gitlab/ssl/{{ gitlab_domain }}.crt"
gitlab_ssl_certificate_key: "/etc/gitlab/ssl/{{ gitlab_domain }}.key"

GitLab SSL configuration; tells GitLab to redirect normal http requests to https, and the path to the certificate and key (the default values will work for automatic self-signed certificate creation, if set to true in the variable below).

# SSL Self-signed Certificate Configuration.
gitlab_create_self_signed_cert: true
gitlab_self_signed_cert_subj: "/C=US/ST=Missouri/L=Saint Louis/O=IT/CN={{ gitlab_domain }}"

Whether to create a self-signed certificate for serving GitLab over a secure connection. Set gitlab_self_signed_cert_subj according to your locality and organization.

LetsEncrypt Configuration.

gitlab_letsencrypt_enable: false
gitlab_letsencrypt_contact_emails: ["[email protected]"]
gitlab_letsencrypt_auto_renew_hour: 1
gitlab_letsencrypt_auto_renew_minute: 30
gitlab_letsencrypt_auto_renew_day_of_month: "*/7"
gitlab_letsencrypt_auto_renew: true

GitLab LetsEncrypt configuration; tells GitLab whether to request and use a certificate from LetsEncrypt, if gitlab_letsencrypt_enable is set to true. Multiple contact emails can be configured under gitlab_letsencrypt_contact_emails as a list.

# LDAP Configuration.
gitlab_ldap_enabled: false
gitlab_ldap_host: "example.com"
gitlab_ldap_port: "389"
gitlab_ldap_uid: "sAMAccountName"
gitlab_ldap_method: "plain"
gitlab_ldap_bind_dn: "CN=Username,CN=Users,DC=example,DC=com"
gitlab_ldap_password: "password"
gitlab_ldap_base: "DC=example,DC=com"

GitLab LDAP configuration; if gitlab_ldap_enabled is true, the rest of the configuration will tell GitLab how to connect to an LDAP server for centralized authentication.

gitlab_dependencies:
  - openssh-server
  - postfix
  - curl
  - openssl
  - tzdata

Dependencies required by GitLab for certain functionality, like timezone support or email. You may change this list in your own playbook if, for example, you would like to install exim instead of postfix.

gitlab_time_zone: "UTC"

Gitlab timezone.

gitlab_backup_keep_time: "604800"

How long to keep local backups (useful if you don't want backups to fill up your drive!).

gitlab_download_validate_certs: true

Controls whether to validate certificates when downloading the GitLab installation repository install script.

# Email configuration.
gitlab_email_enabled: false
gitlab_email_from: "[email protected]"
gitlab_email_display_name: "Gitlab"
gitlab_email_reply_to: "[email protected]"

Gitlab system mail configuration. Disabled by default; set gitlab_email_enabled to true to enable, and make sure you enter valid from/reply-to values.

# SMTP Configuration
gitlab_smtp_enable: false
gitlab_smtp_address: "smtp.server"
gitlab_smtp_port: "465"
gitlab_smtp_user_name: "smtp user"
gitlab_smtp_password: "smtp password"
gitlab_smtp_domain: "example.com"
gitlab_smtp_authentication: "login"
gitlab_smtp_enable_starttls_auto: true
gitlab_smtp_tls: false
gitlab_smtp_openssl_verify_mode: "none"
gitlab_smtp_ca_path: "/etc/ssl/certs"
gitlab_smtp_ca_file: "/etc/ssl/certs/ca-certificates.crt"

Gitlab SMTP configuration; of gitlab_smtp_enable is true, the rest of the configuration will tell GitLab how to send mails using an smtp server.

gitlab_nginx_listen_port: 8080

If you are running GitLab behind a reverse proxy, you may want to override the listen port to something else.

gitlab_nginx_listen_https: false

If you are running GitLab behind a reverse proxy, you may wish to terminate SSL at another proxy server or load balancer

gitlab_nginx_ssl_verify_client: ""
gitlab_nginx_ssl_client_certificate: ""

If you want to enable 2-way SSL Client Authentication, set gitlab_nginx_ssl_verify_client and add a path to the client certificate in gitlab_nginx_ssl_client_certificate.

gitlab_default_theme: 2

GitLab includes a number of themes, and you can set the default for all users with this variable. See the included GitLab themes to choose a default.

gitlab_extra_settings:
  - gitlab_rails:
      - key: "trusted_proxies"
        value: "['foo', 'bar']"
      - key: "env"
        type: "plain"
        value: |
          {
          "http_proxy" => "https://my_http_proxy.company.com:3128",
          "https_proxy" => "https://my_http_proxy.company.com:3128",
          "no_proxy" => "localhost, 127.0.0.1, company.com"
          }
  - unicorn:
      - key: "worker_processes"
        value: 5
      - key: "pidfile"
        value: "/opt/gitlab/var/unicorn/unicorn.pid"

Gitlab have many other settings (see official documentation), and you can add them with this special variable gitlab_extra_settings with the concerned setting and the key and value keywords.

Dependencies

None.

Example Playbook

- hosts: servers
  vars_files:
    - vars/main.yml
  roles:
    - { role: geerlingguy.gitlab }

Inside vars/main.yml:

gitlab_external_url: "https://gitlab.example.com/"

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-gitlab's People

Contributors

adriangprado avatar aleksnovak avatar alexanderfast avatar andrewhlavac avatar bbaassssiiee avatar bradfier avatar bsmeding avatar cfasnacht avatar florent-souliere-smile avatar fyhertz avatar geerlingguy avatar giorgioma avatar gregoriomelo avatar jakedahn avatar nerdlich avatar sjugge avatar socketwench avatar thiagocaiubi avatar tuurlijk avatar williampiv avatar wilsonge avatar zeitounator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-gitlab's Issues

Fix Travis CI tests (Ubuntu-specific issue)

I've tried this role on CentOS 6.4, CentOS 6.5, and Ubuntu 12.04, and everything seems to work great locally... But if it runs on Travis CI, I get the following:

$ curl --insecure https://localhost/
<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but something went wrong (500)</title>
  <link href="/static.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
  <h1>500</h1>
  <h3>We're sorry, but something went wrong.</h3>
  <hr/>
  <p>Please contact your GitLab administrator if this problem persists.</p>
</body>
</html>

For some reason, installation isn't completing (and I had to add a failed_when: false to get the role to complete installation on Travis!).

Gitlab Handler always fails

The Gitlab Handlers always fails, when it is executed. Adding a | bool fixes this:

  • failed_when: gitlab_restart_handler_failed_when
  • failed_when: gitlab_restart_handler_failed_when | bool

Tested this ansible 2.8.1.

I've opened a PR: #125

fetch gitlab_ssl_certificate so the gitlab-runners can use it

One task that runs is Create self-signed certificate.

This task creates {{ gitlab_ssl_certificate }}, self-signed. If I want to register a gitlab-runner on other machines, then I need to copy: it to these gitlab-runner machines. Having it available in files/ would be really convenient.

Allow playbooks to use own gitlab.rb configuration file instead of managed file

Similar to how I do the managed vhosts files for Nginx and Apache roles, I'd like to allow users who need more advanced customizations to be able to do that by simply managing their own gitlab.rb file (instead of making the configurable parameters in this role overly complicated).

See:

I'm thinking of using a new gitlab_use_managed_config variable to control whether the file will be managed or not.

Allow end users to specify a version of gitlab

Great Ansible Role, thank you.

One request, is it possible to allow the end user to provide a specific version of gitlab to install?
It could work in its current form by supplying the correct package-version string in 'gitlab_edition' but that variable is used in vars to construct the path to the installer script (which breaks when you try to provide a version).

Thanks!

Checking for specific status codes in your travis test

Replace:

  # Make sure GitLab is running.
  - curl --insecure https://localhost/

With:

  - >
    curl --insecure -s -o /dev/null -w "%{http_code}" https://localhost/
    | grep -q '200'
    && (echo 'Status code 200 test: pass' && exit 0)
    || (echo 'Status code 200 test: fail' && exit 1)

External URL with relative path does not take effect without manual restart

I'm using a relative url for Gitlab (https://docs.gitlab.com/omnibus/settings/configuration.html) for example: gitlab_external_url: "https://myhost/git"

However this settings does not work and login redirect is made to https://myhost/users/sign_in

Only manual reconfigure and restart fixes this issue

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

I'm not sure if this Ansible role related issue, maybe restart for GitLab should be made differently?

Issue with var/main.yml

When i tried to run this on local machine, ansible said that it cannot find var/main.yml file for variables.

i modified it to the following to make it work:

roles/geerlingguy.gitlab/defaults/main.yml

fresh install, reset password leads to 422

On a fresh install, I can't reset the password :

gitlab asks me to change my password, without letting me log in with default password

It results in a 422.

my config :

      gitlab_nginx_listen_port: 80
      gitlab_create_self_signed_cert: "false"
      gitlab_redirect_http_to_https: "false"
      gitlab_time_zone: "Europe/Paris"

Installation

Hello,

I use ansible for few days, i am not an expert.
I would like to install your package on a remote host from a virtual machine who contains ansible but i don't know how to do it, i tried many things but it still don't working.
Could you help me how to deploy GitLab on a remote host from a virtual machine with ansible, please?

Unify `yum` & `apt` Ansible modules

I've noticed that there is code repeated just with the intention of having OS differentiation.

- name: Install GitLab repository (RedHat)
  command: bash /tmp/gitlab_install_repository.sh
  when: (gitlab_file.stat.exists == false) and (ansible_os_family == 'RedHat')

- name: Install GitLab (RedHat)
  yum: "name=gitlab-ce state=installed"
  when: (gitlab_file.stat.exists == false) and (ansible_os_family == 'RedHat')

 ...

- name: Install GitLab repository
  command: bash /tmp/gitlab_install_repository.sh
  when: (gitlab_file.stat.exists == false) and (ansible_os_family == 'Debian')

- name: Install GitLab
  apt: "name=gitlab-ce state=installed"
  when: (gitlab_file.stat.exists == false) and (ansible_os_family == 'Debian')

The only difference is the usage of the modules yum or apt. Ansible has a generic package manager package which is useful in this situation, making the playbook shorter and OS agnostic (at least between 'Debian' and 'RedHat' families)

I will open a PR.

BTW: Thanks for taking the time writing Ansible for DevOps it's been really useful.

Upgrade/Update documentation mention

It would be great to have a section in the readme on upgrading. It isn't immediately clear to me if the script will upgrade gitlab. I am not experienced with gitlab but I did read that the ppa will upgrade gitlab. I'll take a more thorough look later and maybe submit a patch. This is an enhancement.

Documentation Needed: Upgrade CE to EE

I was able to easily upgrade from CE to EE on Ubuntu 16.04 by:

  1. run the EE repo install script from here
    • curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
  2. Install gitlab EE: sudo apt install gitlab-ee
    • this automatically uninstalled gitlab-ce
  3. Run this ansible playbook again.

Automate setting root user credentials and skipping GUI setup phase

Great work on this project @geerlingguy thanks for sharing it!

So it all seems to work great without trouble shooting, but I'm researching ways to set the root password during the install for 100% automated installs. It looks like gitlab supports this through setting environment variables during the sudo -u git -H bundle exec rake gitlab:setup phase of things. I'm a bit rusty with Ansible and am having trouble pulling this off, though will look through the code and see if I can manage a PR if possible. If you have any insights on this task, I'd love to hear them :)

Gitlab-workhorse socket Permission

Running your gitlab role, I'm getting the error :

*5 connect() to unix:/var/opt/gitlab/gitlab-workhorse/socket failed (13: Permission denied) while connecting to upstream

Running on Ubuntu 16.04. Permissions on socket are as follows:

srwxr-xr-x 1 git git 0 Dec 8 20:43 /var/opt/gitlab/gitlab-workhorse/socket=

I have also tried the omnibus install and manual install as well and get the same error. In those cases people suggest adding the correct user to gitlab.rb external_users variable, but that seems to be the case only if running a separate nginx binary. Any ideas on how to troubleshoot?

Adding variables to gitlab.rb

Hi,

I'm adding a backup location variable to gitlab.rb. Should I send a PR with the updated defaults.yml variable and gitlab.rb.j2 template? I'd rather not maintain a fork and I think this will be useful for others managing the location of their backup.

Thanks!

Can't install on RedHat 7.2

Great Role! unfortunately I am stuck on this step:

TASK [gitlab : Reconfigure GitLab (first run).] ********************************

even after restarting it is get stuck, and one time it managed to "finish" but the installation was corrupted and i saw messages like [execute] fail: redis: runsv not running when i tried to execute /opt/gitlab/bin/gitlab-ctl start

tried to run /opt/gitlab/bin/gitlab-ctl tail to see what is going on but all i see there is

==> /var/log/gitlab/gitlab-rails/production.log <==
** [Raven] Raven 2.0.2 configured not to capture errors.

==> /var/log/gitlab/gitlab-shell/gitlab-shell.log <==
Logfile created on 2017-03-30 14:26:07 +0300 by logger.rb/56438

Do you have any suggestions how to tackle it?

Question: Getting error that `/var/opt/gitlab does not exist`

Does this simply need a mkdir -p, is it something more complicated, or is this just user error (if so, how?)

Here's the error, in context at the end:

TASK [ansible-role-gitlab : Reconfigure GitLab (first run).] ************************************************************
changed: [10.0.3.16] => {"changed": true, "cmd": ["gitlab-ctl", "reconfigure"], "delta": "0:00:13.562406", "end": "2018-08-26 01:58:35.925799", "failed_when_result": false, "msg": "non-zero return code", "rc": 1, "start": "2018-08-26 01:58:22.363393", "stderr": "There was an error running gitlab-ctl reconfigure:\n\nUnable to determine node name: configure node_name or configure the system's hostname and fqdn", "stderr_lines": ["There was an error running gitlab-ctl reconfigure:", "", "Unable to determine node name: configure node_name or configure the system's hostname and fqdn"], "stdout": "Starting Chef Client, version 13.6.4\u001b[0m\n\u001b[0m\nRunning handlers:\u001b[0m\nRunning handlers complete\n\u001b[0mChef Client failed. 0 resources updated in 05 seconds\u001b[0m", "stdout_lines": ["Starting Chef Client, version 13.6.4\u001b[0m", "\u001b[0m", "Running handlers:\u001b[0m", "Running handlers complete", "\u001b[0mChef Client failed. 0 resources updated in 05 seconds\u001b[0m"]}

TASK [ansible-role-gitlab : Create GitLab SSL configuration folder.] ****************************************************
changed: [10.0.3.16] => {"changed": true, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/etc/gitlab/ssl", "size": 4096, "state": "directory", "uid": 0}

TASK [ansible-role-gitlab : Create self-signed certificate.] ************************************************************
ok: [10.0.3.16] => ...

TASK [ansible-role-gitlab : Copy GitLab configuration file.] ************************************************************
changed: [10.0.3.16] => {"changed": true, "checksum": "ac82c3ec63e0da9d9b49c4a4db84982fd478d1de", "dest": "/etc/gitlab/gitlab.rb", "gid": 0, "group": "root", "md5sum": "9b2bc4807b8eb982c7e3ad6f33013a72", "mode": "0600", "owner": "root", "size": 2290, "src": "/home/vagrant/.ansible/tmp/ansible-tmp-1535248718.59-244650974648314/source", "state": "file", "uid": 0}

TASK [ansible-role-gitlab : Upload backup] ******************************************************************************
fatal: [10.0.3.16]: FAILED! => {"changed": false, "checksum": "492a4591db132ddb8cbbb183ad5e73d98f0fe558", "msg": "Destination directory /var/opt/gitlab does not exist"}

sysctl read-only, recipe 'postgresql::enable' failed

I tried to install Gitlab in a (Proxmox) container and ran into a filesystem read-only issue while this role wanted to change the kernel.shmall and kernel.shmmax settings in sysctl.

sysctl settings are usually not writeable within such a container.

HTTP only not working

I try to use AWS ELB SSL termination and therefore run gitlab http only. The following vars do not work:

    gitlab_external_url: "http://gitlab.example.com"
    gitlab_redirect_http_to_https: "false"
    gitlab_nginx_listen_port: 80
    gitlab_nginx_listen_https: "false"

nginx throws a 400 with "The plain HTTP request was sent to HTTPS port".

Question: self signed certificate not working

Hello!

I'm trying to set up gitlab with https redirection, I'm using the gitlab.rb.j2 template mentioned in the readme. The problem is, I'm getting an untrusted certificate error.

My question would be: Do I need to do more than just running the role with the template ? Do I need to verify the certificate somehow ? Does it even set up a certificate for me (as far as I know it does but I might be missing something) ? If it does and no further action is needed, why does it still give me an untrusted cert error ?

Thank' for the answer, and sorry if I'm asking something obvious, I just can't figure it out.

Package gitlab-ce not availabe (Ubuntu 15.04 server)

When trying to run the role, follwing task is failing:

TASK: [geerlingguy.gitlab | Install GitLab] *********************************** 
failed: [myhost.de] => {"failed": true}
msg: No package matching 'gitlab-ce' is available

When looking at

- name: Install GitLab
  apt: "name=gitlab-ce state=installed"
  when: (gitlab_file.stat.exists == false) and (ansible_os_family == 'Debian')

I first thought it might be a missing apt-get update, but checking the apt repos and actually doing an apt-get update on the server showed me:

Hit https://packages.gitlab.com vivid InRelease
Hit http://security.ubuntu.com vivid-security/universe Translation-en
Hit https://packages.gitlab.com vivid/main Sources                   
Hit https://packages.gitlab.com vivid/main amd64 Packages
Hit https://packages.gitlab.com vivid/main i386 Packages
Get:1 https://packages.gitlab.com vivid/main Translation-en
Get:2 https://packages.gitlab.com vivid/main Translation-en [162 B]
Get:3 https://packages.gitlab.com vivid/main Translation-en [162 B]
Get:4 https://packages.gitlab.com vivid/main Translation-en [162 B]
Get:5 https://packages.gitlab.com vivid/main Translation-en [162 B]
Ign https://packages.gitlab.com vivid/main Translation-en
Reading package lists... Done 

Any idea what might cause this?

Allow installation of gitlab-ee.

The URL for the installation script is configurable, so I can use that one for the installation, but the package name is not. I haven't checked to see if it runs to completion, but can the name be made a variable so I can override it with gitlab-ee, in my case?

Test on multiple OSes?

Right now all the tests are run within only Ubuntu 12/14 on Travis CI directly. I'd rather test in clean Docker environments like I do my other roles... but it might be a little tricky since GitLab's installation is rather complicated and kinda convoluted. At least it was last time I attempted this.

Handler 'restart gitlab' ignores error

The failed_when: false line in the reconfigure handler is suppressing all errors in the gitlab-ctl reconfigure process. This isn't something that should be allowed to fail silently so I assume this was added for testing purposes and forgotten about?

I ran into this while drastically expanding the gitlab.rb.j2 template, and going back after adding 20 or 30 options only to discover that all my passing tests had in fact been failing.

With an intentionally malformed template file, here's the result of running the handler with the existing code:

NOTIFIED: [ansible-role-gitlab | restart gitlab] ****************************** 
changed: [172.16.6.189] => {"changed": true, "cmd": ["gitlab-ctl", "reconfigure"], "delta": "0:00:04.656031", "end": "2015-03-01 14:38:38.925464", "failed": false, "failed_when_result": false, "rc": 1, "start": "2015-03-01 14:38:34.269433", "stderr":  ...... snipped ..... ", "stdout": .....snipped.....", "warnings": []}

Without including the large amount of failure text in stdout, it's clear that when the return code is non-zero the role shouldn't be marking the step as changed successfully.

If there was a good reason for suppressing any warnings from gitlab-ctl please ignore.

Add special failed_when condition handling for Travis

Since Travis seems to cause issues with GitLab installation via Chef/omnibus, I need to be able to use a failed_when: false in the restart gitlab handler. Since it's best to leave that not set as false for general role usage, I need to use a variable for the failed_when value. Setting an empty string breaks the handler, so I'll need to also register the result of the command and set a default value for a new variable like gitlab_restart_handler_failed_when: 'gitlab_restart.rc != 0'.

I'll leave this new variable undocumented, since nobody should really ever be overriding it anyways, except in weird circumstances.

Package gitlab-ce not availabe (Debian 9 Stretch)

When trying to run tasks

- name: Install GitLab repository
  command:  bash /tmp/gitlab_install_repository.sh
  when: (gitlab_file.stat.exists == false)

- name: Define the Gitlab package name.
  set_fact:
    gitlab_package_name: "{{ gitlab_edition }}{{ gitlab_package_version_separator }}{{ gitlab_version }}"
  when: gitlab_version != ''

follwing task is failing:

- name: Install GitLab
  package:
    name: "{{ gitlab_package_name | default(gitlab_edition) }}"
    state: present
  when: (gitlab_file.stat.exists == false)

is falling:

fatal: [rs]: FAILED! => {"changed": false, "msg": "No package matching 'gitlab-ce' is available"}

but if I call

- command: apt install gitlab-ce

package is found and installed!

Cannot set port

I run a reverse proxy on ports 80&443. I would like to run GitLab behind it. Found no defaults to change for that.

error running role 'iteritems' attribute missing

Hi,

I tried using this but had the following error installing the Gitlab repository.
Not sure what to so to fix this. as quite new to ansible.

Help is appreciated.

Cheers

KArl


< TASK [geerlingguy.gitlab : Install GitLab repository] >


    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

<52.64.147.103> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<52.64.147.103> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/robertk/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=22 -o IdentityFile="/home/robertk/.ssh/avo-infra.pem" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 52.64.147.103 (umask 22 && mkdir -p "$HOME/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780" && echo "$HOME/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780")
<52.64.147.103> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<52.64.147.103> PUT /tmp/tmpebonCK TO /home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/command
<52.64.147.103> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<52.64.147.103> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/robertk/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=22 -o IdentityFile="/home/robertk/.ssh/avo-infra.pem" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 52.64.147.103 /bin/sh -c 'sudo -H -n -S -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-ccwwxkzhzmbeaewuovlcxjtfkdvqgecz; LANG=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/command; rm -rf "/home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/" > /dev/null 2>&1'"'"''
fatal: [52.64.147.103]: FAILED! => {"changed": false, "failed": true, "msg": "BECOME-SUCCESS-ccwwxkzhzmbeaewuovlcxjtfkdvqgecz\r\nTraceback (most recent call last):\r\n File "/home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/command", line 1914, in \r\n main()\r\n File "/home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/command", line 91, in main\r\n module = CommandModule(argument_spec=dict())\r\n File "/home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/command", line 544, in init\r\n self._check_for_check_mode()\r\n File "/home/ubuntu/.ansible/tmp/ansible-tmp-1442204634.57-60423092737780/command", line 1080, in _check_for_check_mode\r\n for (k,v) in self.params.iteritems():\r\nAttributeError: 'tuple' object has no attribute 'iteritems'\r\nOpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014\r\ndebug1: Reading configuration data /home/robertk/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 20769\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 52.64.147.103 closed.\r\n", "parsed": false}


Copy SSL certificate from local machine missing

Hello Jeff,

It will probably be good to have an example of copying an existing SSL certificate to the machine that is managed by ansible, in case you want to secure your gitlab installation with real and non-self-generated certificate. What do you think?

Running as Root? Missing `become` lines?

So, I just attempted to run this on my Raspberry Pi 3, and it errored out on Install GitLab repository, and whilst parsing through the role, I noticed that the main GitLab script is not being called through any type of become options. And, your documentation does not specify including become: True in our play for your role.

Not sure if this was an omission error or what, but I just ran the script on my own, first just as bash <script> and it failed the same,

Detected operating system as raspbian/stretch.
Checking for curl...
Detected curl...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list..../gitlab_install_repository.sh: line 115: /etc/apt/sources.list.d/gitlab_gitlab-ce.list: Permission denied

Unable to run:
    curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/config_file.list?os=raspbian&dist=stretch&source=script

Double check your curl installation and try again.

Once I ran with sudo, it completed without error.

Create data and backupdir

Hey!
You made a good job with this role.

I have changed gitlab_git_data_dir and backup path.
This does not work. Both directories are not set in config.
It would be usefull to check if it is necessary to create both directories.

I added this in tasks/main.yml. Do you have a better idea?

- name: Check data dir and create it if necessary
   file:
     path: "{{ gitlab_git_data_dir }}"
     state: directory
  when: gitlab_git_data_dir != ""

- name: Check backup dir and create it if necessary
   file:
     path: "{{ gitlab_backup_path }}"
     state: directory
  when: gitlab_backup_path != ""

Gitlab 8.14.1 -> gitlab 10.5.4

I have an old gitlab installed with this playbook.
Can you give an advice of how to updated it?
Is there a chance that i can loose my repositories running this playbook again?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.