feat(ansible): ansible 初步稳定

这个提交包含在:
rohow
2026-02-10 10:25:28 +08:00
未验证
父节点 d6bcd22ecd
当前提交 acd50f7093
修改 13 个文件,包含 183 行新增140 行删除
+24 -9
查看文件
@@ -19,28 +19,43 @@
content: |
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
mode: '0644'
mode: "0644"
notify: Apply sysctl
- name: Install dependencies
ansible.builtin.apt:
name: [curl, wget, ca-certificates]
name:
- curl
- wget
- ca-certificates
state: present
update_cache: yes
update_cache: true
- name: Check if Tailscale is installed
ansible.builtin.command: which tailscale
register: tailscale_check
ignore_errors: yes
register: common_tailscale_check
failed_when: false
changed_when: false
- name: Download Tailscale install script
ansible.builtin.get_url:
url: https://tailscale.com/install.sh
dest: /tmp/tailscale-install.sh
mode: "0755"
when: common_tailscale_check.rc != 0
- name: Install Tailscale
ansible.builtin.shell: curl -fsSL https://tailscale.com/install.sh | sh
when: tailscale_check.rc != 0
ansible.builtin.command: /tmp/tailscale-install.sh
when: common_tailscale_check.rc != 0
changed_when: true
- name: Remove Tailscale install script
ansible.builtin.file:
path: /tmp/tailscale-install.sh
state: absent
- name: Enable Tailscale service
ansible.builtin.systemd:
name: tailscaled
enabled: yes
enabled: true
state: started