feat: add task to create a monthly cronjob for restarting k3s

This commit is contained in:
Sebastian Mark 2024-03-13 09:28:16 +01:00
parent c507fde78e
commit 8ce1a6db6e

View file

@ -1,7 +1,7 @@
---
- hosts: all
- name: Install k3s server
hosts: all
gather_facts: false
name: Install k3s server
tags: k3s-server
tasks:
- name: Download k3s install script
@ -20,15 +20,20 @@
name: k3s
state: started
enabled: true
- name: Add restart cronjob
ansible.builtin.cron:
name: "restart k3s (and regenerate certs if necessary)"
special_time: monthly
job: "systemctl restart k3s"
- name: Get kubeconfig
ansible.builtin.fetch:
src: /etc/rancher/k3s/k3s.yaml
dest: kubeconfig_{{ ansible_host }}.yml
flat: true
- hosts: all
- name: Deploy baseline
hosts: all
gather_facts: false
name: Deploy baseline
tags: baseline
tasks:
- name: Copy manifest