Hi to everyone,
I am trying to use Ansible to deploy Gitlab and create my CI/CD stack. I am using the following Ansible script:
- name: Create gitlab directories
file: path={{ item }} recurse=yes state=directory
with_items:
- "{{ gitlab_config_dir }}"
- "{{ gitlab_logs_dir }}"
- "{{ gitlab_data_dir }}"
- name: Install Gitlab
docker_container:
name: gitlab
image: "gitlab/gitlab-ce:{{ gitlab_version }}"
state: started
restart_policy: always
ports:
- "{{ gitlab_http_port }}:50080"
- "{{ gitlab_https_port }}:443"
- "{{ gitlab_ssh_port }}:22"
volumes:
- "{{ gitlab_config_dir }}:/etc/gitlab"
- "{{ gitlab_logs_dir }}:/var/log/gitlab"
- "{{ gitlab_data_dir }}:/var/opt/gitlab"
env:
GITLAB_OMNIBUS_CONFIG: |
external_url "http://gitlab.myinc.com:8089"
gitlab_rails['gitlab_shell_ssh_port'] = 50022
unicorn['socket'] = '/opt/gitlab/var/unicorn/gitlab.socket'
gitlab_rails['lfs_enabled'] = true
letsencrypt['enable'] = true
nginx['redirect_http_to_https'] = true
registry_nginx['redirect_http_to_https'] = true
registry_external_url "http://registry.myinc.com"
With variables defined:
gitlab_version: latest
gitlab_config_dir: “/srv/gitlab/config”
gitlab_logs_dir: “/srv/gitlab/logs”
gitlab_data_dir: “/srv/gitlab/data”
gitlab_ssh_port: “50022”
gitlab_http_port: “50080”
gitlab_https_port: “50443”
The container gets created but stays forever at starting state and of course the url doesn’t work. Any ideas what might be wrong?
I am deploying this locally to my laptop using Vagrant for testing purposes. Could it be the case that hardware requirements are not satisfied and this is why the container never starts? The assigned memory is 2048 and 2 CPUs.
Thanks in advance!