summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/ipsec.yml1
-rw-r--r--roles/common/tasks/logging.yml1
-rw-r--r--roles/common/tasks/main.yml1
-rw-r--r--roles/common/tasks/ntp.yml7
-rw-r--r--roles/common/tasks/smart.yml7
-rw-r--r--roles/common/tasks/sysctl.yml2
6 files changed, 7 insertions, 12 deletions
diff --git a/roles/common/tasks/ipsec.yml b/roles/common/tasks/ipsec.yml
index 4fc2ef7..917c687 100644
--- a/roles/common/tasks/ipsec.yml
+++ b/roles/common/tasks/ipsec.yml
@@ -1,25 +1,26 @@
- name: Install strongSwan
apt: pkg={{ packages }}
vars:
packages:
- strongswan-charon
+ - strongswan-starter
# for the GCM and openssl plugins
- libstrongswan-standard-plugins
notify:
- Update firewall
- Restart IPsec
- name: Auto-create a dedicated virtual subnet for IPsec
template: src=etc/network/if-up.d/ipsec.j2
dest=/etc/network/if-up.d/ipsec
owner=root group=root
mode=0755
- name: Auto-deactivate the dedicated virtual subnet for IPsec
file: src=../if-up.d/ipsec
dest=/etc/network/if-down.d/ipsec
owner=root group=root state=link force=yes
- name: Configure IPsec
template: src=etc/ipsec.conf.j2
diff --git a/roles/common/tasks/logging.yml b/roles/common/tasks/logging.yml
index b602a49..2b4a42a 100644
--- a/roles/common/tasks/logging.yml
+++ b/roles/common/tasks/logging.yml
@@ -1,26 +1,25 @@
- name: Install logging server & utilities
apt: pkg={{ packages }}
vars:
packages:
- rsyslog
- - syslog-summary
- logcheck
- logcheck-database
- logrotate
- name: Configure rsyslog
copy: src=etc/rsyslog.conf
dest=/etc/rsyslog.conf
owner=root group=root
mode=0644
register: r1
notify:
- Restart rsyslog
tags:
- syslog
- name: Configure postfix's custom rsyslog rules
template: src=etc/rsyslog.d/postfix.conf.j2
dest=/etc/rsyslog.d/postfix.conf
owner=root group=root
mode=0644
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index fc692fa..a6795ba 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -65,32 +65,33 @@
tags:
- bacula-fd
- bacula
- import_tasks: munin-node.yml
tags:
- munin-node
- munin
- name: Install common packages
apt: pkg={{ packages }}
vars:
packages:
- ca-certificates
- etckeeper
- ethtool
- git
- htop
- molly-guard
- rsync
- screen
+ - bind9-dnsutils
- name: Disable resume device
# Cf. initramfs-tools(7) and initramfs.conf(5).
copy: src=etc/initramfs-tools/conf.d/resume
dest=/etc/initramfs-tools/conf.d/resume
owner=root group=root
mode=0644
tags:
- initramfs
- resume
notify:
- Update initramfs
diff --git a/roles/common/tasks/ntp.yml b/roles/common/tasks/ntp.yml
index 60ffef9..2ff9e49 100644
--- a/roles/common/tasks/ntp.yml
+++ b/roles/common/tasks/ntp.yml
@@ -1,26 +1,29 @@
-- name: Install/Remove ntp
- # TODO bullseye: install new package 'systemd-timesyncd'
+- name: Remove ntp package
apt: pkg=ntp state={{ state }} purge=yes
vars:
state: "{{ ('NTP_master' in group_names) | ternary('present', 'absent') }}"
+- name: Install systemd-timesyncd package
+ apt: pkg=systemd-timesyncd state=present purge=yes
+ when: "'NTP_master' not in group_names"
+
- name: Create /etc/systemd/timesyncd.conf.d
file: path=/etc/systemd/timesyncd.conf.d
state=directory
owner=root group=root
mode=0755
when: "'NTP_master' not in group_names"
- name: Configure ntp
template: src=etc/{{ conf }}.j2
dest=/etc/{{ conf }}
owner=root group=root
mode=0644
vars:
conf: "{{ ('NTP_master' in group_names) | ternary('ntp.conf', 'systemd/timesyncd.conf.d/fripost.conf') }}"
service: "{{ ('NTP_master' in group_names) | ternary('ntp', 'systemd-timesyncd') }}"
notify:
- Restart {{ service }}
- meta: flush_handlers
diff --git a/roles/common/tasks/smart.yml b/roles/common/tasks/smart.yml
index 8d35d9f..68e507f 100644
--- a/roles/common/tasks/smart.yml
+++ b/roles/common/tasks/smart.yml
@@ -1,12 +1,5 @@
- name: Install smartmontools
apt: pkg=smartmontools
-- name: Auto-enable smartmontools
- lineinfile: dest=/etc/default/smartmontools
- regexp='^(\s*#)?\s*start_smartd='
- line='start_smartd=yes'
- owner=root group=root
- mode=0644
-
- name: Start smartd
service: name=smartmontools state=started
diff --git a/roles/common/tasks/sysctl.yml b/roles/common/tasks/sysctl.yml
index f95b7fa..08a1b13 100644
--- a/roles/common/tasks/sysctl.yml
+++ b/roles/common/tasks/sysctl.yml
@@ -1,40 +1,38 @@
- sysctl: name={{ item.name }} value={{ item.value }} sysctl_set=yes
with_items:
- { name: 'kernel.domainname', value: '{{ ansible_domain }}' }
# Networking. See
# https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
# Enable Spoof protection (reverse-path filter). Turn on Source
# Address Verification in all interfaces to prevent some spoofing
# attacks.
- { name: 'net.ipv4.conf.default.rp_filter', value: 1 }
- { name: 'net.ipv4.conf.all.rp_filter', value: 1 }
# Disable SYN cookies and improve SYN backlog handling, see tcp(7) and
# https://levelup.gitconnected.com/linux-kernel-tuning-for-high-performance-networking-high-volume-incoming-connections-196e863d458a
- # TODO bullseye: remove net.core.somaxconn as 5.4 and later default to 4096
- { name: 'net.ipv4.tcp_syncookies', value: 0 }
- { name: 'net.ipv4.tcp_synack_retries', value: 1 }
- { name: 'net.ipv4.tcp_max_syn_backlog', value: 32768 }
- - { name: 'net.core.somaxconn', value: 4096 }
# We rate-limit not only the default ICMP types 3, 4, 11 and 12
# (0x1818), but also types 0 and 8. See icmp(7).
- { name: 'net.ipv4.icmp_ratemask', value: 6425 }
- { name: 'net.ipv4.icmp_ratelimit', value: 1000 }
# Disable packet forwarding between interfaces (we are not a router).
- { name: 'net.ipv4.ip_forward', value: 0 }
- { name: 'net.ipv6.conf.all.forwarding', value: 0 }
# Do not accept ICMP redirects (prevent MITM attacks).
- { name: 'net.ipv4.conf.all.accept_redirects', value: 0 }
- { name: 'net.ipv6.conf.all.accept_redirects', value: 0 }
# Do not send ICMP redirects (we are not a router).
- { name: 'net.ipv4.conf.default.send_redirects', value: 0 }
- { name: 'net.ipv4.conf.all.send_redirects', value: 0 }
# Do not accept IP source route packets (we are not a router).
- { name: 'net.ipv4.conf.all.accept_source_route', value: 0 }