Adding docker-service to docker role, and add a sample gitea service.
This commit is contained in:
parent
eee9bd7e04
commit
c005139fd8
|
@ -1,7 +1,7 @@
|
||||||
######################################
|
######################################
|
||||||
### All hosts
|
### All hosts
|
||||||
10.1.1.198
|
10.1.1.198 ansible_python_interpreter=/usr/bin/python3
|
||||||
10.1.1.199
|
10.1.1.199 ansible_python_interpreter=/usr/bin/python3
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
### Application servers
|
### Application servers
|
||||||
|
|
BIN
roles/docker/files/composefiles/.gitea.yml.swp
Normal file
BIN
roles/docker/files/composefiles/.gitea.yml.swp
Normal file
Binary file not shown.
38
roles/docker/files/composefiles/gitea.yml
Normal file
38
roles/docker/files/composefiles/gitea.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
version: "2.3"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
gitea:
|
||||||
|
external: false
|
||||||
|
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
image: gitea/gitea:latest
|
||||||
|
environment:
|
||||||
|
- USER_UID=1000
|
||||||
|
- USER_GID=1000
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- gitea
|
||||||
|
volumes:
|
||||||
|
- gitea:/data
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
- "222:22"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:9.6
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=gitea
|
||||||
|
- POSTGRES_PASSWORD=gitea
|
||||||
|
- POSTGRES_DB=gitea
|
||||||
|
networks:
|
||||||
|
- gitea
|
||||||
|
volumes:
|
||||||
|
- postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
gitea:
|
||||||
|
postgres:
|
|
@ -15,3 +15,14 @@
|
||||||
apt:
|
apt:
|
||||||
name: docker-ce
|
name: docker-ce
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: install docker python bindings
|
||||||
|
pip:
|
||||||
|
executable: "pip3"
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
with_items:
|
||||||
|
- docker-compose
|
||||||
|
|
||||||
|
- name: setup services
|
||||||
|
include_tasks: services.yml
|
||||||
|
|
5
roles/docker/tasks/services.yml
Normal file
5
roles/docker/tasks/services.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
- name: setup gitea
|
||||||
|
docker_service:
|
||||||
|
project_name: gitea
|
||||||
|
definition:
|
||||||
|
"{{ lookup('file', 'composefiles/gitea.yml') | from_yaml }}"
|
|
@ -1,5 +1,8 @@
|
||||||
---
|
---
|
||||||
- name: Install aptitude if missing
|
- name: Install necessary packages
|
||||||
apt:
|
apt:
|
||||||
name: aptitude
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
with_items:
|
||||||
|
- aptitude
|
||||||
|
- python3-pip
|
||||||
|
|
Loading…
Reference in a new issue