hybridadmin.strongswan
Rôle StrongSwan
Testé sur :
- Ubuntu 18.04 et 20.04
- CentOS 7 et 8
- Debian 9 et 10
Ce rôle utilise une syntaxe de type swanctl.conf (référence aux sections, depuis 5.7.0).
Variables
Général
strongswan_swanctl_settings
: [requis] : Définir tous les paramètres pour swanctl.conf
Paramètres StrongSwan (serveur|clients) :
strongswan_swanctl_config_dir
: [optionnel, par défaut :/etc/strongswan/swanctl
] : Répertoire qui contient le swanctl.conf de StrongSwanstrongswan_swanctl_config_file
: [optionnel, par défaut :{{ strongswan_swanctl_config_dir }}/swanctl.conf
] : Le nom du fichier de configuration swanctl de StrongSwanstrongswan_letsencrypt_enable
: [optionnel, par défaut :true
] : Préparer le certificat du serveur StrongSwan avec Let's Encryptstrongswan_firewalld_enable
: [optionnel, par défaut :true
] : Définir toutes les règles de pare-feu nécessaires pour le serveur StrongSwanstrongswan_client
: [optionnel, par défaut :false
] : Installer et configurer StrongSwan sur les clientsstrongswan_download_cert
: [optionnel, par défaut :false
] : Télécharger le certificat StrongSwan depuis l'hôte serveur. À utiliser avecstrongswan_letsencrypt_enable
=true
strongswan_upload_cert
: [optionnel, par défaut :false
] : Télécharger le certificat StrongSwan vers les clients. À utiliser avecstrongswan_letsencrypt_enable
=true
Dépendances
- geerlingguy.certbot
Variables
Variables d'hôte pour le serveur StrongSwan :
# Activer la variable ci-dessous uniquement pour la première génération de certificat
certbot_create_if_missing: yes
certbot_certs:
- email: [email protected]
domains:
- "{{ inventory_hostname }}"
certbot_create_standalone_stop_services: []
# Définir la configuration swanctl de StrongSwan
# https://wiki.strongswan.org/projects/strongswan/wiki/UsableExamples
strongswan_swanctl_settings:
connections:
ikev2-eap:
version: 2
rekey_time: 0s
fragmentation: oui
proposals: aes192gcm16-aes128gcm16-prfsha256-ecp256-ecp521,aes192-sha256-modp3072,default
encap: oui
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 d'hôte pour carol.strongswan.org :
strongswan_swanctl_settings:
connections:
home:
encap: oui
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
Exemples de Playbook
Playbook pour serveur StrongSwan avec certificats PKI :
- hosts: server
vars:
strongswan_letsencrypt_enable: false
roles:
- hybridadmin.strongswan
Playbook pour serveur StrongSwan avec certificats Letsencrypt :
- hosts: server
vars:
strongswan_letsencrypt_enable: true
certbot_certs:
- email: [email protected]
domains:
- vpn.example.com
roles:
- hybridadmin.strongswan
Playbook pour clients StrongSwan :
- hosts:
- server
roles:
- hybridadmin.strongswan
vars:
strongswan_client: true
strongswan_download_cert: true
- hosts:
- clients
roles:
- hybridadmin.strongswan
vars:
strongswan_upload_cert: true
À faire
- Supprimer certains rôles de dépendances pour plus de flexibilité.
Licence
Licence BSD à 2 clauses "Simplifiée"
Informations sur l'auteur
hybridadmin
À propos du projet
Role to configure a strongSwan IPSec VPN server.
Installer
ansible-galaxy install hybridadmin.strongswan
Licence
Unknown
Téléchargements
348
Propriétaire
Windows/Linux enthusiast and lover of all things automation #devops #ansible #docker #powershell