SHA256
initial commit
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
---
|
||||
# =============================================================================
|
||||
# Gitea 答疑平台部署 Playbook
|
||||
#
|
||||
# 使用方法:
|
||||
# ansible-playbook playbook.yml
|
||||
#
|
||||
# 仅运行某个 role:
|
||||
# ansible-playbook playbook.yml --tags postgresql
|
||||
# ansible-playbook playbook.yml --tags gitea
|
||||
# =============================================================================
|
||||
|
||||
- name: 部署 Gitea 答疑平台
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
pre_tasks:
|
||||
- name: 检查操作系统
|
||||
assert:
|
||||
that:
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_distribution_major_version | int >= 8
|
||||
fail_msg: "此 Playbook 仅支持 RHEL/Rocky Linux 8+"
|
||||
|
||||
- name: 更新系统软件包
|
||||
dnf:
|
||||
name: "*"
|
||||
state: latest
|
||||
tags: [never, update-system]
|
||||
|
||||
roles:
|
||||
- role: common
|
||||
tags: [common]
|
||||
- role: postgresql
|
||||
tags: [postgresql, database]
|
||||
- role: gitea
|
||||
tags: [gitea]
|
||||
|
||||
post_tasks:
|
||||
- name: 部署完成信息
|
||||
debug:
|
||||
msg: |
|
||||
==========================================
|
||||
Gitea 答疑平台部署完成!
|
||||
==========================================
|
||||
访问地址: http://{{ gitea_domain }}:{{ gitea_http_port }}
|
||||
管理员: {{ gitea_admin_user }}
|
||||
Gitea 版本: {{ gitea_resolved_version }}
|
||||
==========================================
|
||||
后续步骤:
|
||||
1. 登录管理员账号并修改初始密码
|
||||
2. 创建 API Token (设置 -> 应用 -> 生成令牌)
|
||||
3. 配置 Python CLI 工具并执行 tjhlp setup init
|
||||
==========================================
|
||||
Reference in New Issue
Block a user