diff --git a/roles/common/files/smartd-override.conf b/roles/common/files/smartd-override.conf new file mode 100644 index 0000000000000000000000000000000000000000..01ba0b51fe393f15e813d1e48037d6cffb607154 --- /dev/null +++ b/roles/common/files/smartd-override.conf @@ -0,0 +1,2 @@ +[Unit] +ConditionVirtualization=no diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 559a880b9d29cd8730f822523bb844eabaa69bea..50f8b6196fd317a2ce8ad2bff9457ced71344be0 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -23,8 +23,16 @@ pacman: name=smartmontools state=present when: "'hcloud' not in group_names" +# override smartd.service with ConditionVirtualization=no +# this should appear in the next upstream release, see https://github.com/smartmontools/smartmontools/issues/62 +- name: create drop-in directory for smartd.service + file: path=/etc/systemd/system/smartd.service.d state=directory owner=root group=root mode=0755 + +- name: install drop-in snippet for smartd.service + copy: src=smartd-override.conf dest=/etc/systemd/system/smartd.service.d/override.conf owner=root group=root mode=0644 + - name: start and enable smart - service: name=smartd enabled=yes state=started + service: name=smartd enabled=yes state=started daemon_reload=yes when: "'hcloud' not in group_names" - name: start and enable btrfs scrub timer