roles/containers: added gitea container

This commit is contained in:
dogeystamp 2023-08-23 20:48:34 -04:00
parent 1ddb72e734
commit 97fc92ff56
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
6 changed files with 63 additions and 20 deletions

View File

@ -3,12 +3,4 @@
# set these in host vars
# these are mostly defaults
- services:
- "sshd"
- "ddclient"
- "caddy"
- "website"
- "nameserver"
- "mailserver"
enable_ddclient: true

View File

@ -1,12 +0,0 @@
---
# set these in host vars
# these are mostly defaults
- services:
- "sshd"
- "mailserver"
- "gitea"
- "synapse"
- "navidrome"
- "syncthing"

View File

@ -0,0 +1,6 @@
---
# these are defaults
# change these in group/host vars
docker_compose_dir: "/home/{{ ansible_user }}/services"

View File

@ -0,0 +1,23 @@
---
- name: Install Docker packages
community.general.pacman:
name:
- docker
- docker-compose
- name: Create docker-compose directory
ansible.builtin.file:
path: "{{ docker_compose_dir }}"
owner: "{{ admin_username }}"
group: "{{ admin_username }}"
state: directory
- name: Generate docker-compose.yml
template:
src: "docker-compose.yml"
dest: "{{ docker_compose_dir }}/docker-compose.yml"
- name: Docker compose up
community.docker.docker_compose:
project_src: "{{ docker_compose_dir }}"

View File

@ -0,0 +1,29 @@
# vim: ft=yaml
---
version: "3"
networks:
gitea:
external: false
services:
{% if "gitea" in group_names %}
gitea:
container_name: gitea
image: gitea/gitea:latest
environment:
- USER=gitea
restart: unless-stopped
networks:
- gitea
volumes:
- {{ dataroot }}/gitea:/data
- {{ }}
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"
{% endif %}

View File

@ -86,3 +86,8 @@
tags:
- website
when: "website" in group_names
- role: containers
tags:
- containers
when: "fleet" in group_names