Code Monkey home page Code Monkey logo

infra_openvpn's Introduction

WORK-IN-PROGRESS! DON'T USE IN PRODUCTION!

OpenVPN Logo

Ansible Role - OpenVPN Client-to-Site VPN

WARNING: This role is still in development. DO NOT TRY TO USE IN PRODUCTION!

Role to deploy OpenVPN Client-to-Site VPN setups.

Buy me a coffee

Molecule Test Status YamlLint Test Status PyLint Test Status Ansible-Lint Test Status Ansible Galaxy

Molecule Logs: Short, Full

OpenVPN Editions

This role uses the OpenSource OpenVPN Community edition.

Why use the community edition?

  • Pros:

    • No license fees - one server can scale up to thousands of clients without any major costs
    • All major functionalities are covered by the opensource edition
    • Manageable using Ansible
  • Cons

    • This edition has no graphical (web-) user-interface!

      If you are searching for a pretty web-ui to click at => check out the OpenVPN Access Server

Tested:

  • Debian 11
  • Debian 12

Install

# latest
ansible-galaxy role install git+https://github.com/ansibleguy/infra_openvpn

# from galaxy
ansible-galaxy install ansibleguy.infra_openvpn

# or to custom role-path
ansible-galaxy install ansibleguy.infra_openvpn --roles-path ./roles

# install dependencies
ansible-galaxy install -r requirements.yml

Usage

You want a simple Ansible GUI? Check-out my Ansible WebUI

Config

Define the config as needed:

openvpn:

You might want to use 'ansible-vault' to encrypt your passwords:

ansible-vault encrypt_string

Execution

Run the playbook:

ansible-playbook -K -D -i inventory/hosts.yml playbook.yml

There are also some useful tags available: * *

To debug errors - you can set the 'debug' variable at runtime:

# WARNING: Will log passwords!
ansible-playbook -K -D -i inventory/hosts.yml playbook.yml -e debug=yes

To let OpenVPN services be automatically restarted (without interactive prompts):

ansible-playbook -K -D -i inventory/hosts.yml playbook.yml -e auto_restart=yes

Functionality

  • Package installation

    • Ansible dependencies (minimal)
  • Configuration *

    • Default config: *

    • Default opt-ins: *

    • Default opt-outs: *

Info

  • Info: If you want to know more about configuring OpenVPN-community - check out their comprehensive documentation

    Interesting pages:

  • Info: ChromeOS uses the Open-Network-Configuration (ONC) format.

    It is formatted in JSON and pretty hard to debug as you do not get any useful error messages.

    The profile-template provided by this role might not work for every edge-case.

    If you need to troubleshoot it - look into the ONC documentation. But be aware: not every option might work practically as documented..

  • Warning: If a OpenVPN instance should support connections to ChromeOS clients - you will need to set the 'openvpn.instances.[name].security.tls_crypt' option to 'false' as this is not (currently) supported by the ChromeOS implementation.

  • Note: this role currently only supports debian-based systems

  • Note: Most of the role's functionality can be opted in or out.

    For all available options - see the default-config located in the main defaults-file!

  • Warning: Not every setting/variable you provide will be checked for validity. Bad config might break the role!

  • Info: If you want to user openvpn.unprivileged: true for gained system-security the installed OpenVPN binary needs to support iproute2!

    The role will check if the binary is compatible and fail is that is not the case!

    Options how to gain support for iproute2:

    • You will have to use a binary that was compiled with that option enabled
    • Uninstall existing OpenVPN packages/binaries
    • Copy/link the openvpn binary to /usr/local/bin
  • Info: If you are using multi-factor-authentication you might run into issues when some clients (like ChromeOS) do not support a second input field for the second secret!

    You might need to set openvpn.server.auth.mfa_separator to any unusual characters you like. (per example: <<<)

    This enables you to input both secret1 (password) and secret2 (totp pin) in the same input field! Like so: p4ssW0rd<<<001122

    The default separator : will always be supported - even if you set a custom one. This allows both ways to be supported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.