initial commit

This commit is contained in:
2026-04-12 23:24:13 +08:00
commit 7592af1c3a
55 changed files with 5051 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
---
# roles/common/tasks/main.yml
# 基础系统配置: 安装依赖包、创建 git 用户、配置防火墙、创建目录结构
- name: 安装基础依赖包
dnf:
name:
- git
- wget
- curl
state: present
- name: 创建 git 用户组
group:
name: git
system: yes
state: present
- name: 创建 git 系统用户
user:
name: git
group: git
system: yes
shell: /bin/bash
home: /home/git
create_home: yes
comment: "Git Version Control"
- name: 创建 Gitea 数据目录
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner }}"
group: "{{ item.group }}"
mode: "{{ item.mode }}"
loop:
- { path: /var/lib/gitea, owner: git, group: git, mode: "0750" }
- { path: /var/lib/gitea/custom, owner: git, group: git, mode: "0750" }
- { path: /var/lib/gitea/data, owner: git, group: git, mode: "0750" }
- { path: /var/lib/gitea/log, owner: git, group: git, mode: "0750" }
- name: 创建 Gitea 配置目录
file:
path: /etc/gitea
state: directory
owner: root
group: git
mode: "0770"
- name: 确保 firewalld 正在运行
systemd:
name: firewalld
state: started
enabled: yes
- name: 开放 Gitea HTTP 端口
firewalld:
port: "{{ gitea_http_port }}/tcp"
permanent: yes
immediate: yes
state: enabled