Giter VIP home page Giter VIP logo

ansible-role-openvpn's Introduction

OpenVPN Servers and Clients

For a list of VPN servers and clients, install OpenVPN and Easy-RSA packages and generate server and client configurations for OpenVPN tunnels. Bring the VPN connections up.

In this role, we follow a model in which all clients initiate tunnel connections to all servers, building what could be a mesh of point-to-point VPN connections.

Requirements

For access to OpenVPN and Easy-RSA packages, this role will install the EPEL repo, if it is not already present.

The hosts in the play must be able to communicate with one another via TCP/IP or UDP/IP.

Role Variables

openvpn_servers: List of inventory hostnames of the OpenVPN servers.

openvpn_clients: List of hostnames of clients.

openvpn_tunnel_cidr: OpenVPN tunnel network subnet. The OpenVPN servers will create sub-subnets from this range. The OpenVPN servers each take the first IP address of their allocated subnet. The default value is 10.8.0.0/24

openvpn_server_proto: Establish the connection using TCP or UDP. The default value is tcp

openvpn_server_port: The TCP or UDP port for communication with the OpenVPN server. The default value is 1194

openvpn_intra_if: If the internal network to propagate is not the default gateway, it can be defined using its network interface name instead.

Dependencies

None.

Example Playbook

The following playbook creates VPN tunnels between a server and some client hosts.

---
# This playbook synchronises timekeeping and establishes an OpenVPN
# tunnel between a VPN server and a number of clients.

- hosts:
    - openvpn-servers
    - openvpn-clients
  become: yes
  roles:
    - role: stackhpc.openvpn
      openvpn_servers: "{{ groups['openvpn-servers'] }}"
      openvpn_clients: "{{ groups['openvpn-clients'] }}"
      openvpn_server_proto: "udp"

...

Author Information

ansible-role-openvpn's People

Contributors

markgoddard avatar oneswig avatar priteau avatar stackhpc-ci avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-openvpn's Issues

Failures on debian based systems

When tested on a Debian based system, several failures were observed due to no verification that the openvpn group exists:

TASK [openvpn : Ensure OpenVPN Easy-RSA directory exists] **************************************************************************************************************
fatal: [3.132.87.227]: FAILED! => {"changed": false, "gid": 0, "group": "root", "mode": "0755", "msg": "chgrp failed: failed to look up group openvpn", "owner": "root", "path": "/etc/openvpn/easy-rsa", "size": 4096, "state": "directory", "uid": 0}

It looks like there is no openvpn group utilized in Debian and the directory/file ownership is set to root:root

When changing the ownership to root:root in the file modules used in tasks/server.yml, the task completed successfully.

I not sharp enough with openvpn to know a definite best fix: You could create the group and modify Debian installations of openvpn to run under those permissions, more simple, or just fork the logic so that it sets the permissions of the openvpn/easy-rsa directories to root:root if Ansible detects it's a Debian based system (I know this works)

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.