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
28.98k stars 2.32k forks source link

Unable to deploy Algo server #1870

Closed keithbakermartin closed 4 years ago

keithbakermartin commented 4 years ago

Describe the bug

I am attempting to deploy Algo on Digital Ocean from an SSH session to an Ubuntu Host. After creating a new droplet, installing and updating, and editing config.cfg, I run ./algo and step through the choices offered. The install fails with the following error message:

TASK [Display the invocation environment] ** fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an unde fined variable. The error was: 'wireguard_enabled' is undefined\n\nThe error app ears to be in '/root/algo/playbooks/cloud-pre.yml': line 3, column 5, but may\nb e elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - name: Display the invocation environment\n ^ here\n"}

To Reproduce

Steps to reproduce the behavior:

From a Digital Ocean Ubuntu 18.04 droplet:

1.  apt-get -y update
2.  apt-get -y upgrade
3.  apt install -y python3-virtualenv
4.  shutdown -r now
5.  git clone https://github.com/trailofbits/algo
6.  cd algo
7.  python3 -m virtualenv --python=/usr/bin/python3 .env
8.  source .env/bin/activate
9.  python3 -m pip install -U pip virtualenv
  1. python3 -m pip install -r requirements.txt
  2. vim config.cfg
  3. ./algo

Expected behavior

Install completes and I am able to configure clients.

Additional context

Add any other context about the problem here.

Full log

[WARNING]: Could not match supplied host pattern, ignoring: vpn-host

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" }

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

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

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" }

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
  4. Microsoft Azure
  5. Google Compute Engine
  6. Hetzner Cloud
  7. Vultr
  8. Scaleway
  9. OpenStack (DreamCompute optimised)
  10. CloudStack (Exoscale optimised)
  11. Linode
  12. Install to existing Ubuntu 18.04 or 20.04 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] [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]

TASK [Display the invocation environment] **** fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'wireguard_enabled' is undefined\n\nThe error appears to be in '/root/algo/playbooks/cloud-pre.yml': line 3, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - name: Display the invocation environment\n ^ here\n"} included: /root/algo/playbooks/rescue.yml for localhost

TASK [debug] ***** ok: [localhost] => { "fail_hint": [ "Sorry, but something went wrong!", "Please check the troubleshooting guide.", "https://trailofbits.github.io/algo/troubleshooting.html" ] }

TASK [Fail the installation] ***** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}

PLAY RECAP *** localhost : ok=19 changed=0 unreachable=0 failed=1 skipped=2 rescued=1 ignored=0

davidemyers commented 4 years ago

I can't reproduce this. Please post the output of git diff.

keithbakermartin commented 4 years ago

Embarrassingly, I can't reproduce it either. I blew away the previous install directory, repeated the steps above, and was able to complete the install. Probably should have tried that in the first place.