Adding docker-service to docker role, and add a sample gitea service.

This commit is contained in:
Víðir Valberg Guðmundsson 2018-06-23 17:22:44 +02:00
parent eee9bd7e04
commit c005139fd8
6 changed files with 62 additions and 5 deletions

View File

@ -1,7 +1,7 @@
######################################
### All hosts
10.1.1.198
10.1.1.199
10.1.1.198 ansible_python_interpreter=/usr/bin/python3
10.1.1.199 ansible_python_interpreter=/usr/bin/python3
######################################
### Application servers

Binary file not shown.

View 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:

View File

@ -15,3 +15,14 @@
apt:
name: docker-ce
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

View File

@ -0,0 +1,5 @@
- name: setup gitea
docker_service:
project_name: gitea
definition:
"{{ lookup('file', 'composefiles/gitea.yml') | from_yaml }}"

View File

@ -1,5 +1,8 @@
---
- name: Install aptitude if missing
- name: Install necessary packages
apt:
name: aptitude
state: present
name: "{{ item }}"
state: present
with_items:
- aptitude
- python3-pip