Skip to content

Commit

Permalink
Add archlinux (aarch64) support (#146)
Browse files Browse the repository at this point in the history
* Add archlinux (aarch64) support

Signed-off-by: Assaf Sapir <[email protected]>
  • Loading branch information
Assaf Sapir authored Nov 8, 2023
1 parent 83de431 commit 057b3bf
Show file tree
Hide file tree
Showing 4 changed files with 26 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', 'Red Hat Enterprise Linux','RedHat']
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'RedHat', 'Archlinux']

- name: Load br_netfilter
community.general.modprobe:
name: br_netfilter
state: present
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux','RedHat']
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'RedHat', 'Archlinux']

- name: Set bridge-nf-call-iptables (just to be sure)
ansible.posix.sysctl:
name: "{{ item }}"
value: "1"
state: present
reload: true
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux','RedHat']
when: ansible_distribution in ['CentOS', 'Red Hat Enterprise Linux', 'RedHat', 'Archlinux']
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 @@ -33,6 +33,14 @@
( ansible_facts.lsb.id|default("") == "Debian" or
ansible_facts.lsb.description|default("") is match("Debian") )
- name: Set detected_distribution to ArchLinux (ARM64)

Check failure on line 36 in roles/raspberrypi/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

fqcn[action-core]

Use FQCN for builtin module actions (set_fact).
set_fact:
detected_distribution: Archlinux
when:
- ansible_facts.architecture is search("aarch64")
- raspberry_pi|default(false)
- ansible_facts.os_family is match("Archlinux")

- name: Set detected_distribution_major_version
ansible.builtin.set_fact:
detected_distribution_major_version: "{{ ansible_facts.lsb.major_release }}"
Expand Down
14 changes: 14 additions & 0 deletions roles/raspberrypi/tasks/prereq/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Enable cgroup via boot commandline if not already enabled for Archlinux

Check failure on line 2 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

fqcn[action-core]

Use FQCN for builtin module actions (lineinfile).
lineinfile:
path: /boot/boot.txt
search_string: setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=${uuid} rw rootwait smsc95xx.macaddr="${usbethaddr}"

Check failure on line 5 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[line-length]

Line too long (135 > 120 characters)

Check warning on line 5 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

5:121 [line-length] line too long (135 > 120 characters)
line: setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=${uuid} rw rootwait smsc95xx.macaddr="${usbethaddr}" cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

Check failure on line 6 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[line-length]

Line too long (184 > 120 characters)

Check warning on line 6 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

6:121 [line-length] line too long (184 > 120 characters)
register: kernel_cmdline_cgroup

- name: Create

Check failure on line 9 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

command-instead-of-shell

Use shell only when shell functionality is required.

Check failure on line 9 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

fqcn[action-core]

Use FQCN for builtin module actions (shell).

Check failure on line 9 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

no-changed-when

Commands should not change things if nothing needs doing.

Check failure on line 9 in roles/raspberrypi/tasks/prereq/Archlinux.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.
shell: ./mkscr
args:
chdir: /boot
notify: reboot
when: kernel_cmdline_cgroup.changed

0 comments on commit 057b3bf

Please sign in to comment.