feat: add task to create a monthly cronjob for restarting k3s
This commit is contained in:
parent
c507fde78e
commit
8ce1a6db6e
1 changed files with 9 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- hosts: all
|
- name: Install k3s server
|
||||||
|
hosts: all
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
name: Install k3s server
|
|
||||||
tags: k3s-server
|
tags: k3s-server
|
||||||
tasks:
|
tasks:
|
||||||
- name: Download k3s install script
|
- name: Download k3s install script
|
||||||
|
@ -20,15 +20,20 @@
|
||||||
name: k3s
|
name: k3s
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
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
|
- name: Get kubeconfig
|
||||||
ansible.builtin.fetch:
|
ansible.builtin.fetch:
|
||||||
src: /etc/rancher/k3s/k3s.yaml
|
src: /etc/rancher/k3s/k3s.yaml
|
||||||
dest: kubeconfig_{{ ansible_host }}.yml
|
dest: kubeconfig_{{ ansible_host }}.yml
|
||||||
flat: true
|
flat: true
|
||||||
|
|
||||||
- hosts: all
|
- name: Deploy baseline
|
||||||
|
hosts: all
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
name: Deploy baseline
|
|
||||||
tags: baseline
|
tags: baseline
|
||||||
tasks:
|
tasks:
|
||||||
- name: Copy manifest
|
- name: Copy manifest
|
||||||
|
|
Loading…
Reference in a new issue