Skip to content

Commit a6344fe

Browse files
Add packagekit stop tasks
1 parent 7b0a83c commit a6344fe

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

ansible/playbooks/fully-patch-system.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@
77
use_reboottimeout: 600
88

99
tasks:
10+
- name: Check if Zypper lock file exists
11+
stat:
12+
path: /var/run/zypp.pid
13+
register: lockfile_check
14+
become: yes
15+
16+
- name: Get PID from Zypper lock file
17+
slurp:
18+
src: /var/run/zypp.pid
19+
register: pid_content
20+
become: yes
21+
when: lockfile_check.stat.exists
22+
23+
- name: Set PID variable
24+
set_fact:
25+
zypper_pid: "{{ (pid_content['content'] | b64decode).strip() }}"
26+
when: lockfile_check.stat.exists
27+
28+
- name: Check if process with PID is running
29+
shell: ps -p {{ zypper_pid }} -o comm=
30+
register: process_check
31+
failed_when: false
32+
changed_when: false
33+
when: lockfile_check.stat.exists
34+
1035
# Fully patch system
1136
- name: Apply all available patches
1237
community.general.zypper:

0 commit comments

Comments
 (0)