summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2013-12-08 00:58:07 +0100
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:51:12 +0200
commitba5d5e607bf5b651f3b19fc9b84209d0f4097294 (patch)
tree0b0d74d63c9342a9ba5eef8e7a8dc669539493f2 /roles
parent5b209a8e337f03683c45d0eb6029e2321cc3e82b (diff)
Configure S.M.A.R.T.
Diffstat (limited to 'roles')
-rw-r--r--roles/common/tasks/main.yml1
-rw-r--r--roles/common/tasks/smart.yml14
2 files changed, 15 insertions, 0 deletions
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 76967e6..62f1743 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -6,6 +6,7 @@
- include: samhain.yml tags=samhain
- include: rkhunter.yml tags=rkhunter
- include: fail2ban.yml tags=fail2ban
+- include: smart.yml tags=smartmontools,smart
- include: ipsec.yml tags=strongswan,ipsec
- include: logging.yml tags=logging
- include: ntp.yml tags=ntp
diff --git a/roles/common/tasks/smart.yml b/roles/common/tasks/smart.yml
new file mode 100644
index 0000000..2c7ac17
--- /dev/null
+++ b/roles/common/tasks/smart.yml
@@ -0,0 +1,14 @@
+- name: Install smartmontools
+ # apt-listbugs complains due to #706909.
+ apt: pkg=smartmontools
+
+- name: Configure 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
+ when: ansible_virtualization_role is not defined and ansible_virtualization_type is not defined