Skip to content

Commit ec5c459

Browse files
committed
Fix Vultr startup script JSON serialization error
The startup_script module was failing with "Object of type 'bytes' is not JSON serializable" because the lookup('template', ...) was returning bytes instead of a string. Added | string filter to explicitly convert the template result to a string, matching the pattern used by the DigitalOcean cloud provider. Also simplified from multiline block format to inline format for consistency with other cloud providers. Fixes the error: "Object of type 'bytes' is not JSON serializable by the 'tagless' profile."
1 parent e2bb190 commit ec5c459

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

roles/cloud-vultr/tasks/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
- name: Upload the startup script
2929
vultr.cloud.startup_script:
3030
name: algo-startup
31-
script: |
32-
{{ lookup('template', 'files/cloud-init/base.yml') }}
31+
script: "{{ lookup('template', 'files/cloud-init/base.yml') | string }}"
3332

3433
- name: Creating a server
3534
vultr.cloud.instance:

0 commit comments

Comments
 (0)