serverbee.strongswan
Rol de StrongSwan
Probado en:
- Ubuntu 18.04 y 20.04
- CentOS 7 y 8
- Debian 9 y 10
Este rol utiliza una sintaxis estilo swanctl.conf (referenciando secciones, desde la versión 5.7.0).
Variables
Generales
strongswan_swanctl_settings
: [requerido]: Establecer todas las configuraciones para swanctl.conf
Configuraciones de StrongSwan (servidor|clientes):
strongswan_swanctl_config_dir
: [opcional, predeterminado:/etc/strongswan/swanctl
]: Directorio que contiene el archivo swanctl.conf de StrongSwan.strongswan_swanctl_config_file
: [opcional, predeterminado:{{ strongswan_swanctl_config_dir }}/swanctl.conf
]: Nombre del archivo de configuración swanctl de StrongSwan.strongswan_letsencrypt_enable
: [opcional, predeterminado:true
]: Preparar el certificado del servidor StrongSwan con Let's Encrypt.strongswan_firewalld_enable
: [opcional, predeterminado:true
]: Establecer todas las reglas de firewall necesarias para el servidor StrongSwan.strongswan_client
: [opcional, predeterminado:false
]: Instalar y configurar StrongSwan en los clientes.strongswan_download_cert
: [opcional, predeterminado:false
]: Descargar el certificado de StrongSwan desde el host del servidor. Debe usarse constrongswan_letsencrypt_enable
=true
.strongswan_upload_cert
: [opcional, predeterminado:false
]: Subir el certificado de StrongSwan a los clientes. Debe usarse constrongswan_letsencrypt_enable
=true
.
Dependencias
- geerlingguy.certbot
Variables
Variables de host para el servidor StrongSwan:
# Habilitar la variable a continuación solo para la generación del primer certificado
certbot_create_if_missing: yes
certbot_certs:
- email: [email protected]
domains:
- "{{ inventory_hostname }}"
certbot_create_standalone_stop_services: []
# Establecer configuración swanctl de StrongSwan
# https://wiki.strongswan.org/projects/strongswan/wiki/UsableExamples
strongswan_swanctl_settings:
connections:
ikev2-eap:
version: 2
rekey_time: 0s
fragmentation: yes
proposals: aes192gcm16-aes128gcm16-prfsha256-ecp256-ecp521,aes192-sha256-modp3072,default
encap: yes
pools: primary-pool-ipv4
dpd_delay: 30s
local-1:
certs: cert.pem
id: myid
remote-1:
auth: eap-dynamic
eap_id: "%any"
children:
ikev2-eap:
local_ts: 0.0.0.0/0,::/0
rekey_time: 0s
dpd_action: clear
esp_proposals: aes192gcm16-aes128gcm16-prfsha256-ecp256-modp3072,aes192-sha256-ecp256-modp3072,default
pools:
primary-pool-ipv4:
addrs: 192.168.252.0/24
secrets:
eap-user:
id: user
secret: Ar3e73tTnp02
Variables de host para carol.strongswan.org:
strongswan_swanctl_settings:
connections:
home:
encap: yes
vips: 0.0.0.0
remote_addrs: moon.strongswan.org
version: 2
children:
home:
remote_ts: 0.0.0.0/0,::/0
start_action: none
local:
auth: eap-aka
eap_id: carol
remote:
auth: pubkey
id: moon.strongswan.org
secrets:
eap-carol:
id: carol
secret: Ar3etTnp
Ejemplos de Playbook
Playbook de servidor StrongSwan con certificados PKI:
- hosts: server
vars:
strongswan_letsencrypt_enable: false
roles:
- serverbee.strongswan
Playbook de servidor StrongSwan con certificados Letsencrypt:
- hosts: server
vars:
strongswan_letsencrypt_enable: true
certbot_certs:
- email: [email protected]
domains:
- vpn.example.com
roles:
- serverbee.strongswan
Playbook de clientes StrongSwan:
- hosts:
- server
roles:
- serverbee.strongswan
vars:
strongswan_client: true
strongswan_download_cert: true
- hosts:
- clients
roles:
- serverbee.strongswan
vars:
strongswan_upload_cert: true
Tareas pendientes
- Eliminar algunos roles de dependencias para lograr más flexibilidad.
Licencia
Licencia BSD de 2 cláusulas "Simplificada".
Información de los autores
Vitaly Yakovenko
hybridadmin
Acerca del proyecto
Role to configure a strongSwan IPSec VPN server.
Instalar
ansible-galaxy install serverbee.strongswan
Licencia
Unknown
Descargas
252
Propietario