From a515b1eaac633e56b8926069de64b76acfc47591 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 25 Feb 2022 01:31:52 +0700 Subject: [PATCH] feat(metal): enable automatic upgrade for Rocky Linux --- metal/cluster.yml | 1 + .../automatic_upgrade/files/automatic.conf | 3 +++ metal/roles/automatic_upgrade/tasks/main.yml | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 metal/roles/automatic_upgrade/files/automatic.conf create mode 100644 metal/roles/automatic_upgrade/tasks/main.yml 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