Update playbooks/debian/install-zerotier.yml
This commit is contained in:
1 parent
e176ae8a86
commit
69e6ec6f85
1 file changed
+49
@@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: Install ZeroTier on Debian hosts
|
||||
hosts: debian
|
||||
become: true
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Verify the host is running Debian
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ansible_distribution == "Debian"
|
||||
fail_msg: "This playbook only supports Debian hosts."
|
||||
|
||||
- name: Install prerequisites
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gpg
|
||||
state: present
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Download the official ZeroTier installer
|
||||
ansible.builtin.get_url:
|
||||
url: https://install.zerotier.com/
|
||||
dest: /tmp/zerotier-install.sh
|
||||
mode: "0755"
|
||||
|
||||
- name: Install ZeroTier
|
||||
ansible.builtin.command:
|
||||
cmd: bash /tmp/zerotier-install.sh
|
||||
creates: /usr/sbin/zerotier-one
|
||||
|
||||
- name: Enable and start ZeroTier
|
||||
ansible.builtin.systemd:
|
||||
name: zerotier-one
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: Check ZeroTier status
|
||||
ansible.builtin.command:
|
||||
cmd: zerotier-cli info
|
||||
register: zerotier_status
|
||||
changed_when: false
|
||||
|
||||
- name: Display ZeroTier status
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ inventory_hostname }}: {{ zerotier_status.stdout }}"
|
||||
Reference in new issue
Block a user