m4rcu5nl.zerotier-one
ZeroTier
This Ansible role sets up ZeroTier by adding its repository and installing the zerotier-one
package using your system's package manager. Depending on the variables you provide, this role can also add new members to existing ZeroTier networks and instruct them to join.
Requirements
This role does not have strict requirements. If it runs without any variables, it will simply install the package. The following variables affect how the role works:
- zerotier_network_id: If set, the hosts will be joined to this specific network.
- zerotier_api_accesstoken: If provided, the role can manage member authentication through the ZeroTier API.
Role Variables
zerotier_network_id
- Type: string
- Default value:
- Description: The 16-character ID of the network that new members should join. If not specified, the node will not join any network.
zerotier_member_register_short_hostname
- Type: boolean
- Default value:
false
- Description: By default, the member will use
inventory_hostname
as its name. If set totrue
, it will useinventory_hostname_short
instead.
zerotier_member_ip_assignments
- Type: list
- Default value:
[]
- Description: A list of IP addresses to be assigned to this member. If left empty, an address will be automatically assigned.
zerotier_member_description
- Type: string
- Default value:
""
- Description: An optional description for the member.
zerotier_api_accesstoken
- Type: string
- Default value:
""
- Description: The access token needed to authorize with the ZeroTier API. You can generate one in your account settings at https://my.zerotier.com/. If omitted, the new member will not be automatically authorized.
zerotier_api_url
- Type: string
- Default value:
https://my.zerotier.com
- Description: The URL for the ZeroTier API. It must use HTTPS.
zerotier_api_delegate
- Type: string
- Default value:
localhost
- Description: This option is used to direct tasks for ZeroTier API calls. It's useful when API calls can only be made from a whitelisted management server.
Example Playbook
- hosts: servers
vars:
zerotier_network_id: 1234567890qwerty
zerotier_api_accesstoken: "{{ vault_zerotier_accesstoken }}"
zerotier_register_short_hostname: true
roles:
- { role: m4rcu5nl.zerotier, become: true }
Example Inventory
[servers]
web1.example.com zerotier_member_ip_assignments='["192.168.195.1", "192.168.195.2"]'
web2.example.com zerotier_member_ip_assignments='["192.168.195.3", "192.168.195.4"]'
db1.example.com zerotier_member_ip_assignments='["192.168.195.10"]'
db2.example.com zerotier_member_ip_assignments='["192.168.195.11"]'
db3.example.com zerotier_member_ip_assignments='["192.168.195.12"]'
[webservers]
web1.example.com
web2.example.com
[dbservers]
db1.example.com
db2.example.com
db3.example.com
[webservers:vars]
zerotier_member_description='<AppName> webserver'
[dbservers:vars]
zerotier_member_description='<AppName> db cluster node'
Informazioni sul progetto
Install zerotier-one package and add new members to a zerotier network
Installa
ansible-galaxy install m4rcu5nl.zerotier-one
Licenza
gpl-3.0
Download
28.5k
Proprietario
Doing things and stuff