asc.core.services_ovpn role – Deploy the OpenVPN server and its client-profile portal

Note

This role is part of the asc.core collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: git clone git@ssh.dev.azure.com:v3/cloudasc/iac-ansible-collections/core $HOME/.ansible/collections/ansible_collections/asc/core.

To use it in a playbook, specify: asc.core.services_ovpn.

Entry point main – Deploy the OpenVPN server and its client-profile portal

New in asc.core 1.0.0

Synopsis

  • Deploys an OpenVPN server together with a small web portal that hands out client profiles, giving users VPN access into the environment’s networks.

  • Authentication is Microsoft Entra ID SSO performed at connect time, so MFA is whatever Conditional Access enforces; access is granted only to the users.csv email addresses tagged for the VPN.

  • The Azure SDK used for the Key Vault lookup is isolated in a virtualenv, as Ubuntu 24.04 is PEP 668 externally-managed.

Parameters

Parameter

Comments

services_ovpn

dictionary

‘services_ovpn’ role configuration

app_display_name

string

Display name of the application to register in Azure AD

Default: "OpenVPN"

enabled

boolean

Whether to enable the role

Choices:

  • false ← (default)

  • true

ovpn_dev

string

Device to use for OpenVPN

Choices:

  • "tun" ← (default)

  • "tap"

ovpn_netmask

string

Netmask to use for OpenVPN

Default: "255.255.255.0"

ovpn_port

integer

Port to use for OpenVPN

Default: 443

ovpn_proto

string

Protocol to use for OpenVPN

Choices:

  • "tcp" ← (default)

  • "udp"

ovpn_subnet

string

Subnet to use for OpenVPN

Default: "192.168.80.0"

owners

list / elements=string

List of owners of the application to register in Azure AD (email addresses)

Default: []

redirect_gateway

string

Setting this to true will force all traffic to go through the VPN

Default: "True"

use_dns

boolean

Whether to use the OpenVPN server as DNS server.

If set to ‘true’, the clients will receive the configuration to use the OpenVPN server as DNS server.

This provides the ability to resolve internal Azure resources.

Choices:

  • false ← (default)

  • true

vm_name

string

Name of the VM to deploy

Default: "vmovpn01"

vm_size

string

Size of the VM to deploy (Azure VM size)

Default: "Standard_B2as_v2"

services_ovpn_azure_venv

path

added in asc.core 2.0.0

Virtualenv holding the Azure SDK on the OpenVPN host (Ubuntu 24.04 is PEP 668 externally-managed, so it cannot be installed system-wide).

Default: "/opt/ovpn-azure-venv"

services_ovpn_oauth2_version

string

Version of openvpn-auth-oauth2 to install

Default: "1.28.3"

Authors

  • Ignace De Cock