From 2e8540b378b3deb9e028b06fe8d062a898b96fa9 Mon Sep 17 00:00:00 2001 From: Dan Guido Date: Tue, 25 Nov 2025 13:26:01 -0500 Subject: [PATCH] Fix GCE deployment error with Ansible 12 JSON parsing (#14860) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Ansible 12, jinja2_native mode is always enabled, which changes how JSON strings are handled. The file lookup returns JSON content as a string, but it's no longer automatically converted to a dict. This caused GCE deployments to fail with "Invalid resource field value" because project_id was empty - accessing .project_id on a string returns undefined, which then defaulted to an empty env var. Add the `| from_json` filter to explicitly parse the JSON credentials file into a dict, as recommended by the Ansible 12 porting guide. Fixes #14854 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude --- roles/cloud-gce/tasks/prompts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/cloud-gce/tasks/prompts.yml b/roles/cloud-gce/tasks/prompts.yml index f67f9737..59ef3289 100644 --- a/roles/cloud-gce/tasks/prompts.yml +++ b/roles/cloud-gce/tasks/prompts.yml @@ -17,7 +17,7 @@ no_log: true - set_fact: - credentials_file_lookup: "{{ lookup('file', credentials_file_path) }}" + credentials_file_lookup: "{{ lookup('file', credentials_file_path) | from_json }}" no_log: true - set_fact: