diff --git a/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source.rb b/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source.rb index a2c3208e097..61c70a3aa52 100644 --- a/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source.rb +++ b/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source.rb @@ -9,6 +9,10 @@ def self.notify_on_provider_interaction? true end + private_class_method def self.queue_role + "embedded_ansible" + end + def sync update!(:status => "running") transaction do diff --git a/app/models/manageiq/providers/embedded_ansible/automation_manager/credential.rb b/app/models/manageiq/providers/embedded_ansible/automation_manager/credential.rb index b96424b08df..d3a00c8b4ce 100644 --- a/app/models/manageiq/providers/embedded_ansible/automation_manager/credential.rb +++ b/app/models/manageiq/providers/embedded_ansible/automation_manager/credential.rb @@ -1,3 +1,7 @@ class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Credential < ManageIQ::Providers::EmbeddedAutomationManager::Authentication FRIENDLY_NAME = "Embedded Ansible Credential".freeze + + private_class_method def self.queue_role + "embedded_ansible" + end end diff --git a/app/models/manageiq/providers/embedded_automation_manager/crud_common.rb b/app/models/manageiq/providers/embedded_automation_manager/crud_common.rb index 4eb40a43b6a..69429d798b1 100644 --- a/app/models/manageiq/providers/embedded_automation_manager/crud_common.rb +++ b/app/models/manageiq/providers/embedded_automation_manager/crud_common.rb @@ -13,7 +13,7 @@ def queue(instance_id, method_name, args, action, auth_user) :priority => MiqQueue::HIGH_PRIORITY, :class_name => name, :method_name => method_name, - :role => "embedded_ansible", + :role => queue_role, :zone => nil } queue_opts[:instance_id] = instance_id if instance_id @@ -58,6 +58,10 @@ def create_in_provider_queue(manager_id, params, auth_user = nil) private + def queue_role + nil + end + def send_notification(op_type, manager_id, params, success) op_arg = params.except(*notification_excludes).collect { |k, v| "#{k}=#{v}" }.join(', ') _log.send(success ? :info : :error, "#{name} #{op_type} with parameters: #{op_arg.inspect} #{success ? 'succeeded' : 'failed'}")