From 047c65739ead68318cf4c71a06816f99820f19d6 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Apr 2026 10:20:13 +1000 Subject: [PATCH] The _config variable is a string that looks like a Python/YAML dict literal. Without from_yaml, Ansible's implicit type coercion was stringifying the integer 1500 during the conversion. Adding | from_yaml explicitly parses that string into a proper Python dict first, which preserves mtu as an integer 1500. Then | to_json serializes it to "mtu": 1500 (not "1500"). --- roles/resources/tasks/create_network.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/resources/tasks/create_network.yaml b/roles/resources/tasks/create_network.yaml index 7e738aa..8a0db21 100644 --- a/roles/resources/tasks/create_network.yaml +++ b/roles/resources/tasks/create_network.yaml @@ -14,7 +14,7 @@ name: "{{ _network.name }}{{ guid }}" namespace: "{{ openshift_cnv_namespace }}" spec: - config: "{{ _config | to_json }}" + config: "{{ _config | from_yaml | to_json }}" register: r_createnetwork until: r_createnetwork is success retries: "{{ openshift_cnv_retries }}"