roles/containers: gitea should work properly now
This commit is contained in:
parent
dd0de3139e
commit
e8f762a4cb
@ -13,7 +13,7 @@ backup_disk: no
|
|||||||
|
|
||||||
# where data goes
|
# where data goes
|
||||||
# if you have external_disk on, you should probably set this to a path there
|
# if you have external_disk on, you should probably set this to a path there
|
||||||
dataroot: /var/www/data
|
dataroot: /var/lib/serv_data
|
||||||
|
|
||||||
# send dynamic DNS update for this domain
|
# send dynamic DNS update for this domain
|
||||||
dyndns_domain: null
|
dyndns_domain: null
|
||||||
|
@ -4,3 +4,5 @@
|
|||||||
# change these in group/host vars
|
# change these in group/host vars
|
||||||
|
|
||||||
docker_compose_dir: "/opt/services"
|
docker_compose_dir: "/opt/services"
|
||||||
|
|
||||||
|
gitea_domain: "git.{{ domain }}"
|
||||||
|
@ -22,22 +22,16 @@
|
|||||||
template:
|
template:
|
||||||
src: "docker-compose.yml.j2"
|
src: "docker-compose.yml.j2"
|
||||||
dest: "{{ docker_compose_dir }}/docker-compose.yml"
|
dest: "{{ docker_compose_dir }}/docker-compose.yml"
|
||||||
register: docker-comp
|
register: generateComp
|
||||||
|
|
||||||
- name: Create systemd unit file
|
- name: Create systemd unit file
|
||||||
template:
|
template:
|
||||||
src: "docker-compose.service.j2"
|
src: "docker-compose.service.j2"
|
||||||
dest: "/etc/systemd/system/docker-compose.service"
|
dest: "/etc/systemd/system/docker-compose.service"
|
||||||
|
|
||||||
- name: Compose up
|
- name: Compose up (update images if necessary)
|
||||||
systemd:
|
systemd:
|
||||||
name: docker-compose
|
name: docker-compose
|
||||||
state: "{{ 'restarted' if docker-comp.changed else 'started' }}"
|
state: reloaded
|
||||||
enabled: true
|
enabled: true
|
||||||
|
register: compUp
|
||||||
# for some reason port mappings don't work without this?
|
|
||||||
- name: Restart docker for good measure
|
|
||||||
systemd:
|
|
||||||
name: docker
|
|
||||||
state: restarted
|
|
||||||
when: docker-comp.changed
|
|
||||||
|
@ -11,7 +11,7 @@ ExecStartPre=-/usr/bin/docker compose pull
|
|||||||
ExecStart=/usr/bin/docker compose up --remove-orphans
|
ExecStart=/usr/bin/docker compose up --remove-orphans
|
||||||
ExecStop=/usr/bin/docker compose down
|
ExecStop=/usr/bin/docker compose down
|
||||||
ExecReload=/usr/bin/docker compose pull
|
ExecReload=/usr/bin/docker compose pull
|
||||||
ExecReload=/usr/bin/docker compose up --remove-orphans
|
ExecReload=/usr/bin/docker compose up --remove-orphans --detach
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -3,26 +3,23 @@
|
|||||||
|
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
networks:
|
|
||||||
gitea:
|
|
||||||
external: false
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
{% if "gitea" in group_names %}
|
{% if "gitea" in group_names %}
|
||||||
gitea:
|
gitea:
|
||||||
|
network_mode: host
|
||||||
container_name: gitea
|
container_name: gitea
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
environment:
|
environment:
|
||||||
- USER=gitea
|
- USER=gitea
|
||||||
|
- GITEA__server__SSH_PORT=2499
|
||||||
|
- GITEA__server__SSH_LISTEN_PORT=2499
|
||||||
|
- GITEA__service__DISABLE_REGISTRATION=true
|
||||||
|
- GITEA__server__DOMAIN={{ gitea_domain }}
|
||||||
|
- GITEA__server__SSH_DOMAIN={{ gitea_domain }}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
|
||||||
- gitea
|
|
||||||
volumes:
|
volumes:
|
||||||
- {{ dataroot }}/gitea:/data
|
- {{ dataroot }}/gitea:/data
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
- "2499:22"
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -53,3 +53,8 @@
|
|||||||
name: cronie
|
name: cronie
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
|
- name: Create data root dir
|
||||||
|
file:
|
||||||
|
path: "{{ dataroot }}"
|
||||||
|
state: directory
|
||||||
|
Loading…
Reference in New Issue
Block a user