trailofbits / algo

Set up a personal VPN in the cloud
https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/
GNU Affero General Public License v3.0
29.01k stars 2.33k forks source link

Installation fails under Ansible 9.1.0 with Hetzner Cloud #14697

Closed mahmoudhossam closed 8 months ago

mahmoudhossam commented 9 months ago

Describe the bug

Can't install Algo to a Hetzner Cloud instance

To Reproduce

Steps to reproduce the behavior:

  1. Cloned algo
  2. Installed python 3.11
  3. Created a venv using the aforementioned version and activated it
  4. Installed algo dependencies inside venv
  5. Ran both ./algo and ansible-playbook with additional vars, same error

Expected behavior

Installation should finish without errors

Additional context

Python version: 3.11.7

pip freeze output:

ansible==9.1.0
ansible-core==2.16.3
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
cryptography==42.0.2
idna==3.6
Jinja2==3.0.3
MarkupSafe==2.1.5
netaddr==0.10.1
packaging==23.2
pycparser==2.21
pyOpenSSL==24.0.0
python-dateutil==2.8.2
PyYAML==6.0.1
requests==2.31.0
resolvelib==0.8.1
segno==1.6.1
six==1.16.0
urllib3==2.2.1

Full log

» ./algo

PLAY [localhost] *********************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Playbook dir stat] *************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Ensure Ansible is not being run in a world writable directory] *****************************************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}
[DEPRECATION WARNING]: Use 'ansible.utils.ipaddr' module instead. This feature will be removed from ansible.netcommon in a release after 2024-01-01. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: The value '' is not a valid IP address or network, passing this value to ipaddr filter might result in breaking change in future.

TASK [Ensure the requirements installed] *********************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Set required ansible version as a fact] ****************************************************************************************************************************************************************************************************
ok: [localhost] => (item=ansible==9.1.0)

TASK [Just get the list from default pip] ********************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Verify Python meets Algo VPN requirements] *************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Verify Ansible meets Algo VPN requirements] ************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}
[WARNING]: Found variable using reserved name: no_log

PLAY [Ask user for the input] ********************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************
ok: [localhost]
[Cloud prompt]
What provider would you like to use?
    1. DigitalOcean
    2. Amazon Lightsail
    3. Amazon EC2
    6. Microsoft Azure
    7. Google Compute Engine
    8. Hetzner Cloud
    9. Vultr
    10. Scaleway
    11. OpenStack (DreamCompute optimised)
    12. CloudStack (Exoscale optimised)
    13. Linode
    14. Install to existing Ubuntu latest LTS server (for more advanced users)

Enter the number of your desired provider
:

TASK [Cloud prompt] ******************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Set facts based on the input] **************************************************************************************************************************************************************************************************************
ok: [localhost]
[VPN server name prompt]
Name the vpn server
[algo]
:

TASK [VPN server name prompt] ********************************************************************************************************************************************************************************************************************
ok: [localhost]
[Cellular On Demand prompt]
Do you want macOS/iOS clients to enable "Connect On Demand" when connected to cellular networks?
[y/N]
:

TASK [Cellular On Demand prompt] *****************************************************************************************************************************************************************************************************************
ok: [localhost]
[Wi-Fi On Demand prompt]
Do you want macOS/iOS clients to enable "Connect On Demand" when connected to Wi-Fi?
[y/N]
:

TASK [Wi-Fi On Demand prompt] ********************************************************************************************************************************************************************************************************************
ok: [localhost]
[Retain the PKI prompt]
Do you want to retain the keys (PKI)? (required to add users in the future, but less secure)
[y/N]
:

TASK [Retain the PKI prompt] *********************************************************************************************************************************************************************************************************************
ok: [localhost]
[DNS adblocking prompt]
Do you want to enable DNS ad blocking on this VPN server?
[y/N]
:

TASK [DNS adblocking prompt] *********************************************************************************************************************************************************************************************************************
ok: [localhost]
[SSH tunneling prompt]
Do you want each user to have their own account for SSH tunneling?
[y/N]
:

TASK [SSH tunneling prompt] **********************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Set facts based on the input] **************************************************************************************************************************************************************************************************************
ok: [localhost]

PLAY [Provision the server] **********************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************
ok: [localhost]

--> Please include the following block of text when reporting issues:

Algo running on: Arch Linux (Virtualized: wsl)
Created from git fork. Last commit: 74051d0 Update README.md dependencies (#14634)
Python 3.11.7
Runtime variables:
    algo_provider "hetzner"
    algo_ondemand_cellular "False"
    algo_ondemand_wifi "False"
    algo_ondemand_wifi_exclude "X251bGw="
    algo_dns_adblocking "True"
    algo_ssh_tunneling "False"
    wireguard_enabled "True"
    dns_encryption "True"

TASK [Display the invocation environment] ********************************************************************************************************************************************************************************************************
changed: [localhost]

TASK [Install the requirements] ******************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Generate the SSH private key] **************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Generate the SSH public key] ***************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Copy the private SSH key to /tmp] **********************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Include a provisioning role] ***************************************************************************************************************************************************************************************************************
ERROR! couldn't resolve module/action 'hcloud_datacenter_facts'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/mahmoud/Projects/algo/roles/cloud-hetzner/tasks/prompts.yml': line 15, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Get regions
  ^ here
jackivanov commented 9 months ago

https://github.com/trailofbits/algo/pull/14698 should fix it