Skip to content

Commit

Permalink
Added support for ArchLinux (ARM64) (i.e., k3s-io/k3s-ansible/k3s-io#146
Browse files Browse the repository at this point in the history
 [assapir])

Signed-off-by: Jon S. Stumpf <[email protected]>
  • Loading branch information
jon-stumpf committed Dec 23, 2021
1 parent 48c9b6a commit 7e569a1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions roles/prereq/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
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:
name: "{{ item }}"
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
Expand Down
8 changes: 8 additions & 0 deletions roles/raspberrypi/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions roles/raspberrypi/tasks/prereq/ArchLinux.yml
Original file line number Diff line number Diff line change
@@ -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

1 comment on commit 7e569a1

@jon-stumpf
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@assapir,

I don't have an ArchLinux system to test but would appreciate it if you could try out this branch. It incorporates many of the outstanding PRs on k3s-io/k3s-ansible.

Let me know if it works for you.

Please sign in to comment.