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.
develop
Marcus Meurs 2018-12-06 05:35:32 +01:00
parent 4dac8000fc
commit fd68894bad
2 changed files with 23 additions and 1 deletions

View File

@ -2,8 +2,29 @@
apt_key:
url: "{{ zerotier_gpg_url }}"
- name: Check if Ubuntu release has dedicated repo
uri:
url: "{{ zerotier_download_base_url }}/debian/{{ zerotier_deb_release_repo }}"
failed_when: false
when:
- ansible_facts['distribution'] == "Ubuntu"
register: release_repo
- block:
- name: Overwrite Ubuntu release repo name
set_fact:
zerotier_deb_release_repo: bionic
- name: Re-gather facts
setup: ~
when:
- release_repo.status == 404
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_major_version'] == "18"
- name: Add ZeroTier APT repository
apt_repository:
repo: deb {{ zerotier_download_base_url }}/debian/{{ ansible_distribution_release }} {{ ansible_distribution_release }} main
repo: deb {{ zerotier_download_base_url }}/debian/{{ zerotier_deb_release_repo }} {{ zerotier_deb_release_repo }} main
filename: zerotier
register: zerotier_repo

View File

@ -1,4 +1,5 @@
---
# vars file for ansible-role-zerotier
zerotier_download_base_url: http://download.zerotier.com
zerotier_deb_release_repo: "{{ ansible_facts['distribution_release'] }}"
zerotier_gpg_url: https://download.zerotier.com/contact@zerotier.com.gpg