Skip to content

Commit 99606a0

Browse files
committed
Improve error handling for DigitalOcean LB deletion
Adds a conditional to the failed_when clause to ignore 'not found' errors when deleting DigitalOcean load balancers, preventing unnecessary task failures if the resource does not exist.
1 parent 5593d69 commit 99606a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

automation/roles/cloud_resources/tasks/digitalocean.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@
757757
- sync
758758
loop_control:
759759
label: "{{ patroni_cluster_name }}-{{ item }}"
760+
register: do_lb_del_result
761+
failed_when: do_lb_del_result is failed and ('not found' not in (do_lb_del_result.msg | default('') | lower))
760762
when: cloud_load_balancer | bool and
761763
(item == 'primary' or
762764
(item == 'replica' and server_count | int > 1) or

0 commit comments

Comments
 (0)