4 Commits

Author SHA1 Message Date
João Gonçalves 655ac923bb Merge 5de918f9ad into e2e9881f0f 2024-01-25 14:01:52 +07:00
João Gonçalves 5de918f9ad Merge branch 'master' into master 2024-01-12 18:24:01 +00:00
João Gonçalves 586434b80d Update test.yml 2023-12-07 16:42:06 +00:00
joao-pc-goncalves 1e25cce032 feat(k3s): added support for latest raspberrypi os (debian 12 bookworm) 2023-11-23 09:56:39 +00:00
8 changed files with 43 additions and 26 deletions
+1
View File
@@ -2,6 +2,7 @@
name: Test
on:
workflow_call:
workflow_dispatch: {}
jobs:
molecule:
name: Molecule
+3 -3
View File
@@ -1,5 +1,5 @@
---
k3s_version: v1.26.12+k3s1
k3s_version: v1.25.16+k3s4
# this is the user that has ssh access to these machines
ansible_user: ansibleuser
systemd_dir: /etc/systemd/system
@@ -66,9 +66,9 @@ metal_lb_ip_range: "192.168.30.80-192.168.30.90"
# Please read https://gist.github.com/triangletodd/02f595cd4c0dc9aac5f7763ca2264185 before using this.
# Most notably, your containers must be privileged, and must not have nesting set to true.
# Please note this script disables most of the security of lxc containers, with the trade off being that lxc
# containers are significantly more resource efficient compared to full VMs.
# containers are significantly more resource efficent compared to full VMs.
# Mixing and matching VMs and lxc containers is not supported, ymmv if you want to do this.
# I would only really recommend using this if you have particularly low powered proxmox nodes where the overhead of
# I would only really recommend using this if you have partiularly low powered proxmox nodes where the overhead of
# VMs would use a significant portion of your available resources.
proxmox_lxc_configure: false
# the user that you would use to ssh into the host, for example if you run ssh some-user@my-proxmox-host,
+5 -5
View File
@@ -7,7 +7,7 @@ platforms:
- name: control1
box: generic/ubuntu2204
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
@@ -23,7 +23,7 @@ platforms:
- name: control2
box: generic/debian11
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
@@ -34,7 +34,7 @@ platforms:
- name: control3
box: generic/rocky9
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
@@ -45,7 +45,7 @@ platforms:
- name: node1
box: generic/ubuntu2204
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
@@ -61,7 +61,7 @@ platforms:
- name: node2
box: generic/rocky9
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
+3 -3
View File
@@ -6,7 +6,7 @@ driver:
platforms:
- name: control1
box: generic/ubuntu2204
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
@@ -22,7 +22,7 @@ platforms:
- name: control2
box: generic/ubuntu2204
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
@@ -38,7 +38,7 @@ platforms:
- name: node1
box: generic/ubuntu2204
memory: 1024
memory: 4096
cpus: 2
groups:
- k3s_cluster
+2 -2
View File
@@ -6,8 +6,8 @@ driver:
platforms:
- name: control1
box: generic/ubuntu2204
memory: 4096
cpus: 4
memory: 8192
cpus: 8
config_options:
# We currently can not use public-key based authentication on Ubuntu 22.04,
# see: https://github.com/chef/bento/issues/1405
+3 -3
View File
@@ -1,8 +1,8 @@
---
- name: Create k3s-node.service.d directory
- name: Create k3s.service.d directory
file:
path: '{{ systemd_dir }}/k3s-node.service.d'
path: '{{ systemd_dir }}/k3s.service.d'
state: directory
owner: root
group: root
@@ -12,7 +12,7 @@
- name: Copy K3s http_proxy conf file
template:
src: "http_proxy.conf.j2"
dest: "{{ systemd_dir }}/k3s-node.service.d/http_proxy.conf"
dest: "{{ systemd_dir }}/k3s.service.d/http_proxy.conf"
owner: root
group: root
mode: '0755'
+26 -8
View File
@@ -17,19 +17,29 @@
when:
grep_cpuinfo_raspberrypi.rc == 0 or grep_device_tree_model_raspberrypi.rc == 0
- name: Set detected_distribution to Raspbian (ARM64 on Raspbian, Debian Buster/Bullseye/Bookworm)
- name: Set detected_distribution to Raspbian
set_fact:
detected_distribution: Raspbian
when: >
raspberry_pi|default(false) and
( ansible_facts.lsb.id|default("") == "Raspbian" or
ansible_facts.lsb.description|default("") is match("[Rr]aspbian.*") )
- name: Set detected_distribution to Raspbian (ARM64 on Debian Buster)
set_fact:
detected_distribution: Raspbian
vars:
allowed_descriptions:
- "[Rr]aspbian.*"
- "Debian.*buster"
- "Debian.*bullseye"
- "Debian.*bookworm"
when:
- ansible_facts.architecture is search("aarch64")
- raspberry_pi|default(false)
- ansible_facts.lsb.description|default("") is match(allowed_descriptions | join('|'))
- ansible_facts.lsb.description|default("") is match("Debian.*buster")
- name: Set detected_distribution to Raspbian (ARM64 on Debian Bookworm)
set_fact:
detected_distribution: Raspbian
when:
- ansible_facts.architecture is search("aarch64")
- raspberry_pi|default(false)
- ansible_facts.lsb.description|default("") is match("Debian.*bookworm")
- name: Set detected_distribution_major_version
set_fact:
@@ -37,6 +47,14 @@
when:
- detected_distribution | default("") == "Raspbian"
- name: Set detected_distribution to Raspbian (ARM64 on Debian Bullseye)
set_fact:
detected_distribution: Raspbian
when:
- ansible_facts.architecture is search("aarch64")
- raspberry_pi|default(false)
- ansible_facts.lsb.description|default("") is match("Debian.*bullseye")
- name: Execute OS related tasks on the Raspberry Pi - {{ action_ }}
include_tasks: "{{ item }}"
with_first_found:
-2
View File
@@ -51,9 +51,7 @@
name: "{{ item }}"
state: absent
with_items:
- "{{ systemd_dir }}/k3s.service.d/http_proxy.conf"
- "{{ systemd_dir }}/k3s.service.d"
- "{{ systemd_dir }}/k3s-node.service.d/http_proxy.conf"
- "{{ systemd_dir }}/k3s-node.service.d"
when: proxy_env is defined