summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks/ipsec.yml
blob: d4270d7fa0c0bd352f645c6f2000785760c9da70 (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
- name: Install strongSwan
  apt: pkg=strongswan-ikev2

- name: Ensure we have our private key
  file: path=/etc/ipsec.d/private/{{ inventory_hostname }}.key
        owner=root group=root
        mode=0600
  notify:
    - Missing IPSec certificate

- name: Ensure we have our public key
  file: path=/etc/ipsec.d/certs/{{ inventory_hostname }}.pem
        owner=root group=root
        mode=0644
  notify:
    - Missing IPSec certificate

- name: Ensure we have the CA's public key
  file: path=/etc/ipsec.d/cacerts/cacert.pem
        owner=root group=root
        mode=0644
  notify:
    - Missing IPSec certificate

- name: Configure IPSec's secrets
  template: src=etc/ipsec.secrets.j2
            dest=/etc/ipsec.secrets
            owner=root group=root
            mode=0600
  notify:
    - Restart IPSec

- name: Configure IPSec
  template: src=etc/ipsec.conf.j2
            dest=/etc/ipsec.conf
            owner=root group=root
            mode=0644
  notify:
    - Restart IPSec