NewNewYorkBridges / ansible-tor-bridge

Ansible role to deploy Tor Bridge nodes.
GNU General Public License v3.0
7 stars 5 forks source link

TASK [alphacorvus.ansible_tor_bridge : Register result] fails #10

Closed toralf closed 2 years ago

toralf commented 2 years ago

Running https://github.com/toralf/tor-relays/blob/main/cert.yml yields to (snip'ed sensitive data):

TASK [alphacorvus.ansible_tor_bridge : Register cert] ***************************************************************************************************************************************
task path: /home/tfoerste/.ansible/roles/alphacorvus.ansible_tor_bridge/tasks/bridge_line.yml:21
ok: [<snip>] => {"ansible_facts": {"cert": ["<snip>"]}, "changed": false}

TASK [alphacorvus.ansible_tor_bridge : Register result] *************************************************************************************************************************************
task path: /home/tfoerste/.ansible/roles/alphacorvus.ansible_tor_bridge/tasks/bridge_line.yml:27
fatal: [zwiebeltoralf5]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0\n\nThe error appears to be in '/home/tfoerste/.ansible/roles/alphacorvus.ansible_tor_bridge/tasks/bridge_line.yml': line 27, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Register result\n  ^ here\n"}

at a recent Debian.

lilianbaz commented 2 years ago

The task bridge_line.yml is an optional task that create a temporary file on the ansible node with the information of your bridges. It use the public IP in the var public_ip. You can set it directly on the Ansible host file for each bridge. If the public IP is directly attached to a network interface (for example, ens3) you can to this: public_ip={{ ansible_ens3.ipv4.address }}.

It's not well documented... we just write it at the end of the README! Maybe we need to update the host file example for better understanding

toralf commented 2 years ago

The task bridge_line.yml is an optional task that create a temporary file on the ansible node with the information of your bridges. It use the public IP in the var public_ip. You can set it directly on the Ansible host file for each bridge. If the public IP is directly attached to a network interface (for example, ens3) you can to this: public_ip={{ ansible_ens3.ipv4.address }}.

It's not well documented... we just write it at the end of the README! Maybe we need to update the host file example for better understanding

Hhm, I did it (otherwise I would get "undefined public_ip") - the issue still exists :-/

toralf commented 2 years ago

The regex of the fingerprint should allow digits (but probably much more) in the nickname:

regex_findall('[a-z0-9]+ ([A-Z0-9]+)')

;)

lilianbaz commented 2 years ago

Erf, thanks for pointing this! Updated, according to the man Nicknames must be between 1 and 19 characters inclusive, and must contain only the characters [a-zA-Z0-9]..