Skip to content

Commit

Permalink
[EmbeddedAnsible] Force embedded_ansible role for workflow
Browse files Browse the repository at this point in the history
The `queue_signal` method in `AnsibleRunnerWorkflow` forces the
"ems_operations" role when it schedules a queue item, but this class
(which inherits from `AnsibleRunnerWorkflow`) is getting assigned this
job from a wrapper job that requires the `embedded_ansible` role.  In
addition, the previous job queue an job that is locked to the existing
server guid, so it is possible for that server to take the first job,
but not the second when it doesn't have both an "embedded_ansible" and
"ems_operations" role.

When a server exists that only has the "embedded_ansible" role, it is
possible to get into a state where a playbook can be scheduled, but then
is never ran because no server matches.  This fix simply always uses the
"embedded_ansible" role for everything, but tries to only modify the
lower level classes to achieve that.

Fixes:  https://bugzilla.redhat.com/show_bug.cgi?id=1742839
  • Loading branch information
NickLaMuro committed Aug 22, 2019
1 parent c1f6ac1 commit 78f9fe7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/manageiq/providers/ansible_playbook_workflow.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class ManageIQ::Providers::AnsiblePlaybookWorkflow < ManageIQ::Providers::AnsibleRunnerWorkflow
def self.create_job(*args, **kwargs)
role_or_playbook_options = args[2]
args[2] = role_or_playbook_options.merge(:role => "embedded_ansible")
super(*args, **kwargs)
end

def execution_type
"playbook"
end
Expand Down

0 comments on commit 78f9fe7

Please sign in to comment.