|
44 | 44 | ansible.builtin.debug: |
45 | 45 | msg: |
46 | 46 | - "--- Rescue Block Entry Diagnosis for {{ inventory_hostname }} ---" |
47 | | - - "Task 'Wait for cloud guest registration' result for this host: {{ guestregister_service_state | default('VARIABLE NOT DEFINED') }}" |
48 | | - - "Individual host failure detected: {{ (guestregister_service_state.failed | default(false)) | ternary('YES', 'NO') }}" |
49 | | - - "Current any_errors_fatal setting: {{ any_errors_fatal | default('NOT SET (default is False)') }}" |
50 | | - - "Active hosts remaining in play: {{ ansible_play_hosts_all }}" |
| 47 | + - "Task 'Wait for cloud guest registration' result for this host:" |
| 48 | + - " rc: {{ guestregister_service_state.rc | default('UNKNOWN') }}" |
| 49 | + - " stdout: {{ guestregister_service_state.stdout_lines | default('UNKNOWN') }}" |
51 | 50 |
|
52 | 51 | # [DIAGNOSTIC] Initial service status and logs collection |
53 | 52 | - name: Get guestregister.service status |
|
72 | 71 | - name: Extract specific errors from cloudregister log |
73 | 72 | ansible.builtin.shell: | |
74 | 73 | set -o pipefail |
75 | | - grep -E "ERROR:|WARNING:|401 Unauthorized|422|Removing (repository artifacts|credentials|repo|service):" /var/log/cloudregister | tail -n 20 |
| 74 | + grep -E "ERROR:|WARNING:|401 (None|Unauthorized)|422|failed|(Deleting|Removing).*(repository artifacts|credentials|repo|service)|registration complete|No credentials entry" /var/log/cloudregister |
76 | 75 | register: tailored_cloudregister_errors |
77 | 76 | failed_when: false |
78 | 77 | changed_when: false |
79 | 78 |
|
80 | 79 | - name: Search for Zypper lock in zypper.log |
81 | 80 | ansible.builtin.shell: | |
82 | 81 | set -o pipefail |
83 | | - grep "System management is locked by the application with pid" /var/log/zypper.log | tail -n 5 |
| 82 | + grep "System management is locked by the application with pid" /var/log/zypper.log |
84 | 83 | register: zypper_log_lock_error |
85 | 84 | failed_when: false |
86 | 85 | changed_when: false |
87 | 86 |
|
| 87 | + - name: Search for Zypper THROW in zypper.log |
| 88 | + ansible.builtin.shell: | |
| 89 | + set -o pipefail |
| 90 | + grep "THROW" /var/log/zypper.log |
| 91 | + register: zypper_log_throw |
| 92 | + failed_when: false |
| 93 | + changed_when: false |
| 94 | + |
88 | 95 | - name: Check repository state after failure |
89 | 96 | ansible.builtin.command: zypper lr -u |
90 | 97 | register: zypper_repos_after_fail |
|
126 | 133 | - "--- Tailored Diagnostics for guestregister.service failure ---" |
127 | 134 | - "Cloudregister Errors Summary: {{ tailored_cloudregister_errors.stdout_lines | default('None found') }}" |
128 | 135 | - "Zypper Log Lock Errors: {{ zypper_log_lock_error.stdout_lines | default('None found') }}" |
| 136 | + - "Zypper Log throws: {{ zypper_log_throw.stdout_lines | default('None found') }}" |
129 | 137 | - "Racing PIDs and Commands: {{ racing_pids_discovery.stdout_lines | default('No racing PIDs identified') }}" |
130 | 138 | - "Clean-up/Reset detected: {{ 'Removing' in (tailored_cloudregister_errors.stdout | default('')) }}" |
131 | 139 | - "SMT entries in /etc/hosts: {{ hosts_smt_entries.stdout_lines | default('Not found') }}" |
|
262 | 270 |
|
263 | 271 | - name: Fail if guestregister.service is not in the expected state |
264 | 272 | ansible.builtin.assert: |
265 | | - that: false |
| 273 | + that: |
| 274 | + - "'ActiveState=inactive' in restart_state.stdout" |
| 275 | + - "'Result=success' in restart_state.stdout" |
| 276 | + - "not to_be_registered" |
266 | 277 | fail_msg: "FATAL: guestregister.service is not in the expected state (inactive/success) after retries. Check logs above for details." |
0 commit comments