Compare commits

..

3 Commits

6 changed files with 37 additions and 7 deletions

5
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.env
gitea_data
/.env
/ansible/inventory.ini
/data

4
ansible/ansible.cfg Normal file
View File

@@ -0,0 +1,4 @@
[defaults]
nocows = True
inventory = ./inventory.ini
interpreter_python = auto_silent

View File

@@ -0,0 +1,2 @@
[gitea]
192.168.1.10 ansible_user=root

6
ansible/main.yml Normal file
View File

@@ -0,0 +1,6 @@
---
- hosts: all
become: true
tasks:
- name: Setup Linux user and group
import_tasks: tasks/user.yml

20
ansible/tasks/user.yml Normal file
View File

@@ -0,0 +1,20 @@
---
- name: Ensure a Linux group "git" exists
ansible.builtin.group:
state: present
name: git
system: no
uid: "{{ GIT_USER_GID }}"
- name: Ensure a Linux user "git" exists
ansible.builtin.user:
state: present
name: git
group: git
password: "!"
comment: "Gitea"
system: no
uid: "{{ GIT_USER_UID }}"
create_home: no
generate_ssh_key: yes
ssh_key_bits: 4096
ssh_key_comment: "Gitea Host Key"

View File

@@ -33,7 +33,7 @@ services:
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./gitea_data:/data
- ./data/gitea:/data
- ${GIT_HOMEDIR}/.ssh:/data/git/.ssh
ports:
- ${SSH_PORT}:22
@@ -49,12 +49,9 @@ services:
- internal
restart: unless-stopped
volumes:
- database:/var/lib/mysql
- ./data/mysql:/var/lib/mysql
networks:
internal:
traefik-proxy:
external: true
volumes:
database: