From e7f54b1b531896f8ea76a39326aacc1d7f13dbab Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sat, 31 Oct 2020 12:22:58 +0100 Subject: [PATCH] Add playbook for Fedora upgrade to next release Signed-off-by: Matej Focko --- Makefile | 3 +++ playbooks/fedora_upgrade.yml | 9 +++++++ playbooks/roles/fedora/upgrade/tasks/main.yml | 24 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 playbooks/fedora_upgrade.yml create mode 100644 playbooks/roles/fedora/upgrade/tasks/main.yml diff --git a/Makefile b/Makefile index 2f34359..5c57160 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ AP := ansible-playbook -vv -K -c local -i localhost, -e ansible_python_interpret fedora-bootstrap: $(AP) playbooks/fedora.yml +fedora-release-upgrade: + $(AP) playbooks/fedora_upgrade.yml + deps: ansible-galaxy collection install community.general diff --git a/playbooks/fedora_upgrade.yml b/playbooks/fedora_upgrade.yml new file mode 100644 index 0000000..ba7a4d6 --- /dev/null +++ b/playbooks/fedora_upgrade.yml @@ -0,0 +1,9 @@ +--- +- name: Fedora upgrade + hosts: all + roles: + - role: fedora/upgrade + become: yes + become_method: sudo + vars: + releasever: 33 diff --git a/playbooks/roles/fedora/upgrade/tasks/main.yml b/playbooks/roles/fedora/upgrade/tasks/main.yml new file mode 100644 index 0000000..5de5cea --- /dev/null +++ b/playbooks/roles/fedora/upgrade/tasks/main.yml @@ -0,0 +1,24 @@ +--- +- name: Switch to remote repositories + include_role: + name: fedora/repositories + vars: + source: "remote" + +- name: Update all packages + dnf: + name: '*' + state: latest + +- name: Install system-upgrade plugin + dnf: + name: dnf-plugin-system-upgrade + +- name: Switch to local repositories + include_role: + name: fedora/repositories + vars: + source: "local" + +- name: Start the release update + shell: dnf system-upgrade download -y --releasever={{ releasever }}