File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
35+ - name : Remove stale Zypper lock file
36+ file :
37+ path : /var/run/zypp.pid
38+ state : absent
39+ become : yes
40+ when : lockfile_check.stat.exists and process_check.stdout == ""
41+
1042 # Fully patch system
1143 - name : Apply all available patches
1244 community.general.zypper :
You can’t perform that action at this time.
0 commit comments