From 8ce1a6db6ef5dd92ad1e1eb87fff1aa97f130b68 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Wed, 13 Mar 2024 09:28:16 +0100 Subject: [PATCH] feat: add task to create a monthly cronjob for restarting k3s --- pb_install.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pb_install.yml b/pb_install.yml index 329e796..2afe7f2 100644 --- a/pb_install.yml +++ b/pb_install.yml @@ -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