Reduce unnecessary API calls

The role will no longer make API calls to authorize already authorized members to a network.
This commit is contained in:
Marcus Meurs
2018-12-04 01:06:35 +01:00
parent c03c2b5a3f
commit 672c67e087
2 changed files with 9 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
---
- block:
- name: Authorize members to network
- name: Authorize new members to network
uri:
url: "{{ zerotier_api_url }}/api/network/{{ zerotier_network_id }}/member/{{ ansible_local.zerotier.node_id }}"
method: POST
@@ -13,6 +13,8 @@
body_format: json
register: auth_apiresult
delegate_to: "{{ zerotier_api_delegate }}"
when:
- ansible_local.zerotier.networks[zerotier_network_id] is not defined or ansible_local.zerotier.networks[zerotier_network_id].status != 'OK'
- name: Configure members in network
uri: