Add forgejo runner setup

This commit is contained in:
sonny 2024-10-22 22:07:41 +02:00
parent b7a41ce82f
commit 30d80247f2
2 changed files with 80 additions and 8 deletions

View file

@ -1,17 +1,64 @@
- hosts: localhost
tasks:
- name: create git user
become: true
user:
name: git
uid: 1001
group: git
create_home: false
- name: create required directories
become: true
file:
path: '{{ item }}'
state: directory
mode: '0755'
owner: sonny
group: sonny
path: '{{ item.path }}'
state: '{{ item.state }}'
mode: '{{ item.mode }}'
owner: '{{ item.owner }}'
group: '{{ item.group }}'
loop:
- '{{ app_dir }}'
- '{{ data_dir }}'
- '{{ postgres_dir }}'
- {
path: '{{ app_dir }}',
owner: sonny,
group: sonny,
state: directory,
mode: 755
}
- {
path: '{{ data_dir }}',
owner: sonny,
group: sonny,
state: directory,
mode: 755
}
- {
path: '{{ postgres_dir }}',
owner: sonny,
group: sonny,
state: directory,
mode: 755
}
- {
path: '{{ runner_dir }}',
owner: git,
group: git,
state: directory,
mode: 755
}
- {
path: '{{ runner_dir }}/.cache',
owner: git,
group: git,
state: directory,
mode: 2775
}
- {
path: '{{ runner_dir }}/.runner',
owner: git,
group: git,
state: touch,
mode: 2775
}
- name: copy docker-compose file
template:
@ -39,6 +86,7 @@
app_dir: '/srv/docker/forgejo'
data_dir: '/home/sonny/vm/forgejo/data'
postgres_dir: '/home/sonny/vm/forgejo/postgres'
runner_dir: '/home/sonny/vm/forgejo/runner'
image_tag: 'codeberg.org/forgejo/forgejo:9'