ansible: 新增 VPS 初始化 playbook 与 shadowsocks-libev 部署配置

This commit is contained in:
2026-08-18 03:16:42 +08:00
parent 1c8243dbaa
commit eef4881ffd
6 changed files with 151 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
---
- name: 配置 shadowsocks-libev 服务器
hosts: vps_debian
become: true
vars_files:
- ../vars/vault.yaml
tasks:
- name: 安装 shadowsocks-libev
apt:
name: shadowsocks-libev
state: present
update_cache: true
- name: 配置 shadowsocks-libev 服务器
template:
src: ../templates/ss-config.json.j2
dest: /etc/shadowsocks-libev/config.json
owner: root
group: root
mode: '0644'
notify: restart shadowsocks-libev server
- name: 启动 shadowsocks-libev 服务器
systemd:
name: shadowsocks-libev
enabled: true
state: started
handlers:
- name: restart shadowsocks-libev server
systemd:
name: shadowsocks-libev
state: restarted