serverbee.strongswan
StrongSwan Rolle
Getestet auf:
- Ubuntu 18.04 und 20.04
- CentOS 7 und 8
- Debian 9 und 10
Diese Rolle verwendet eine swanctl.conf-Stil Syntax (verweist auf Abschnitte, seit 5.7.0).
Variablen
Allgemein
strongswan_swanctl_settings
: [erforderlich]: Alle Einstellungen für swanctl.conf festlegen
StrongSwan (Server|Clients) Einstellungen:
strongswan_swanctl_config_dir
: [optional, Standard:/etc/strongswan/swanctl
]: Verzeichnis, das die StrongSwan swanctl.conf enthältstrongswan_swanctl_config_file
: [optional, Standard:{{ strongswan_swanctl_config_dir }}/swanctl.conf
]: Name der StrongSwan swanctl Konfigurationsdateistrongswan_letsencrypt_enable
: [optional, Standard:true
]: StrongSwan Serverzertifikat mit Let's Encrypt vorbereitenstrongswan_firewalld_enable
: [optional, Standard:true
]: Alle benötigten Firewallregeln für den StrongSwan Server festlegenstrongswan_client
: [optional, Standard:false
]: StrongSwan auf Clients installieren und konfigurierenstrongswan_download_cert
: [optional, Standard:false
]: StrongSwan-Zertifikat vom Serverhost herunterladen. Sollte mitstrongswan_letsencrypt_enable
=true
verwendet werdenstrongswan_upload_cert
: [optional, Standard:false
]: StrongSwan-Zertifikat an Clients hochladen. Sollte mitstrongswan_letsencrypt_enable
=true
verwendet werden
Abhängigkeiten
- geerlingguy.certbot
Variablen
Host-Variablen für StrongSwan Server:
# Aktivieren Sie die untenstehende Variable nur für die erste Zertifikatserstellung
certbot_create_if_missing: yes
certbot_certs:
- email: email@example.com
domains:
- "{{ inventory_hostname }}"
certbot_create_standalone_stop_services: []
# StrongSwan swanctl-Konfiguration festlegen
# 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
Host-Variablen für 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
Playbook Beispiele
StrongSwan Server mit PKI-Zertifikaten Playbook:
- hosts: server
vars:
strongswan_letsencrypt_enable: false
roles:
- serverbee.strongswan
StrongSwan Server mit Letsencrypt-Zertifikaten Playbook:
- hosts: server
vars:
strongswan_letsencrypt_enable: true
certbot_certs:
- email: janedoe@example.com
domains:
- vpn.example.com
roles:
- serverbee.strongswan
StrongSwan Clients Playbook:
- hosts:
- server
roles:
- serverbee.strongswan
vars:
strongswan_client: true
strongswan_download_cert: true
- hosts:
- clients
roles:
- serverbee.strongswan
vars:
strongswan_upload_cert: true
To-Do
- Entfernen einiger Abhängigkeitsrollen, um mehr Flexibilität zu erreichen.
Lizenz
BSD 2-Klausel "Vereinfachte" Lizenz
Autoreninformation
Vitaly Yakovenko
hybridadmin
Über das Projekt
Role to configure a strongSwan IPSec VPN server.
Installieren
ansible-galaxy install serverbee.strongswan
Lizenz
Unknown
Downloads
252
Besitzer