diff --git a/README.md b/README.md index 71fa1b1..e0e617d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Author: Build a Kubernetes cluster using Ansible with k3s. The goal is easily install a Kubernetes cluster on machines running: - [X] Debian -- [ ] Ubuntu +- [X] Ubuntu - [X] CentOS on processor architecture: diff --git a/roles/ubuntu/tasks/main.yml b/roles/ubuntu/tasks/main.yml new file mode 100644 index 0000000..233e259 --- /dev/null +++ b/roles/ubuntu/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: Enable cgroup via boot commandline if not already enabled + lineinfile: + path: /boot/firmware/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' + when: + - ansible_distribution == 'Ubuntu' + +- name: Reboot to enable cgroups + reboot: + when: + - ansible_distribution == 'Ubuntu' diff --git a/site.yml b/site.yml index f7fa9ac..8862e96 100644 --- a/site.yml +++ b/site.yml @@ -7,7 +7,7 @@ - role: prereq - role: download - role: raspbian - + - role: ubuntu - hosts: master become: yes