diff --git a/main.yml b/main.yml index a016376..200bf69 100644 --- a/main.yml +++ b/main.yml @@ -1,7 +1,7 @@ --- - name: Set up cluster-wide configuration. hosts: cluster - gather_facts: false + gather_facts: true become: true handlers: @@ -26,6 +26,18 @@ - "cgroup_memory=1" - "cgroup_enable=memory" notify: reboot-pi + when: ansible_distribution == 'Debian' + + - name: Ensure cgroups are configured correctly in ubuntuEnv.txt. + ansible.builtin.replace: + path: /boot/firmware/ubuntuEnv.txt + regexp: '^(bootargs=[\w](?!.*\b{{ item }}\b).*)$' + replace: '\1 {{ item }}' + with_items: + - "cgroup_memory=1" + - "cgroup_enable=memory" + notify: reboot-pi + when: ansible_distribution == 'Ubuntu' - name: Download K3s install script. ansible.builtin.get_url: