feat(git.yml): enhance error handling for backup and samba server repository installations
This commit is contained in:
@@ -358,6 +358,8 @@
|
|||||||
# Group [backup_server] reposotories
|
# Group [backup_server] reposotories
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
|
# Optional repositories: tolerate transient network errors, but fail on config/auth/permission issues.
|
||||||
|
|
||||||
- name: (git.yml) Install/Update backup server repositories
|
- name: (git.yml) Install/Update backup server repositories
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ item.repo }}"
|
repo: "{{ item.repo }}"
|
||||||
@@ -377,7 +379,16 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
when: "groups['backup_server']|string is search(inventory_hostname)"
|
when: "groups['backup_server']|string is search(inventory_hostname)"
|
||||||
ignore_errors: true
|
failed_when: >-
|
||||||
|
failed and (
|
||||||
|
msg is not defined or (
|
||||||
|
('Could not resolve host' not in msg)
|
||||||
|
and ('Connection timed out' not in msg)
|
||||||
|
and ('Failed to connect to' not in msg)
|
||||||
|
and ('Connection reset by peer' not in msg)
|
||||||
|
and ('Operation timed out' not in msg)
|
||||||
|
)
|
||||||
|
)
|
||||||
tags:
|
tags:
|
||||||
- git-backup-server-repositories
|
- git-backup-server-repositories
|
||||||
|
|
||||||
@@ -385,6 +396,8 @@
|
|||||||
# Group [samba_server] reposotories
|
# Group [samba_server] reposotories
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
|
# Same policy as backup repositories: only temporary connectivity problems are accepted.
|
||||||
|
|
||||||
- name: (git.yml) Install/Update samba server repositories
|
- name: (git.yml) Install/Update samba server repositories
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ item.repo }}"
|
repo: "{{ item.repo }}"
|
||||||
@@ -404,7 +417,16 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
when: "groups['samba_server']|string is search(inventory_hostname)"
|
when: "groups['samba_server']|string is search(inventory_hostname)"
|
||||||
ignore_errors: true
|
failed_when: >-
|
||||||
|
failed and (
|
||||||
|
msg is not defined or (
|
||||||
|
('Could not resolve host' not in msg)
|
||||||
|
and ('Connection timed out' not in msg)
|
||||||
|
and ('Failed to connect to' not in msg)
|
||||||
|
and ('Connection reset by peer' not in msg)
|
||||||
|
and ('Operation timed out' not in msg)
|
||||||
|
)
|
||||||
|
)
|
||||||
tags:
|
tags:
|
||||||
- git-samba-server-repositories
|
- git-samba-server-repositories
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user