2020-11-08 01:34:05 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
2020-12-04 09:22:56 -06:00
|
|
|
- name: configure zerotier for apt
|
|
|
|
block:
|
|
|
|
- name: ensure zerotier repo key
|
|
|
|
apt_key: url=https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg
|
|
|
|
- name: ensure zerotier repo
|
2022-01-21 16:55:10 -06:00
|
|
|
apt_repository: repo="deb http://download.zerotier.com/debian/bionic bionic main"
|
2020-12-04 09:22:56 -06:00
|
|
|
- name: update apt cache
|
|
|
|
apt: update_cache=yes cache_valid_time=86400
|
|
|
|
- name: ensure packages
|
|
|
|
apt: name=zerotier-one
|
|
|
|
when: ansible_pkg_mgr == "apt"
|
2020-11-08 01:34:05 -06:00
|
|
|
- name: template unit file
|
2021-07-01 12:12:06 -05:00
|
|
|
template: src=zerotier-one.service dest=/etc/systemd/system/zerotier-one.service mode=0644
|
2020-11-08 01:34:05 -06:00
|
|
|
notify: restart zerotier
|
|
|
|
- name: join network
|
|
|
|
command:
|
|
|
|
argv: [ zerotier-cli, join, "{{ zerotier_network_id }}" ]
|
|
|
|
changed_when: no
|