Merge pull request #11 from m4rcu5nl/develop

Debian support added
pull/12/head^2 v0.2-beta.1
Marcus 2018-01-29 22:29:36 +01:00 committed by GitHub
commit f82ab21515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 5 deletions

View File

@ -3,7 +3,7 @@
Zerotier
=========
This Ansible role installs the zerotier-one package from Zerotier's yum repo, adds and authorizes new members to (existing) Zerotier network and tells the new members to join the network.
This Ansible role installs the zerotier-one package, adds and authorizes new members to (existing) Zerotier network and tells the new members to join the network.
Requirements
------------

View File

@ -36,6 +36,9 @@ galaxy_info:
- name: EL
versions:
- 7
- name: Debian
versions:
- all
# - name: Fedora
# versions:
# - all
@ -49,7 +52,6 @@ galaxy_info:
galaxy_tags:
- zerotier-one
- CentOS 7
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.

View File

@ -1,4 +1,6 @@
---
# Redhat variants
- block: # Add zerotier repo and it's gpg key
- name: Add zerotier gpg key
rpm_key:
@ -13,10 +15,29 @@
gpgcheck: yes
enabled: yes
register: zerotier_repo
tags:
- installation
- repositories
when: ansible_os_family == "RedHat"
# Debian variants
- block: # Add zerotier repo and it's gpg key if not already done.
- name: Check if zerotier is already installed
package:
name: zerotier-one
state: present
check_mode: true
register: zerotier_repo
- name: Install zerotier
shell: curl -s 'https://pgp.mit.edu/pks/lookup?op=get&search=0x1657198823E52A61' | gpg --import && \
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
register: zerotier_repo
when: zerotier_repo.changed
tags:
- installation
- repositories
when: ansible_os_family == "Debian"
- block: #Install and enable zerotier-one
- name: Install zerotier-one

View File

@ -1,7 +1,7 @@
---
- block: # Join Zerotier network
- name: Get Zerotier NodeID
shell: /sbin/zerotier-cli info | awk '{print $3}'
shell: zerotier-cli info | awk '{print $3}'
register: nodeid
- name: Set NodeID as fact
@ -23,7 +23,7 @@
register: apiresult
- name: Join Zerotier network
command: /sbin/zerotier-cli join {{ zerotier_network_id }}
command: zerotier-cli join {{ zerotier_network_id }}
args:
creates: /var/lib/zerotier-one/networks.d/{{ zerotier_network_id }}.conf