2017-03-18 09:22:07 +00:00
|
|
|
---
|
2019-04-26 15:48:28 +00:00
|
|
|
- name: Set OS specific facts
|
|
|
|
set_fact:
|
2017-03-18 09:22:07 +00:00
|
|
|
strongswan_additional_plugins: []
|
|
|
|
|
2017-04-01 04:19:10 +00:00
|
|
|
- name: Ubuntu | Install strongSwan
|
2017-05-08 20:34:24 +00:00
|
|
|
apt:
|
|
|
|
name: strongswan
|
2019-04-26 15:48:28 +00:00
|
|
|
state: present
|
2017-05-08 20:34:24 +00:00
|
|
|
update_cache: yes
|
|
|
|
install_recommends: yes
|
2017-03-18 09:22:07 +00:00
|
|
|
|
2019-05-30 18:57:47 +00:00
|
|
|
- block:
|
|
|
|
# https://bugs.launchpad.net/ubuntu/+source/strongswan/+bug/1826238
|
|
|
|
- name: Ubuntu | Charon profile for apparmor configured
|
|
|
|
copy:
|
|
|
|
dest: /etc/apparmor.d/local/usr.lib.ipsec.charon
|
|
|
|
content: ' capability setpcap,'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: restart strongswan
|
|
|
|
|
|
|
|
- name: Ubuntu | Enforcing ipsec with apparmor
|
|
|
|
command: aa-enforce "{{ item }}"
|
|
|
|
changed_when: false
|
|
|
|
with_items:
|
|
|
|
- /usr/lib/ipsec/charon
|
|
|
|
- /usr/lib/ipsec/lookip
|
|
|
|
- /usr/lib/ipsec/stroke
|
|
|
|
tags: apparmor
|
2019-04-26 15:48:28 +00:00
|
|
|
when: apparmor_enabled|default(false)|bool
|
2017-03-18 09:22:07 +00:00
|
|
|
|
|
|
|
- name: Ubuntu | Enable services
|
|
|
|
service: name={{ item }} enabled=yes
|
|
|
|
with_items:
|
|
|
|
- apparmor
|
2020-04-25 16:42:07 +00:00
|
|
|
- "{{ strongswan_service }}"
|
2017-03-18 09:22:07 +00:00
|
|
|
- netfilter-persistent
|
|
|
|
|
2019-09-28 00:10:20 +00:00
|
|
|
- name: Ubuntu | Ensure that the strongswan service directory exists
|
2017-05-08 20:34:24 +00:00
|
|
|
file:
|
2020-04-25 16:42:07 +00:00
|
|
|
path: /etc/systemd/system/{{ strongswan_service }}.service.d/
|
2017-05-08 20:34:24 +00:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
owner: root
|
|
|
|
group: root
|
2017-03-18 09:22:07 +00:00
|
|
|
|
|
|
|
- name: Ubuntu | Setup the cgroup limitations for the ipsec daemon
|
2017-05-08 20:34:24 +00:00
|
|
|
template:
|
|
|
|
src: 100-CustomLimitations.conf.j2
|
2020-04-25 16:42:07 +00:00
|
|
|
dest: /etc/systemd/system/{{ strongswan_service }}.service.d/100-CustomLimitations.conf
|
2017-03-18 09:22:07 +00:00
|
|
|
notify:
|
|
|
|
- daemon-reload
|
|
|
|
- restart strongswan
|