Running vRO Workflows from Ansible playbook

I had a need to run vRealize Orchestrator workflow directly form my Ansible Tower.
To do that I wrote a dedicated Ansible module that allows to run any vRO workflow form Ansible playbook. This is useful if you want to reuse automation you already done in vRO or if you are dealing with something that is simple to do in vRO like VUM automation but difficult or impossible otherwise. I’m using it to import bare-metal servers as DynamicType in to my vRA instance.

Ansible library code is also accessible here:

Short instruction:

  • Download the Ansible module below,
  • Create library folder,
  • Put there a downloaded file:
  • Create playbook my_playbook.yaml
  • run: ansible-playbook myplaybook.yaml

How does it work:
You have to create a vRO workflow that will be run form Ansible. Only string and array strings are allowed as inputs

Note Workflow ID on the first tab it will be needed for Ansible playbook

Now create playbook (I’ll not cover a role creation or password handling in Ansible here):


- hosts: localhost
    - name: Create Baseline - Run vRO Workflow
        vro_server: "https://vro.domain.corp:8281"
        username: "Administrator@vsphere.local"
        password: "my$ecredPassw0rd"
        workflow_id: "09122576-4c03-4e3b-9aca-363644d2b64a"
          msg: TestFromAnsible
            - VM1
            - VM2
            - VM3
      register: result
    - name: output result
        msg: " {{ result }} "

Run your playbook and watch vRO workflow tokens toy should see a new run…

Ansible Module: