11 Commits

Author SHA1 Message Date
Marcus
8a8db43397 Merge pull request #20 from m4rcu5nl/develop
Version 1.1.0
2018-07-26 00:01:52 +02:00
Marcus
d089ef4aaf Merge pull request #19 from zhaofengli/master
Add Arch Linux support
2018-07-25 23:42:01 +02:00
Marcus Meurs
c6f5836dc7 Merge branch 'feature/api_workaround' into develop 2018-07-25 23:21:20 +02:00
Marcus Meurs
3de2e738d4 2 separate API calls
- authorize member
- configure member

This is a workaround for the issue described in #17
2018-07-25 23:19:47 +02:00
Zhaofeng Li
10fd2fd498 Add Arch Linux support 2018-07-25 23:03:35 +08:00
Marcus
1a235172aa Merge pull request #18 from etcet/add-fedora-repo
Add repo for Fedora
2018-05-14 00:04:29 +02:00
Chris
33c53916c0 Add repo for Fedora 2018-05-10 12:55:33 -05:00
Marcus Meurs
54f3f0bcc0 Merge branch 'feature/improve_performance' into develop 2018-04-09 05:36:28 +02:00
Marcus Meurs
4146b7a257 Option to skip installation
Give the user an option to skip the installation tasks. There's no real need to download the pgp key and packages again when all you want to do is reconfigure existing members.
2018-04-09 04:30:56 +02:00
Marcus Meurs
31e25cb3f0 Make API call local_action
Having the controller talk to the ZeroTier API instead of connecting to the target hosts and make them do it is much faster.
2018-04-05 11:32:19 +02:00
Marcus Meurs
7b9f5d02a3 Conditional installation
Don't import installation tasks when the zt0 interface is present on target host.
2018-04-05 11:23:07 +02:00
5 changed files with 36 additions and 7 deletions

View File

@@ -9,8 +9,24 @@
set_fact:
zerotier_node_id: "{{ nodeid.stdout }}"
- name: Add and authorize members to network
uri:
- name: Authorize members to network
local_action:
module: uri
url: "{{ zerotier_api_url }}/api/network/{{ zerotier_network_id }}/member/{{ zerotier_node_id }}"
method: POST
headers:
Authorization: bearer {{ zerotier_accesstoken }}
body:
hidden: false
config:
authorized: "{{ zerotier_authorize_member }}"
body_format: json
register: auth_apiresult
become: false
- name: Configure members in network
local_action:
module: uri
url: "{{ zerotier_api_url }}/api/network/{{ zerotier_network_id }}/member/{{ zerotier_node_id }}"
method: POST
headers:
@@ -18,12 +34,11 @@
body:
name: "{{ zerotier_register_short_hostname | ternary(inventory_hostname_short, inventory_hostname) }}"
description: "{{ zerotier_member_description | default() }}"
hidden: false
config:
authorized: "{{ zerotier_authorize_member }}"
ipAssignments: "{{ zerotier_member_ip_assignments | default([]) | list }}"
body_format: json
register: apiresult
register: conf_apiresult
become: false
when:
- zerotier_accesstoken is defined

View File

@@ -22,7 +22,7 @@
- enable zerotier-one
when:
- zerotier_repo is succeeded
- zerotier_repo is not defined or zerotier_repo is succeeded
- not ansible_check_mode
tags:
- installation

View File

@@ -0,0 +1 @@
# zerotier-one is available in the official repositories

View File

@@ -3,7 +3,7 @@
state: present
key: "{{ zerotier_gpg_url }}"
- name: Add ZeroTier repo
- name: Add ZeroTier repo for RHEL/CentOS
yum_repository:
name: zerotier
description: ZeroTier, Inc. RPM Release Repository
@@ -11,3 +11,14 @@
gpgcheck: yes
enabled: yes
register: zerotier_repo
when: ansible_distribution != "Fedora"
- name: Add zerotier repo for Fedora
yum_repository:
name: zerotier
description: ZeroTier, Inc. RPM Release Repository
baseurl: https://download.zerotier.com/redhat/fc/$releasever
gpgcheck: yes
enabled: yes
register: zerotier_repo
when: ansible_distribution == "Fedora"

View File

@@ -1,6 +1,8 @@
---
# tasks file for ansible-role-zerotier
- import_tasks: install.yml
when:
- not skip_install|default(false)|bool
- import_tasks: authorize_node.yml
when: