36 Commits

Author SHA1 Message Date
bd13f3a938 update controller api to support new routes 2024-10-07 21:54:26 +05:30
Marcus
0b9f100aa5 Use variable for gpg fingerprint
Using the fingerprint in the rpm_key module requires Ansible 2.9. Updated meta file to reflect this requirement.
2020-03-09 02:44:38 +01:00
Marcus
90167ae771 Merge pull request #30 from ClashTheBunny/pgp_key_id
Add PGP key `id` for added security
2020-03-09 02:33:09 +01:00
Marcus
dc68166c27 Merge pull request #32 from dsteinkopf/master
fix usage of register variable function
2020-03-09 02:16:00 +01:00
Dirk Steinkopf
c9339c1f3b fix usage of register variable function 2019-11-16 18:23:45 +01:00
Randall Mason
76b57fb097 Add PGP key id for added security 2019-06-09 12:50:53 -05:00
Marcus Meurs
154899586e Use the same fact syntax throughout the role
Create consistency by using the ansible_facts['somefact'] syntax everywhere.
2018-12-10 23:47:16 +01:00
Marcus Meurs
95d9213746 Adds network device to ansible_local.zerotier
Also removes the conditional for skipping installation based on ansible_local.zerotier value. Skipping tasks like that should be up to the user, not the role.
2018-12-07 23:40:48 +01:00
Marcus Meurs
b86bc4c73d Rearrange conditionals
release_repo.status needs to be checked after distribution.
2018-12-07 23:35:32 +01:00
Marcus Meurs
fd68894bad Possible fix for #26
If ansible_distribution is Ubuntu the role will check if there is a dedicated repo matching the ansible_distribution_release. If this is not the case but the ansible_distribution_major_version is 18, the repo for the bionic release will be used.
2018-12-06 05:35:32 +01:00
Marcus Meurs
4dac8000fc Variable naming convention
Updated 2 variable names to follow naming convention. For backwards compatibility the old names are rewritten to the new ones in the role's defaults.
2018-12-04 05:00:38 +01:00
Marcus Meurs
672c67e087 Reduce unnecessary API calls
The role will no longer make API calls to authorize already authorized members to a network.
2018-12-04 01:34:39 +01:00
Marcus Meurs
c03c2b5a3f Set custom facts persistently
Create /etc/ansible/facts.d/zerotier.fact on each node containing custom facts in json format. This can then be used to prevent pointless reconfiguration of existing nodes whenever a new one is added to the inventory. In this commit it merely skips the installation tasks.
2018-12-03 07:05:37 +01:00
Marcus Meurs
f3c9d6d2d0 Drop privilege at block level
Apparently `local_action` and `delegate_to` handle `become: false` differently. The later ignored it when it was done at task level.
2018-12-01 05:56:20 +01:00
Marcus
6118217734 Merge pull request #23 from G10h4ck/auth_delegation
Make authentication delegation configurable
2018-10-15 19:04:18 +02:00
Gio
d2c2e6494c Make authentication delegation configurable
Before this commit the authentication task was runned as a local_action
so if the zerotier controller was on a different machine that the
ansible controller, the zerotier controller API had to bind to 0.0.0.0
instead of 127.0.0.1 with the security implication this burden this
imply (setup HTTPS, setup firewall and so on).
With this commit this behaviour is now configurable with zerotier_api_delegate
variable, by default that variable is set to localhost so it behave
exactly as before this commit, but if set the action is run on the
preferred machine, in my case the zerotier network controller is part of
the same playbook so I set
    zerotier_api_delegate: zerotierNetworkControllerMachineName
    zerotier_api_url: http://127.0.0.1:9993/
So I can benefit from this ansible role without the burden of setting up
global listening + HTTPS etc...
2018-10-15 18:08:01 +02:00
PercyJax
e04ba73642 Update package manager cache before install
As it currently stands, after the repo is added, apt-get update (or equivalent) is not performed, and zerotier-one install fails.
2018-09-25 13:44:55 -04:00
Marcus
d089ef4aaf Merge pull request #19 from zhaofengli/master
Add Arch Linux support
2018-07-25 23:42:01 +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
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
Marcus Meurs
8f5f3c7181 Description option added
- Added description to API call. Defaults to empty string.
- Variable descriptoin and example added to readme
2018-04-05 01:32:16 +02:00
Marcus Meurs
b5544a53aa Tests as filters deprecated
"Using Ansible-provided Jinja tests as filters is deprecated and will be removed in Ansible 2.9."
2018-04-05 00:20:10 +02:00
Andy Shinn
f1cc5c4e49 somes fixups 2018-02-15 19:59:14 -06:00
Barry Flanagan
054d554a4d Update install.yml to fix fresh Debian install.
Fresh install was failing if the zerotier repo did not exist. Changed the initial check to check the existence of the zerotier repo file.
2018-02-04 22:31:33 +00:00
Barry flanagan
5ab3e67331 Add support for Debian distros 2018-01-29 15:11:08 +00:00
Marcus Meurs
c90f7556c2 Resolved errors in check-mode
Fixes #3
2017-12-17 05:49:36 +01:00
Marcus Meurs
51d2085c02 Move away from deprecated way to include tasks
Fixes #6
2017-12-17 05:32:14 +01:00
Marcus Meurs
c9b9eca84a Join network
Add members to private Zerotier network and authorize them. Lets members join the network afterwards.
2017-07-27 00:48:55 +02:00
Marcus Meurs
8e5fd5d83c Better service state handling 2017-07-27 00:34:10 +02:00
Marcus Meurs
cddaf793e8 Add installation tasks
Add Zerotier repo and it's pgp key. Install zerotier-one.
2017-07-27 00:23:20 +02:00
Marcus Meurs
bbb264d0d5 ansible-galaxy init 2017-07-26 23:44:44 +02:00