VMware Cloud Community
xian_
Expert
Expert
Jump to solution

vRA8 Cloud Assembly - network gateway

I want to pass the network gateway of a given cloud network to an Ansible playbook, but I'm having difficulties to reference it. What I'm trying to do in the blueprint:

resources:

  ans_server1:

    type: Cloud.Ansible

    properties:

      host: '${resource.server1.*}'

      osType: linux

      account: myansible

      username: ansible-remote

      privateKeyFile: .ssh/id_rsa_ansible

      playbooks:

        provision:

          - playbooks/config.yml

      hostVariables:

        hostname: '${resource.server1.resourceName}'

        gw: '${resource.Cloud_Network.gateway}'

        clustername: '${input.clusterName}'

  Cloud_Network:

    type: Cloud.vSphere.Network

    properties:

      networkType: existing

      name: cloud1

However, I get null for the gateway in vra_user_host_vars.yml:

{"hostname":"server-04","gw":"null","clustername":"clu1"}

The gateway information is correctly set in the network profile.

0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

I figured out, the correct property name is ${resource.Cloud_Network.gatewayAddress}, as seen in the deployment topology after a successful request completion:

deployment.png

The documentation is wrong:

documentation.jpg

Code completion is also wrong:

code completion.jpg

View solution in original post

0 Kudos
1 Reply
xian_
Expert
Expert
Jump to solution

I figured out, the correct property name is ${resource.Cloud_Network.gatewayAddress}, as seen in the deployment topology after a successful request completion:

deployment.png

The documentation is wrong:

documentation.jpg

Code completion is also wrong:

code completion.jpg

0 Kudos