반응형
awx와 inventory, playbook, role 등을 연동할 gitlab을 docker를 사용하여 설치함.
## 필수 패키지 설치
yum -y install epel-release yum-utils git
## docker repo 추가
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
## docker, docker-compose 설치
yum -y install docker-ce
yum -y install python3 python3-pip
pip3 install --upgrade pip
pip3 install docker-compose
## docker-compose PATH 환경 변수 추가
vim /etc/bashrc
...
PATH=$PATH:/usr/local/bin
...
## gitlab docker-compose 작성
## gitlab 이미지는 현재 운영과 같이 11.2.3으로 설치
## zabbix가 80을 사용중이므로 8080으로 변경
## gitlab config, log, data, backup 디렉토리는 host 볼룸에 연결.
[root@gitlab gitlab-docker]# pwd
/opt/gitlab-docker
[root@gitlab gitlab-docker]# cat docker-compose.yml
web:
image: 'gitlab/gitlab-ce:11.2.3-ce.0'
restart: always
hostname: '{gitlab ip}:8080'
container_name: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://{gitlab ip}:8080'
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '8080:80'
- '8443:443'
- '8022:22'
volumes:
- '/opt/gitlab-docker/config:/etc/gitlab'
- '/opt/gitlab-docker/logs:/var/log/gitlab'
- '/opt/gitlab-docker/data:/var/opt/gitlab'
- '/opt/gitlab-docker/backups:/var/opt/gitlab/backups'
#docker run --detach --hostname {gitlab ip} --publish 8443:443 --publish 8080:80 --publish 8022:22 --name gitlab --restart always --volume /opt/gitlba-docker/config:/etc/gitlab --volume /opt/gitlba-docker/logs:/var/log/gitlab --volume /opt/gitlba-docker/data:/var/opt/gitlab gitlab/gitlab-ce:11.2.3.-ce.0
## gitlab docker 설치
docker-compose up -d
## 확인
[root@MONITOR-NEW-BACKUP config]# docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
gitlab /assets/wrapper Up (healthy) 0.0.0.0:8022->22/tcp, 0.0.0.0:8443->443/tcp, 0.0.0.0:8080->80/tcp
반응형
'Automation Tools > Ansible' 카테고리의 다른 글
5. ansible 예약 변수(ansible_facts) (0) | 2021.03.16 |
---|---|
4.2 ansible | [gitlab] awx 연동 설정 (0) | 2021.03.16 |
3.2 ansible | [AWX] GitLab 연동하기 (0) | 2021.03.16 |
3.1 ansible | [AWX] 설치 (0) | 2021.03.16 |
2.4 ansible | [roles][CentOS 시스템 초기 설정] role 수행(vault 포함) (0) | 2021.03.16 |