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
parent
4dac8000fc
commit
fd68894bad
|
|
@ -2,8 +2,29 @@
|
||||||
apt_key:
|
apt_key:
|
||||||
url: "{{ zerotier_gpg_url }}"
|
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
|
- name: Add ZeroTier APT repository
|
||||||
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
|
filename: zerotier
|
||||||
register: zerotier_repo
|
register: zerotier_repo
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
# vars file for ansible-role-zerotier
|
# vars file for ansible-role-zerotier
|
||||||
zerotier_download_base_url: http://download.zerotier.com
|
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
|
zerotier_gpg_url: https://download.zerotier.com/contact@zerotier.com.gpg
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue