neuro_ansible/update_jobs/update_to_version.yaml

67 lines
1.8 KiB
YAML
Raw Normal View History

2024-04-20 02:23:17 +02:00
---
- name: upgrade to next version
hosts: all
become: true
2024-04-28 02:49:20 +02:00
vars:
version: "40"
2024-04-20 02:23:17 +02:00
tasks:
2024-04-25 00:14:16 +02:00
# 39 -> 40
2024-04-25 10:45:21 +02:00
- name: remove libva-intel-media-driver
2024-04-25 00:14:16 +02:00
dnf:
name: "libva-intel-media-driver"
state: absent
update_cache: true
skip_broken: true
nobest: false
allowerasing: true
2024-04-20 02:23:17 +02:00
- name: block shutdown
blockinfile:
path: /etc/polkit-1/rules.d/55-inhibit-shutdown.rules
state: present
create: true
owner: "root"
group: "root"
mode: "0666"
block: |
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.login1.power-off") == 0 ||
action.id.indexOf("org.freedesktop.login1.reboot") == 0) {
return polkit.Result.AUTH_ADMIN;
}
});
- name: Make sure systemd-oomd service unit is stopped
systemd_service:
2024-04-25 00:14:16 +02:00
state: stopped
name: systemd-oomd
2024-04-20 02:23:17 +02:00
- name: remove other files
include_tasks: ../yaml_sub/myrepo_clean.yaml
- name: update file myrepo.repo
import_tasks: ../yaml_sub/myrepo_data.yaml
- name: install system-upgrade
dnf:
name: "dnf-command(system-upgrade)"
state: present
update_cache: true
skip_broken: true
nobest: false
allowerasing: true
2024-04-25 00:14:16 +02:00
- name: upgrade version
2024-04-20 02:23:17 +02:00
shell: "dnf -y system-upgrade download --refresh --releasever={{version}} --allowerasing --best --skip-broken; dnf system-upgrade reboot"
- name: Make sure systemd-oomd service unit is started
systemd_service:
2024-04-25 00:14:16 +02:00
state: started
name: systemd-oomd
2024-04-20 02:23:17 +02:00
- name: stop shutdown embargo
ansible.builtin.file:
path: /etc/polkit-1/rules.d/55-inhibit-shutdown.rules
state: "absent"