mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
Fix linting to bring back 'production' status for all non-server k3s roles
Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
@@ -1,52 +1,48 @@
|
||||
---
|
||||
- name: Test for raspberry pi /proc/cpuinfo
|
||||
ansible.builtin.command: grep -E "Raspberry Pi|BCM2708|BCM2709|BCM2835|BCM2836" /proc/cpuinfo
|
||||
register: grep_cpuinfo_raspberrypi
|
||||
register: raspberrypi_grep_cpuinfo
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- name: Test for raspberry pi /proc/device-tree/model
|
||||
ansible.builtin.command: grep -E "Raspberry Pi" /proc/device-tree/model
|
||||
register: grep_device_tree_model_raspberrypi
|
||||
register: raspberrypi_grep_device_tree_model
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- name: Set raspberry_pi fact to true
|
||||
ansible.builtin.set_fact:
|
||||
raspberry_pi: true
|
||||
- name: Run Raspberry Pi-specific tasks
|
||||
when:
|
||||
grep_cpuinfo_raspberrypi.rc == 0 or grep_device_tree_model_raspberrypi.rc == 0
|
||||
- raspberrypi_grep_cpuinfo.rc == 0 or raspberrypi_grep_device_tree_model.rc == 0
|
||||
block:
|
||||
- name: Set detected_distribution to Raspbian
|
||||
# noqa var-naming[no-role-prefix]
|
||||
ansible.builtin.set_fact:
|
||||
detected_distribution: Raspbian
|
||||
when: >
|
||||
ansible_facts.lsb.id|default("") == "Raspbian" or
|
||||
ansible_facts.lsb.description|default("") is match("[Rr]aspbian.*")
|
||||
|
||||
- name: Set detected_distribution to Raspbian
|
||||
ansible.builtin.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 Debian
|
||||
# noqa var-naming[no-role-prefix]
|
||||
ansible.builtin.set_fact:
|
||||
detected_distribution: Debian
|
||||
when: >
|
||||
ansible_facts.lsb.id|default("") == "Debian" or
|
||||
ansible_facts.lsb.description|default("") is match("Debian")
|
||||
|
||||
- name: Set detected_distribution to Debian
|
||||
ansible.builtin.set_fact:
|
||||
detected_distribution: Debian
|
||||
when: >
|
||||
raspberry_pi|default(false) and
|
||||
( ansible_facts.lsb.id|default("") == "Debian" or
|
||||
ansible_facts.lsb.description|default("") is match("Debian") )
|
||||
- name: Set detected_distribution to ArchLinux (ARM64)
|
||||
# noqa var-naming[no-role-prefix]
|
||||
ansible.builtin.set_fact:
|
||||
detected_distribution: Archlinux
|
||||
when:
|
||||
- ansible_facts.architecture is search("aarch64")
|
||||
- ansible_facts.os_family is match("Archlinux")
|
||||
|
||||
- name: Set detected_distribution to ArchLinux (ARM64)
|
||||
ansible.builtin.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
|
||||
ansible.builtin.include_tasks: "{{ item }}"
|
||||
with_first_found:
|
||||
- "prereq/{{ detected_distribution }}.yml"
|
||||
- "prereq/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "prereq/{{ ansible_distribution }}.yml"
|
||||
- "prereq/default.yml"
|
||||
when:
|
||||
- raspberry_pi|default(false)
|
||||
- name: Execute OS related tasks on the Raspberry Pi
|
||||
ansible.builtin.include_tasks: "{{ item }}"
|
||||
with_first_found:
|
||||
- "prereq/{{ detected_distribution }}.yml"
|
||||
- "prereq/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "prereq/{{ ansible_distribution }}.yml"
|
||||
- "prereq/default.yml"
|
||||
|
||||
Reference in New Issue
Block a user