feat(forgejo): add quadlet deployment
Related to #51 Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
51a44bca3d
commit
5057b9fed1
4 changed files with 48 additions and 0 deletions
19
roles/forgejo/tasks/main.yml
Normal file
19
roles/forgejo/tasks/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
- name: Install the Forgejo quadlets
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "templates/{{ item }}"
|
||||||
|
dest: "/etc/containers/systemd/{{ item }}"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
loop:
|
||||||
|
- forgejo.container
|
||||||
|
- forgejo.network
|
||||||
|
- forgejo.volume
|
||||||
|
|
||||||
|
- name: Enable the Forgejo quadlet
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
daemon_reload: true
|
||||||
|
enabled: true
|
||||||
|
name: forgejo.service
|
||||||
|
state: "started"
|
25
roles/forgejo/templates/forgejo.container
Normal file
25
roles/forgejo/templates/forgejo.container
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Forgejo
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
ContainerName=forgejo
|
||||||
|
Image=codeberg.org/forgejo/forgejo:9
|
||||||
|
|
||||||
|
Environment=USER_UID=1000
|
||||||
|
Environment=USER_GID=1000
|
||||||
|
Environment=TZ=Europe/Prague
|
||||||
|
Environment=START_SSH_SERVER=true
|
||||||
|
Environment=SSH_CREATE_AUTHORIZED_PRINCIPALS_FILES=true
|
||||||
|
Environment=SSH_AUTHORIZED_PRINCIPALS_ALLOW="username,email"
|
||||||
|
|
||||||
|
Network=forgejo.network
|
||||||
|
PublishPort=2222:22
|
||||||
|
PublishPort=3000:3000
|
||||||
|
|
||||||
|
Volume=forgejo-data:/data
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
2
roles/forgejo/templates/forgejo.network
Normal file
2
roles/forgejo/templates/forgejo.network
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[Network]
|
||||||
|
NetworkName=forgejo
|
2
roles/forgejo/templates/forgejo.volume
Normal file
2
roles/forgejo/templates/forgejo.volume
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[Volume]
|
||||||
|
VolumeName=forgejo-data
|
Loading…
Reference in a new issue