4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'app/jobs/sync_roles_and_variables.rb', line 4
def perform(changed, proxy)
roles_importer = ForemanAnsible::UiRolesImporter.new(proxy)
variables_importer = ForemanAnsible::VariablesImporter.new(proxy)
roles_importer.finish_import(changed)
variables_importer.import_variables_roles(changed) if changed['new'] || changed['old']
task = ForemanTasks::Task.where(:external_id => @provider_job_id)[0]
ForemanAnsible::ImportRolesAndVariablesSuccessNotification.deliver!(task)
rescue StandardError => e
task = ForemanTasks::Task.where(:external_id => @provider_job_id)[0]
notification = ForemanAnsible::ImportRolesAndVariablesErrorNotification.new(e, task)
notification.deliver!
end
|