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.
pull/20/head
Marcus Meurs 2018-04-05 11:32:19 +02:00
parent 7b9f5d02a3
commit 31e25cb3f0
1 changed files with 3 additions and 1 deletions

View File

@ -10,7 +10,8 @@
zerotier_node_id: "{{ nodeid.stdout }}"
- name: Add and authorize members to network
uri:
local_action:
module: uri
url: "{{ zerotier_api_url }}/api/network/{{ zerotier_network_id }}/member/{{ zerotier_node_id }}"
method: POST
headers:
@ -24,6 +25,7 @@
ipAssignments: "{{ zerotier_member_ip_assignments | default([]) | list }}"
body_format: json
register: apiresult
become: false
when:
- zerotier_accesstoken is defined