summaryrefslogtreecommitdiffstats
path: root/roles/common/templates/etc/ipsec.conf.j2
blob: 5ac2dd14a64999afbb126001bd785eadac318c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# {{ ansible_managed }}
# Do NOT edit this file directly!

config setup
    # crlcheckinterval = 600
    strictcrlpolicy    = no
    # cachecrls        = yes
    plutostart         = no

# Add connections here.

conn %default
    keyexchange  = ikev2
    ikelifetime  = 1h
    keylife      = 15m
    rekeymargin  = 3m
    keyingtries  = 1
    esp          = aes128gcm16-ecp256!
    ike          = aes128gcm16-aesxcbc-ecp256!
    # TODO: test DynDNS
    mobike       = no
    leftauth     = pubkey
    left         = %defaultroute
    leftcert     = {{ inventory_hostname }}.pem
    leftid       = "C=SE, O=Fripost, OU=IPsec, CN={{ inventory_hostname }}"
    leftca       = "C=SE, O=Fripost, OU=root CA, CN=IPsec (internal network)"
    leftfirewall = yes
    rightauth    = pubkey
    rightca      = %same
    auto         = start

{% for host in groups.all|sort %}
{% if host != inventory_hostname %}

conn {{ host }}
    right   = {{ hostvars[host]['inventory_hostname'] }}
    rightid = "C=SE, O=Fripost, OU=IPsec, CN={{ hostvars[host]['inventory_hostname'] }}"
{% endif -%}
{%- endfor %}