Index: /main/waeup-ansible/files/swap_accounting.cfg
===================================================================
--- /main/waeup-ansible/files/swap_accounting.cfg	(revision 13995)
+++ /main/waeup-ansible/files/swap_accounting.cfg	(revision 13995)
@@ -0,0 +1,12 @@
+# Enable swap accounting, to be placed in /etc/default/grub.d/
+# Afterwards `update-grub` and reboot must be run/done.
+# Script from ulif, based on dmraid2mdadm.cfg from stock ubuntu.
+SWAPACCOUNTING_TOAPPEND="cgroup_enable=memory swapaccount=1"
+
+case "$GRUB_CMDLINE_LINUX_DEFAULT" in
+    *$SWAPACCOUNTING_TOAPPEND*)
+        ;;
+    *)
+        GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT $SWAPACCOUNTING_TOAPPEND"
+        ;;
+esac
Index: /main/waeup-ansible/roles/core/handlers/main.yml
===================================================================
--- /main/waeup-ansible/roles/core/handlers/main.yml	(revision 13995)
+++ /main/waeup-ansible/roles/core/handlers/main.yml	(revision 13995)
@@ -0,0 +1,5 @@
+---
+# handlers for core provisionings
+- name: "update grub"
+  command: /usr/sbin/update-grub
+  become: true
Index: /main/waeup-ansible/roles/core/tasks/grub.yml
===================================================================
--- /main/waeup-ansible/roles/core/tasks/grub.yml	(revision 13995)
+++ /main/waeup-ansible/roles/core/tasks/grub.yml	(revision 13995)
@@ -0,0 +1,12 @@
+---
+- name: "add swap accounting options"
+  copy:
+    src="swap_accounting.cfg"
+    dest="/etc/default/grub.d/swap_accounting.cfg"
+    owner=root
+    group=root
+    mode=644
+  become: true
+  notify: update grub
+  tags:
+    - grub
Index: /main/waeup-ansible/roles/core/tasks/main.yml
===================================================================
--- /main/waeup-ansible/roles/core/tasks/main.yml	(revision 13994)
+++ /main/waeup-ansible/roles/core/tasks/main.yml	(revision 13995)
@@ -1,3 +1,5 @@
 ---
+- include: grub.yml
+
 - name: "create 'deploy' user"
   user:
