feat(ansible): ansible 初步稳定
这个提交包含在:
@@ -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
|
||||
|
||||
|
||||
在新议题中引用
屏蔽一个用户