Skip to content

Commit

Permalink
wip #14 create/rebuild vpn server
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsimpson committed Oct 12, 2024
1 parent 2933554 commit fed4612
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ _*which you may not have a lot of control or say over the running of._
# Quickstart

### To re-deploy VPN server/client from scratch
```
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
ansible-galaxy collection install --force --collections-path ./ --requirements-file requirements.yml
# Run playbook to create/rebuild fresh vpn server
ansible-playbook -i inventory.ini --ask-vault-pass playbooks/create-rebuild-vpn-server.yml
```

1. Create Ubuntu server (Ubuntu 20.04 has been tested)
1. Run playbook to create Ubuntu server (Ubuntu 20.04 has been tested)
2. Run [Deploy VPN Client pipeline](https://github.com/KarmaComputing/server-bootstrap/actions/workflows/deploy-vpn.yml) to deploy IPsec and Wireguard tunnel

### To add a new user to VPN:
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/vpn/inventory.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[vpn_servers]
changeme ansible_user=changeme

[localhost]
localhost ansible_connection=local
15 changes: 15 additions & 0 deletions src/vpn/playbooks/create-rebuild-vpn-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name:
hosts: localhost
ignore_unreachable: true

tasks:
- name: Create/Rebuild vpn-server
hetzner.hcloud.server:
api_token: "{{ hetzner_hcloud_token }}"
name: vpn-server
location: eu-central
server_type: cx11
image: ubuntu-20.04
state: rebuild

2 changes: 2 additions & 0 deletions src/vpn/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ansible
python-dateutil
requests
6 changes: 6 additions & 0 deletions src/vpn/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
# Install Hetzner collection
- name: hetzner.hcloud
version: ">=3.1.1"
source: https://galaxy.ansible.com

0 comments on commit fed4612

Please sign in to comment.