fix(git.yml): improve error handling and register results for backup and samba repositories

This commit is contained in:
2026-07-29 17:31:36 +02:00
parent 56ba319f2f
commit b14e82c6c2
+18 -16
View File
@@ -376,17 +376,18 @@
}} }}
with_items: "{{ git_backup_repositories }}" with_items: "{{ git_backup_repositories }}"
register: common_git_backup_result
loop_control: loop_control:
label: "{{ item.name }}" label: "{{ item.name }}"
when: "groups['backup_server']|string is search(inventory_hostname)" when: inventory_hostname in (groups['backup_server'] | default([]))
failed_when: >- failed_when: >-
failed and ( (common_git_backup_result.failed | default(false)) and (
msg is not defined or ( common_git_backup_result.msg is not defined or (
('Could not resolve host' not in msg) ('Could not resolve host' not in common_git_backup_result.msg)
and ('Connection timed out' not in msg) and ('Connection timed out' not in common_git_backup_result.msg)
and ('Failed to connect to' not in msg) and ('Failed to connect to' not in common_git_backup_result.msg)
and ('Connection reset by peer' not in msg) and ('Connection reset by peer' not in common_git_backup_result.msg)
and ('Operation timed out' not in msg) and ('Operation timed out' not in common_git_backup_result.msg)
) )
) )
tags: tags:
@@ -414,17 +415,18 @@
}} }}
with_items: "{{ git_samba_repositories }}" with_items: "{{ git_samba_repositories }}"
register: common_git_samba_result
loop_control: loop_control:
label: "{{ item.name }}" label: "{{ item.name }}"
when: "groups['samba_server']|string is search(inventory_hostname)" when: inventory_hostname in (groups['samba_server'] | default([]))
failed_when: >- failed_when: >-
failed and ( (common_git_samba_result.failed | default(false)) and (
msg is not defined or ( common_git_samba_result.msg is not defined or (
('Could not resolve host' not in msg) ('Could not resolve host' not in common_git_samba_result.msg)
and ('Connection timed out' not in msg) and ('Connection timed out' not in common_git_samba_result.msg)
and ('Failed to connect to' not in msg) and ('Failed to connect to' not in common_git_samba_result.msg)
and ('Connection reset by peer' not in msg) and ('Connection reset by peer' not in common_git_samba_result.msg)
and ('Operation timed out' not in msg) and ('Operation timed out' not in common_git_samba_result.msg)
) )
) )
tags: tags: