diff --git a/README.md b/README.md index 6344b3957..c3592c69f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Build a Kubernetes cluster using Ansible with k3s. The goal is easily install a - [X] Debian - [X] Ubuntu - [X] CentOS +- [X] ArchLinux on processor architecture: diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml index d01597251..f4fe9c8de 100644 --- a/roles/prereq/tasks/main.yml +++ b/roles/prereq/tasks/main.yml @@ -24,13 +24,13 @@ content: "br_netfilter" dest: /etc/modules-load.d/br_netfilter.conf mode: "u=rw,g=,o=" - when: ansible_distribution in ['CentOS', 'RedHat', 'Red Hat Enterprise Linux'] + when: ansible_distribution in ['ArchLinux', 'CentOS', 'RedHat', 'Red Hat Enterprise Linux'] - name: Load br_netfilter modprobe: name: br_netfilter state: present - when: ansible_distribution in ['CentOS', 'RedHat', 'Red Hat Enterprise Linux'] + when: ansible_distribution in ['ArchLinux', 'CentOS', 'RedHat', 'Red Hat Enterprise Linux'] - name: Set bridge-nf-call-iptables (just to be sure) sysctl: @@ -38,7 +38,7 @@ value: "1" state: present reload: yes - when: ansible_distribution in ['CentOS', 'RedHat', 'Red Hat Enterprise Linux'] + when: ansible_distribution in ['ArchLinux', 'CentOS', 'RedHat', 'Red Hat Enterprise Linux'] loop: - net.bridge.bridge-nf-call-iptables - net.bridge.bridge-nf-call-ip6tables diff --git a/roles/raspberrypi/tasks/main.yml b/roles/raspberrypi/tasks/main.yml index b80c91fec..b39350fa6 100644 --- a/roles/raspberrypi/tasks/main.yml +++ b/roles/raspberrypi/tasks/main.yml @@ -39,6 +39,14 @@ when: - detected_distribution | default("") == "Raspbian" +- name: Set detected_distribution to ArchLinux (ARM64) + set_fact: + detected_distribution: Archlinux + when: + - ansible_facts.architecture is search("aarch64") + - raspberry_pi|default(false) + - ansible_facts.os_family is match("Archlinux") + - name: execute OS related tasks on the Raspberry Pi include_tasks: "{{ item }}" with_first_found: diff --git a/roles/raspberrypi/tasks/prereq/ArchLinux.yml b/roles/raspberrypi/tasks/prereq/ArchLinux.yml new file mode 100644 index 000000000..c1db0f24a --- /dev/null +++ b/roles/raspberrypi/tasks/prereq/ArchLinux.yml @@ -0,0 +1,15 @@ +--- +- name: Enable cgroup support if not already enabled + lineinfile: + path: /boot/boot.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' + register: cgroup_support + +- name: Regenerate bootloader image + shell: ./mkscr + args: + chdir: /boot + notify: reboot + when: cgroup_support.changed