/ManageIQ/System/Request/order_ansible_playbook method will fetch the first IP of the target machine in
vmdb_object.try(:ipaddresses).try(:first).tap do |ip|
raise "IP address not specified for vmdb_object"
According to the pull request #113 (or check the Ruby code itself) you can have parameters
vmdb_object or direct IP addresses. The UI has changed since this pull request but the options remained the same: Localhost, Target Machine or Specific Hosts. I don’t think you can use a substitution here (@mkanoor could confirm) to specify the second IP (at Specific Hosts option) so I’m afraid you have to copy the order_ansible_playbook method into your own domain and change
vmdb_object.try(:ipaddresses).try(:second).tap do |ip|
raise "second IP address not specified for vmdb_object"
This is a pretty dirty hack and will fail if you do not have a second IP associated with your VM.
A better solution would be to manually specify a new attribute (like in the pull request above) for the request on the Advanced tab, defining a new magic keyword (besides
'vmdb_object') and this could be catched by some custom Ruby code (not changing the original behavior) to get the second IP in your special usecase.
Maybe someone more experienced has a better idea here.