diff --git a/metal/cluster.yml b/metal/cluster.yml index 1aaacbe2..ef7e3f6b 100644 --- a/metal/cluster.yml +++ b/metal/cluster.yml @@ -2,6 +2,7 @@ hosts: metal roles: - k3s + - automatic_upgrade - name: Create some basic config hosts: localhost diff --git a/metal/roles/automatic_upgrade/files/automatic.conf b/metal/roles/automatic_upgrade/files/automatic.conf new file mode 100644 index 00000000..ce1c163d --- /dev/null +++ b/metal/roles/automatic_upgrade/files/automatic.conf @@ -0,0 +1,3 @@ +[commands] +upgrade_type = default +apply_updates = yes diff --git a/metal/roles/automatic_upgrade/tasks/main.yml b/metal/roles/automatic_upgrade/tasks/main.yml new file mode 100644 index 00000000..037976e1 --- /dev/null +++ b/metal/roles/automatic_upgrade/tasks/main.yml @@ -0,0 +1,17 @@ +- name: Install packages for automatic upgrade + dnf: + name: + - dnf-automatic + - dnf-utils + +- name: Copy automatic upgrade config file + copy: + src: automatic.conf + dest: /etc/dnf/automatic.conf + mode: 0644 + +- name: Enable automatic upgrade service + systemd: + name: dnf-automatic.timer + state: started + enabled: true