Add Alpine Linux configuration

Signed-off-by: Jiayi Hu <jiayi.ghu@gmail.com>
This commit is contained in:
Jiayi Hu
2020-12-15 00:24:20 +01:00
parent 999803ae14
commit d22ad01d50
8 changed files with 135 additions and 30 deletions

View File

@@ -1,3 +1,7 @@
---
- name: reboot
reboot:
- name: lbu
debug:
msg: If you are diskless on Alpine you should commit changes with 'lbu -u' now and reboot.

View File

@@ -0,0 +1,29 @@
---
- name: Add cgroup mount point
lineinfile:
path: /etc/fstab
line: cgroup /sys/fs/cgroup cgroup defaults 0 0
- name: Define cgroup mount points
copy:
content: |
mount {
cpuacct = /cgroup/cpuacct;
memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;
net_cls = /cgroup/net_cls;
blkio = /cgroup/blkio;
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
}
dest: /etc/cgconfig.conf
mode: 0644
- name: Enable cgroup via boot commandline if not already enabled
lineinfile:
path: /media/mmcblk0p1/cmdline.txt
backrefs: yes
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$'
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
notify: lbu