Cloud.ansible returns error:"com.google.gson.stream.MalformedJsonException: " when attempting to deploy clustered resource via Aria Automation
search cancel

Cloud.ansible returns error:"com.google.gson.stream.MalformedJsonException: " when attempting to deploy clustered resource via Aria Automation

book

Article ID: 396464

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

When attempting to deploy cloud.ansible with the count property, Deployment fails on the ansible resource with the error:
  'create' operation failed: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $. when attempting to deploy clustered resource

Environment

Aria Automation 8.x

Cause

The error typically indicates that the YAML code module interacting with a cloud provider (such as AWS, Azure, GCP, etc.) has been provided with incorrect or improperly configured properties passed in cloud.ansible.

Resolution

Ensure the YAML is syntax correct. Below is the sample YAML for cloud.ansbile with the count property. 

Cloud_Ansible_Set_Prereqs:
    type: Cloud.Ansible
    properties:
      count: ${input.count}
      host: ${resource.ubuntu_cloudinit.*}
      hostName: ${resource.ubuntu_cloudinit.address[count.index]}
      osType: linux
      account: Ansible_account
      username: root
      password: ${secret.ansible_password}
      hostVariables: |
        db_user: root
        db_password: ${secret.linux_passwd}
        db_ip: ${resource.ubuntu_cloudinit.address}
      playbooks:
        provision:
          - /root/playbooks/prep_prereqs.yaml