VMware Cloud Community
vmsiul
Enthusiast
Enthusiast
Jump to solution

vRA 8.6 | User input how to execute base on their selection

Hello, 

We have integrated vRA 8.6 with Ansible and we are trying to make the blueprint a little more dynamic using user inputs for different options and based on that selection they will execute on ansible playbook or other. 

For example 

Input OS option:

-Windows 2019 UK 

-Windows 2019 Spain 

-Windows 2019 Italy   

if the user goes with 

Windows 2019 UK --- then we will need to run windows2019uk.yml playbook. 

Windows 2019 Spain --- then we will need to run windows2019spain.yml playbook. 

There is a little example here:

https://vnuggets.com/2019/07/09/integrating-and-using-ansible-with-cloud-assembly/

But I am not sure how to customize the blueprint to call different playbooks based on the the input selection. 

I wonder if someone can provide some help. 

Thanks!  

0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

I'd add the input as Key-value pairs:

  os:
    type: string 
    oneOf:
      - title: Windows 2019 UK
        const: windows2019uk
      - title: Windows 2019 Spain
        const: windows2019spain

 Then at Ansible properties:

      playbooks:
        provision:
          - '/etc/ansible/playbooks/${input.os}.yml'

View solution in original post

0 Kudos
2 Replies
xian_
Expert
Expert
Jump to solution

I'd add the input as Key-value pairs:

  os:
    type: string 
    oneOf:
      - title: Windows 2019 UK
        const: windows2019uk
      - title: Windows 2019 Spain
        const: windows2019spain

 Then at Ansible properties:

      playbooks:
        provision:
          - '/etc/ansible/playbooks/${input.os}.yml'
0 Kudos
vmsiul
Enthusiast
Enthusiast
Jump to solution

I see, thanks...so then I will have to have the playbooks in the controller named as 

 

windows2019uk.yml
windows2019spain.yml

 

 

The name will come from the here, correct? 

 - '/etc/ansible/playbooks/${input.os}.yml'

 

Thank you!

 

0 Kudos