forked from tim/k3s-ansible
Drop support for CentOS, test Rocky and Debian in CI (#92)
* Test CentOS 7 in CI * Drop support for CentOS, test on Rocky and Debian * Fix reset playbook for Rocky Linux * Fix typo * Disable firewalld during testing Co-authored-by: Techno Tim <timothystewart6@gmail.com>
This commit is contained in:
6
roles/raspberrypi/defaults/main.yml
Normal file
6
roles/raspberrypi/defaults/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# Indicates whether the k3s prerequisites for Raspberry Pi should be set up
|
||||
# Possible values:
|
||||
# - present
|
||||
# - absent
|
||||
state: present
|
||||
@@ -47,13 +47,20 @@
|
||||
- raspberry_pi|default(false)
|
||||
- ansible_facts.lsb.description|default("") is match("Debian.*bullseye")
|
||||
|
||||
- name: execute OS related tasks on the Raspberry Pi
|
||||
- name: execute OS related {{ action }} tasks on the Raspberry Pi
|
||||
include_tasks: "{{ item }}"
|
||||
with_first_found:
|
||||
- "prereq/{{ detected_distribution }}-{{ detected_distribution_major_version }}.yml"
|
||||
- "prereq/{{ detected_distribution }}.yml"
|
||||
- "prereq/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "prereq/{{ ansible_distribution }}.yml"
|
||||
- "prereq/default.yml"
|
||||
- "{{ action }}/{{ detected_distribution }}-{{ detected_distribution_major_version }}.yml"
|
||||
- "{{ action }}/{{ detected_distribution }}.yml"
|
||||
- "{{ action }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "{{ action }}/{{ ansible_distribution }}.yml"
|
||||
- "{{ action }}/default.yml"
|
||||
vars:
|
||||
action: >-
|
||||
{% if state == "present" -%}
|
||||
setup
|
||||
{%- else -%}
|
||||
teardown
|
||||
{%- endif %}
|
||||
when:
|
||||
- raspberry_pi|default(false)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Enable cgroup via boot commandline if not already enabled for Centos
|
||||
- name: Enable cgroup via boot commandline if not already enabled for Rocky
|
||||
lineinfile:
|
||||
path: /boot/cmdline.txt
|
||||
backrefs: yes
|
||||
@@ -6,8 +6,16 @@
|
||||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$'
|
||||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
|
||||
notify: reboot
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: Install linux-modules-extra-raspi
|
||||
apt: name=linux-modules-extra-raspi state=present
|
||||
when: (raspberry_pi) and (not ansible_check_mode)
|
||||
apt:
|
||||
name: linux-modules-extra-raspi
|
||||
state: present
|
||||
|
||||
- name: Teardown
|
||||
when: state == "absent"
|
||||
block:
|
||||
- name: Remove linux-modules-extra-raspi
|
||||
apt:
|
||||
name: linux-modules-extra-raspi
|
||||
state: absent
|
||||
1
roles/raspberrypi/tasks/teardown/Raspbian.yml
Normal file
1
roles/raspberrypi/tasks/teardown/Raspbian.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
||||
1
roles/raspberrypi/tasks/teardown/Rocky.yml
Normal file
1
roles/raspberrypi/tasks/teardown/Rocky.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
||||
5
roles/raspberrypi/tasks/teardown/Ubuntu.yml
Normal file
5
roles/raspberrypi/tasks/teardown/Ubuntu.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Remove linux-modules-extra-raspi
|
||||
apt:
|
||||
name: linux-modules-extra-raspi
|
||||
state: absent
|
||||
1
roles/raspberrypi/tasks/teardown/default.yml
Normal file
1
roles/raspberrypi/tasks/teardown/default.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
||||
Reference in New Issue
Block a user