- Download the
inventory.ini
andsetup-ravermeister-gitlab-on-docker-host.yml
file in the same directory. - Make changes to the
inventory.ini
file to change the hostname, username, passwords (for SSH and Sudo). - Make changes in the
setup-ravermeister-gitlab-on-docker-host.yml
file to change the following variables.- Volume mapping on the host device for GitLab configuration files.
- Volume mapping on the host device for GitLab log files.
- Volume mapping on the host device for GitLab Data files.
- Published port mapping on the host device for HTTPS.
- Published port mapping on the host device for HTTP.
- Published port mapping on the host device for SSH access.
- Restart policy for the container.
- Once all of the above changes are made, save the playbook and execute it using the following command.
ansible-playbook -i inventory.ini setup-ravermeister-gitlab-on-docker-host.yml -vvv
Last active
May 16, 2021 15:32
-
-
Save gridhead/8fb8a4a146707c0d0036324ab23c3bc3 to your computer and use it in GitHub Desktop.
Setup Ravermeister/Gitlab Container on Docker Host
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
[web] | |
server1 ansible_host=192.168.0.165 | |
server1 ansible_ssh_user=ubuntu | |
server1 ansible_ssh_pass=<your-ssh-password> | |
server1 ansible_sudo_pass=<your-sudo-password> |
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
- name: "Setup Ravermeister/Gitlab Container on Docker Host" | |
hosts: server1 | |
remote_user: ubuntu | |
become: yes | |
become_method: sudo | |
become_user: root | |
vars: | |
confdrct: "/home/ubuntu/data/gitlab/config" | |
logsdrct: "/home/ubuntu/data/gitlab/logs" | |
datadrct: "/home/ubuntu/data/gitlab/data" | |
hosttlsp: "4343" | |
hosthttp: "8800" | |
hostsshp: "2222" | |
restplcy: "unless-stopped" | |
tasks: | |
- name: "STEP 1 - Install python3-docker on the remote machine first" | |
apt: | |
update_cache: "yes" | |
name: "python3-docker" | |
state: "latest" | |
- name: "STEP 2 - Pull the Gitlab image from Ravermeister's namespace" | |
community.docker.docker_image: | |
name: "ravermeister/gitlab:latest" | |
source: "pull" | |
- name: "STEP 3 - Start the Gitlab container with the mentioned parameters" | |
docker_container: | |
name: "gitlab" | |
image: "ravermeister/gitlab" | |
volumes: | |
- "{{ confdrct }}:/etc/gitlab" | |
- "{{ logsdrct }}:/var/log/gitlab" | |
- "{{ datadrct }}:/var/opt/gitlab" | |
ports: | |
- "{{ hosttlsp }}:443" | |
- "{{ hosthttp }}:80" | |
- "{{ hostsshp }}:22" | |
restart_policy: "{{ restplcy }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment