mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2026-09-15 08:33:20 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cda7c92203 | |||
| d910b83bf3 | |||
| 101313f880 | |||
| 12be355867 | |||
| aa09e3e9df | |||
| 511c410451 | |||
| df9c6f3014 |
@@ -9,3 +9,18 @@ updates:
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
rebase-strategy: "auto"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
rebase-strategy: "auto"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
|
||||
@@ -63,6 +63,31 @@ jobs:
|
||||
PY_COLORS: 1
|
||||
ANSIBLE_FORCE_COLOR: 1
|
||||
|
||||
# these steps are necessary if not using ephemeral nodes
|
||||
- name: Delete old Vagrant box versions
|
||||
if: always() # do this even if a step before has failed
|
||||
run: vagrant box prune --force
|
||||
|
||||
- name: Remove all local Vagrant boxes
|
||||
if: always() # do this even if a step before has failed
|
||||
run: vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove -f
|
||||
|
||||
- name: Remove all Virtualbox VMs
|
||||
if: always() # do this even if a step before has failed
|
||||
run: VBoxManage list vms | awk -F'"' '{print $2}' | xargs -I {} VBoxManage unregistervm --delete "{}"
|
||||
|
||||
- name: Remove all Virtualbox HDs
|
||||
if: always() # do this even if a step before has failed
|
||||
run: VBoxManage list hdds | awk -F':' '/^UUID:/ {print $2}' | xargs -I {} VBoxManage closemedium disk "{}" --delete
|
||||
|
||||
- name: Remove all Virtualbox Networks
|
||||
if: always() # do this even if a step before has failed
|
||||
run: VBoxManage list hostonlyifs | grep '^Name:' | awk '{print $2}' | grep '^vboxnet' | xargs -I {} VBoxManage hostonlyif remove {}
|
||||
|
||||
- name: Remove Virtualbox network config
|
||||
if: always() # do this even if a step before has failed
|
||||
run: sudo rm /etc/vbox/networks.conf
|
||||
|
||||
- name: Upload log files
|
||||
if: always() # do this even if a step before has failed
|
||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # 3.1.1
|
||||
@@ -70,7 +95,3 @@ jobs:
|
||||
name: logs
|
||||
path: |
|
||||
${{ runner.temp }}/logs
|
||||
|
||||
- name: Delete old box versions
|
||||
if: always() # do this even if a step before has failed
|
||||
run: vagrant box prune --force
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
k3s_version: v1.25.16+k3s4
|
||||
k3s_version: v1.27.9+k3s1
|
||||
# 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 efficent compared to full VMs.
|
||||
# containers are significantly more resource efficient 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 partiularly low powered proxmox nodes where the overhead of
|
||||
# I would only really recommend using this if you have particularly 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,
|
||||
|
||||
@@ -22,7 +22,7 @@ platforms:
|
||||
ssh.password: "vagrant"
|
||||
|
||||
- name: control2
|
||||
box: generic/debian11
|
||||
box: generic/debian12
|
||||
memory: 1024
|
||||
cpus: 2
|
||||
groups:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Create k3s.service.d directory
|
||||
- name: Create k3s-node.service.d directory
|
||||
file:
|
||||
path: '{{ systemd_dir }}/k3s.service.d'
|
||||
path: '{{ systemd_dir }}/k3s-node.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.service.d/http_proxy.conf"
|
||||
dest: "{{ systemd_dir }}/k3s-node.service.d/http_proxy.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
@@ -17,21 +17,19 @@
|
||||
when:
|
||||
grep_cpuinfo_raspberrypi.rc == 0 or grep_device_tree_model_raspberrypi.rc == 0
|
||||
|
||||
- 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)
|
||||
- name: Set detected_distribution to Raspbian (ARM64 on Raspbian, Debian Buster/Bullseye/Bookworm)
|
||||
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("Debian.*buster")
|
||||
- ansible_facts.lsb.description|default("") is match(allowed_descriptions | join('|'))
|
||||
|
||||
- name: Set detected_distribution_major_version
|
||||
set_fact:
|
||||
@@ -39,14 +37,6 @@
|
||||
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:
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user