I had this in my history with a comment to test it, not sure what this actually was about.
--- a/tasks/local/hetzner-cloud.yaml
+++ b/tasks/local/hetzner-cloud.yaml
@@ -5,7 +5,7 @@
- name: "Map response of hcloud_server_info to list of server names"
ansible.builtin.set_fact:
- existing_cloud_servers: "{{ output.hcloud_server_info | map(attribute='name') | list }}"
+ existing_cloud_servers: "{{ output.hcloud_server_info | default([]) | selectattr('name', 'defined') | map(attribute='name') | list }}"
- name: "Determine cloud servers that are no longer defined in the ansible inventory"
ansible.builtin.set_fact:
I had this in my history with a comment to test it, not sure what this actually was about.