summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2014-07-14 03:24:39 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:53:10 +0200
commit3a5a4b57c83d9a6b06807315fd2de33852e23257 (patch)
tree3ed5fc3875da314b69ac537225af7bcf222c9b03
parentb6ab225539b9b88803e8fe7e58fc65454120366b (diff)
Don't install smartd on Xen guests.
S.M.A.R.T makes little sense for virtual HDDs.
-rw-r--r--roles/common/tasks/main.yml1
-rw-r--r--roles/common/tasks/smart.yml4
2 files changed, 2 insertions, 3 deletions
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 903e834..c98af99 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,31 +1,32 @@
---
- include: sysctl.yml tags=sysctl
- include: hosts.yml
- include: apt.yml tags=apt
- include: firewall.yml tags=firewall,iptables
- include: samhain.yml tags=samhain
- include: auditd.yml tags=auditd
- include: rkhunter.yml tags=rkhunter
- include: clamav.yml tags=clamav
- include: fail2ban.yml tags=fail2ban
- include: smart.yml tags=smartmontools,smart
+ when: "not (ansible_virtualization_role == 'guest' and ansible_virtualization_type == 'xen')"
- include: haveged.yml tags=haveged,entropy
- name: Copy genkeypair.sh
copy: src=usr/local/bin/genkeypair.sh
dest=/usr/local/bin/genkeypair.sh
owner=root group=root
mode=0755
tags:
- genkey
- include: logging.yml tags=logging
- include: ntp.yml tags=ntp
- include: mail.yml tags=mail,postfix
- name: Install common packages
apt: pkg={{ item }}
with_items:
- ca-certificates
- etckeeper
- ethtool
- git
- harden-clients
diff --git a/roles/common/tasks/smart.yml b/roles/common/tasks/smart.yml
index 56502ea..b24b302 100644
--- a/roles/common/tasks/smart.yml
+++ b/roles/common/tasks/smart.yml
@@ -1,15 +1,13 @@
- name: Install smartmontools
- # apt-listbugs complains due to #706909.
+ # XXX apt-listbugs complains due to #706909.
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
- # smartd can be heavy on VMs, don't bother starting it up if it's down
- when: not (ansible_processor[0] | search("^QEMU Virtual CPU .*"))