Commit 3f15126
committed
Fix chronyd_or_ntpd_set_maxpoll remediation when /etc/chrony.d is missing
Both bash and Ansible remediation scripts failed when /etc/chrony.d directory
doesn't exist, which happens on systems using chrony-dhcp (e.g., ppc64le
systems in Testing Farm).
Bash remediation:
- Add directory existence check before running find
- Remove product-specific branching and unify code path
- Initialize empty array if directory is missing
Ansible remediation:
- Add stat task to check directory existence before find
- Only run find when directory exists and is a directory
- Use 'default([])' for safe variable handling
- Check variable is defined before accessing .matched
Fixes #145411 parent c4ec598 commit 3f15126
2 files changed
Lines changed: 15 additions & 9 deletions
File tree
- linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll
- ansible
- bash
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | | - | |
64 | | - | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
71 | | - | |
72 | | - | |
| 77 | + | |
| 78 | + | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments