m4rcu5nl / ansible-role-zerotier

Ansible role to install Zerotier-One and join a Zerotier network
GNU General Public License v3.0
78 stars 50 forks source link

Does not seem to allow setting ip - API changed ?! #40

Open ieugen opened 3 years ago

ieugen commented 3 years ago

Hi,

I tried to setup my network with a custom IP and it failed.

I set this var to a host and it did not work. Commenting that line fixed it, but no IP assignement.

zerotier_member_ip_assignments: '["172.23.0.1"]'

Playbook output

TASK [m4rcu5nl.zerotier-one : Configure members in network] **************************************************************************************************************************************
task path: ansible/roles/m4rcu5nl.zerotier-one/tasks/authorize_node.yml:20
fatal: [daos-v]: FAILED! => {"accept_ranges": "bytes", "access_control_allow_origin": "*", "changed": false, "connection": "close", "content": "{\"type\":\"internal\",\"message\":\"Error updating member: ERROR: invalid input syntax for type inet: \\\"2\\\" (SQLSTATE 22P02)\"}", "content_length": "120", "content_type": "application/json", "date": "Fri, 09 Apr 2021 13:13:18 GMT", "elapsed": 0, "json": {"message": "Error updating member: ERROR: invalid input syntax for type inet: \"2\" (SQLSTATE 22P02)", "type": "internal"}, "msg": "Status code was 500 and not [200]: HTTP Error 500: Internal Server Error", "redirected": false, "status": 500, "strict_transport_security": "max-age=300", "url": "https://my.zerotier.com/api/network/REDACTED/member/REDACTED", "via": "1.1 google, 1.1 varnish", "x_cache": "MISS", "x_cache_hits": "0", "x_frame_options": "SAMEORIGIN", "x_served_by": "cache-hhn4078-HHN", "x_timer": "S1617973998.358212,VS0,VE194"}
mje-nz commented 2 years ago

For anyone else with this issue, I debugged mine by running the playbook with -vvv, and it turned out that I was using the wrong syntax to define a list variable and it came out as a string, which I think is also what @ieugen did.