vRA-deploy-VM is a playbook that use ansible uri core module to request a VM from vRealize automation solution, the Vmware Cloud Automation Center (vCAC) This script is built to be run from a jenkins slave with a minmal installation in order to create an ephemeral deployement machine to deploy test and destroy the machines after testing.
vRA-deploy-VM is a playbook that use ansible uri core module to request a VM from vRealize automation solution, the vmware cloud. This script can either be played form jenkins with ansible or in adhoc mode.
requierement : ** A valid vRA account able to create/destroy machines **
As you can see there is two main role file :
This file is used to request a VM to vRealize Automation it will play a full mimed json request to ask ressource from vcloud and then get ip and hostname. Please store user and password in a separate yml vault file
ansible-playbook vRA-deploy-VM.yml --ask-vault-pass
VRA_HOST: {{ VRA_HOST}}
VRA_USER: {{ VRA_USER }}
VRA_PASS: {{ VRA_PASS }}
VRA_TENANT: {{ VRA_TENANT }}
VM_Destroy_id="{{ list.json.content[item].id }}"
VM_name="{{ list.json.content[item].name }}"
VM_IP="{{ list.json.content[item].resourceData }}
ansible-playbook vRA-destroy-VM.yml --ask-vault-pass
VRA_HOST: {{ VRA_HOST}}
VRA_USER: {{ VRA_USER }}
VRA_PASS: {{ VRA_PASS }}
VRA_TENANT: {{ VRA_TENANT }}
{{ DESTROY_ID }}
NONE