first commit

This commit is contained in:
2024-11-29 09:24:14 +01:00
commit 8c3b5f57b5
17 changed files with 407 additions and 0 deletions

9
playbooks/shutdown.yml Normal file
View File

@@ -0,0 +1,9 @@
---
- name: Shutdown k3s_cluster
hosts: k3s_cluster
gather_facts: true
tasks:
- name: Shutdown the nodes (and wait one 1 min)
become: true
community.general.shutdown:
delay: 60

29
playbooks/update.yml Normal file
View File

@@ -0,0 +1,29 @@
---
- hosts:
- all
become: true
tasks:
- name: Perform a dist-upgrade.
ansible.builtin.apt:
upgrade: dist
update_cache: yes
- name: Install essential packages
package:
name: "{{ package_list }}"
state: present
- name: Check if a reboot is required.
ansible.builtin.stat:
path: /var/run/reboot-required
get_checksum: no
register: reboot_required_file
- name: Reboot the server (if required).
ansible.builtin.reboot:
when: reboot_required_file.stat.exists == true
- name: Remove dependencies that are no longer required.
ansible.builtin.apt:
autoremove: yes