ajaykumar4.zerotier

Ansible Role: ZeroTier

CI GitHub issues

This Ansible role sets up the ZeroTier software by adding its repository and installing the zerotier package using your system's package manager. It can also add and authorize new members to ZeroTier networks, depending on the provided settings.

For a more flexible and general-purpose ZeroTier role, you can use ajaykumar4.zerotier.

Requirements

This role does not have specific requirements. If run without any settings, it will only install the necessary packages. The following settings change how the role operates:

  • zerotier_network_id: If set, hosts will join this network.
  • zerotier_api_accesstoken: If set, this token will allow member authentication and configuration via the ZeroTier API.

Role Variables

zerotier_network_id

  • Type: string
  • Default value: None
  • Description: The 16-character network ID for new members to join. If not provided, the member will not join any network.

zerotier_member_register_short_hostname

  • Type: boolean
  • Default value: false
  • Description: By default, the inventory_hostname will name a member. If set to true, it will use the short hostname instead.

zerotier_member_ip_assignments

  • Type: list
  • Default value: []
  • Description: List of IP addresses to assign to this member. If not provided, an IP will be automatically assigned.

zerotier_member_description

  • Type: string
  • Default value: ""
  • Description: An optional description for a member.

zerotier_api_accesstoken

  • Type: string
  • Default value: ""
  • Description: Access token for authenticating with the ZeroTier API. Generate one in your account settings at https://my.zerotier.com/. Without it, new members won’t be automatically authorized.

zerotier_api_url

  • Type: string
  • Default value: https://my.zerotier.com
  • Description: The URL for the ZeroTier API. Must use HTTPS.

zerotier_api_delegate

  • Type: string
  • Default value: localhost
  • Description: Option to delegate tasks for API calls, useful in scenarios where calls must be made from a specific server.

Usage

  1. Create a new directory based on the sample directory in inventory:

    cp -R inventory/sample inventory/my-cluster
    
  2. Edit inventory/my-cluster/hosts.ini to include your system information.

Example Inventory

[servers]
pi-master
pi-worker01
jetson-worker01

[master]
pi-master

[nodes]
pi-worker01
jetson-worker01

[master:vars]
zerotier_member_description='Kubernetes Pi Master Node'

[nodes:vars]
zerotier_member_description='Kubernetes Pi Workers Node'
[servers]
pi-master hostname=pi-master ansible_host=192.168.0.82 ansible_user=pi ansible_sudo_pass=password zerotier_member_description="Kubernetes Pi Master Node"
pi-worker01 ansible_port=22 hostname=pi-worker01 ansible_host=192.168.0.176 ansible_user=pi ansible_sudo_pass=password zerotier_member_description="Kubernetes Pi Worker01 Node"
jetson-worker01 ansible_port=22 hostname=jetson-worker01 ansible_host=192.168.0.227 ansible_user=jetson ansible_sudo_pass=password zerotier_member_description="Kubernetes Jetson Worker01 Node"
  1. Edit inventory/my-cluster/site.yml to include your ZeroTier information.

Example Playbook

- hosts: servers
  vars:
    zerotier_network_id: <network id>
    zerotier_api_accesstoken: <access token>
    zerotier_register_short_hostname: true

  roles:
    - ajaykumar4.zerotier

Start setting up the cluster with:

ansible-playbook inventory/my-cluster/playbook.yml -i inventory/my-cluster/hosts.ini
Informazioni sul progetto

Install and add new members to a zerotier network for x86_64 and ARM-based computers.

Installa
ansible-galaxy install ajaykumar4.zerotier
Licenza
gpl-3.0
Download
140
Proprietario