ManageIQ and Ansible Embeded Hosts management

Hello guys,

I’ve been testing ManageIQ with ansible embeded to run ansible-playbooks.
I will try to expose my personal context.
I do have a playbook that runs 2 tasks:

  1. First one in localhost, which creates a new VM using terraform provider for vRealize.
  2. Second one in the created VM , using the dns name extracted by terraform.
    I do execute this playbook perfectly from terminal but when trying to execute from ManageIQ seems like it is forced always to be executed everything (both tasks) on localhost and fails.
    Any idea how to manage the sequential tasks executions from a single playbook in different hosts?
    Thanks a lot in advance.

What works for me is to use hosts: all in the playbook, and then to define the hosts to actually run the playbook method on in their method definition, i.e.


Hey pemcg,

Thanks for answering :slight_smile:

What you are saying is what I use to make this work in 2 stages:
1 - create the VM using terraform in vRA
2 - calling that VM created using the specific IP (with the playbook set to : all)

But my request was more like … how can I run the whole process (master playbook) in a single stage? not having to create 2 catalogs but in a single one that runs everything, from the VM deployment to the VM provisioning.

Is there a way in ManageIQ?

Thanks a lot!

Splitting the logic into separate 2 playbooks would be the way I’d suggest, because you can use the existing functionality of methods such as wait_for_ip between them to wait for the VM to be booted and available on the network before the second playbook runs.

So probably implement your own state machine for the workflow, and if you want it called as a service then maybe implement it as a generic service type.