Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow other architecture hosts #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions metal/roles/k3s/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
k3s_version: v1.28.3+k3s2

k3s_architectures:
x86_64:
arch_suffix: ""
arch_sum: sha256sum-amd64.txt
aarch64:
arch_suffix: "-arm64"
arch_sum: sha256sum-arm64.txt

k3s_config_file: /etc/rancher/k3s/config.yaml
k3s_token_file: /etc/rancher/node/password
k3s_service_file: /etc/systemd/system/k3s.service
Expand Down
9 changes: 5 additions & 4 deletions metal/roles/k3s/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
- name: Download k3s binary
ansible.builtin.get_url:
url: https:/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s
checksum: sha256:https:/k3s-io/k3s/releases/download/{{ k3s_version }}/sha256sum-amd64.txt
dest: "{{ role_path }}/files/bin/k3s"
url: https:/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s{{ k3s_architectures[item].arch_suffix }}
checksum: sha256:https:/k3s-io/k3s/releases/download/{{ k3s_version }}/{{ k3s_architectures[item].arch_sum }}
dest: "{{ role_path }}/files/bin/k3s{{ k3s_architectures[item].arch_suffix }}"
mode: 0755
delegate_to: localhost
run_once: true
register: k3s_binary
loop: "{{ k3s_architectures.keys() | list }}"

- name: Copy k3s binary to nodes
ansible.builtin.copy:
src: bin/k3s
src: bin/k3s{{ k3s_architectures[ansible_architecture].arch_suffix }}
dest: /usr/local/bin/k3s
owner: root
group: root
Expand Down