From e2bb19048098ee978154cd8ace0f3c02cc087109 Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Sat, 8 Nov 2025 09:52:22 +0100 Subject: [PATCH] Fix Vultr regions string conversion bug The "Format regions" task was converting region dictionaries to strings using {{ v }} in a Jinja2 loop, which caused the subsequent sort() to fail with "object of type 'str' has no attribute 'country'". Changed to directly assign the regions array from the API response, preserving the dictionary objects with their country, city, id, and other attributes. Fixes the error: "object of type 'str' has no attribute 'country'" when provisioning Vultr servers. --- roles/cloud-vultr/tasks/prompts.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/cloud-vultr/tasks/prompts.yml b/roles/cloud-vultr/tasks/prompts.yml index 4eafe68a7..c7f809198 100644 --- a/roles/cloud-vultr/tasks/prompts.yml +++ b/roles/cloud-vultr/tasks/prompts.yml @@ -29,10 +29,7 @@ - name: Format regions set_fact: - regions: >- - [ {% for v in _vultr_regions.json['regions'] %} - {{ v }}{% if not loop.last %},{% endif %} - {% endfor %} ] + regions: "{{ _vultr_regions.json['regions'] }}" - name: Set regions as a fact set_fact: