-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
- name: Upgrade packages | ||
community.general.zypper: | ||
name: "*" | ||
state: latest | ||
update_cache: yes | ||
|
||
- name: Install packages | ||
community.general.zypper: | ||
name: | ||
- gnome-session-wayland | ||
- gnome-extensions | ||
- typelib-1_0-Vte-2.91 | ||
- libxslt-tools | ||
- gtk3-tools | ||
- gtk4-tools | ||
- sudo | ||
- make | ||
- patch | ||
- jq | ||
- unzip | ||
- git | ||
- npm-default | ||
- gdm | ||
- xorg-x11-Xvfb | ||
- PackageKit | ||
- typelib-1_0-PackageKitGlib-1_0 | ||
state: latest | ||
disable_recommends: no | ||
|
||
- name: Install sysvinit-tools | ||
community.general.zypper: | ||
name: | ||
- sysvinit-tools | ||
state: latest | ||
force_resolution: yes | ||
|
||
- name: Install spice-vdagent | ||
community.general.zypper: | ||
name: | ||
- spice-vdagent | ||
state: latest | ||
when: ansible_virtualization_type == 'kvm' | ||
register: spice_vdagent | ||
|
||
- name: Check if reboot is necessary | ||
ansible.builtin.command: zypper needs-rebooting | ||
register: needs_reboot | ||
failed_when: needs_reboot.rc != 0 and needs_reboot.rc != 102 | ||
changed_when: needs_reboot.rc == 102 | ||
|
||
- name: Reboot | ||
ansible.builtin.reboot: | ||
when: needs_reboot.changed or spice_vdagent.changed | ||
|
||
- name: Check if systemd services should be restarted | ||
ansible.builtin.command: zypper ps --print '%s' | ||
register: needs_service_restart | ||
changed_when: needs_service_restart.stdout_lines | length > 0 | ||
|
||
- name: Restart updated systemd services | ||
ansible.builtin.systemd: | ||
name: "{{ item }}" | ||
state: restarted | ||
loop: "{{ needs_service_restart.stdout_lines }}" | ||
when: needs_service_restart.changed | ||
|
||
- name: Set graphical.target as the default | ||
ansible.builtin.file: | ||
path: /etc/systemd/system/default.target | ||
src: /usr/lib/systemd/system/graphical.target | ||
state: link |