Skip to content

Commit

Permalink
Add packagekit stop tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
BillAnastasiadis committed Oct 31, 2023
1 parent 7b0a83c commit a6344fe
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ansible/playbooks/fully-patch-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@
use_reboottimeout: 600

tasks:
- name: Check if Zypper lock file exists
stat:
path: /var/run/zypp.pid
register: lockfile_check
become: yes

- name: Get PID from Zypper lock file
slurp:
src: /var/run/zypp.pid
register: pid_content
become: yes
when: lockfile_check.stat.exists

- name: Set PID variable
set_fact:
zypper_pid: "{{ (pid_content['content'] | b64decode).strip() }}"
when: lockfile_check.stat.exists

- name: Check if process with PID is running
shell: ps -p {{ zypper_pid }} -o comm=
register: process_check
failed_when: false
changed_when: false
when: lockfile_check.stat.exists

# Fully patch system
- name: Apply all available patches
community.general.zypper:
Expand Down

0 comments on commit a6344fe

Please sign in to comment.