Bug 1417309 - [RFE] Allow for Ansible_Tower_Job to launch job templates even if no VM is in context
Summary: [RFE] Allow for Ansible_Tower_Job to launch job templates even if no VM is in...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: cfme-future
Assignee: John Hardy
QA Contact: Nandini Chandra
URL:
Whiteboard: tower
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-27 22:58 UTC by Jerome Marc
Modified: 2019-11-07 16:15 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-07 16:15:26 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:


Attachments (Terms of Use)

Description Jerome Marc 2017-01-27 22:58:00 UTC
Description of problem:
I want to launch Ansible Job Templates on objects where a VM is not in context. The current implementation of Ansible_Tower_Job requires a VM in context in wait_for_ip. In my use case, I want to add custom buttons on Hosts or Providers (e.g. to manage AWS Services using Ansible Job Templates). The current implementation does not allow me to launch the Ansible Job Template for any other objects than VMs/Services.

Version-Release number of selected component (if applicable):
5.7.0.17.20161219135818_725f92f 

How reproducible:
Always

Steps to Reproduce:
1. Have an Ansible Job Template to perform generic operations
2. Create a custom button on a Provider and associate the job template
3. Launch the Job Template by clicking on the button on the provider

Actual results:
The job template launch fails as there is no VM in context on a provider

Expected results:
The job template launch should work

Additional info:
My current workaround (there is surely something nicer) is to modify / ManageIQ / ConfigurationManagement / AnsibleTower / Operations / StateMachines / Job / wait_for_ip to provide my ansible-tower VM as vm object in the vm_not_found method:

  def vm_not_found
    @handle.log(:info, "Use Ansible Tower VM (BZ workaround) to launch Ansible Job Template")
    vm = $evm.vmdb('vm').find_by_name('ansible-tower')
    if vm
      @handle.root['ae_result'] = 'ok'
      @handle.log(:info, "VM found: #{vm.name}")
    else
      @handle.root['ae_result'] = 'error'
      @handle.log(:error, "VM not found")
    end
  end


Note You need to log in before you can comment on or make changes to this bug.