roles/containers: added gitea container
This commit is contained in:
parent
1ddb72e734
commit
97fc92ff56
@ -3,12 +3,4 @@
|
||||
# set these in host vars
|
||||
# these are mostly defaults
|
||||
|
||||
- services:
|
||||
- "sshd"
|
||||
- "ddclient"
|
||||
- "caddy"
|
||||
- "website"
|
||||
- "nameserver"
|
||||
- "mailserver"
|
||||
|
||||
enable_ddclient: true
|
||||
|
@ -1,12 +0,0 @@
|
||||
---
|
||||
|
||||
# set these in host vars
|
||||
# these are mostly defaults
|
||||
|
||||
- services:
|
||||
- "sshd"
|
||||
- "mailserver"
|
||||
- "gitea"
|
||||
- "synapse"
|
||||
- "navidrome"
|
||||
- "syncthing"
|
6
roles/containers/defaults/main.yml
Normal file
6
roles/containers/defaults/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
# these are defaults
|
||||
# change these in group/host vars
|
||||
|
||||
docker_compose_dir: "/home/{{ ansible_user }}/services"
|
23
roles/containers/tasks/main.yml
Normal file
23
roles/containers/tasks/main.yml
Normal 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 }}"
|
29
roles/containers/templates/docker-compose.yml.j2
Normal file
29
roles/containers/templates/docker-compose.yml.j2
Normal 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 %}
|
Loading…
Reference in New Issue
Block a user