Sha256: ee94ae767eb429f406a767abc41a12fb61d20fdca0e0b9ef0e1822d7fbc66c46

Contents?: true

Size: 806 Bytes

Versions: 62

Compression:

Stored size: 806 Bytes

Contents

class SyncRolesAndVariables < ::ApplicationJob
  queue_as :default

  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

  def humanized_name
    _('Import roles And Variables')
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
foreman_ansible-14.2.2 app/jobs/sync_roles_and_variables.rb
foreman_ansible-14.2.1 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.7 app/jobs/sync_roles_and_variables.rb
foreman_ansible-14.2.0 app/jobs/sync_roles_and_variables.rb
foreman_ansible-14.1.1 app/jobs/sync_roles_and_variables.rb
foreman_ansible-14.1.0 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.5 app/jobs/sync_roles_and_variables.rb
foreman_ansible-14.0.0 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.4 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.3 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.2 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.1 app/jobs/sync_roles_and_variables.rb
foreman_ansible-13.0.0 app/jobs/sync_roles_and_variables.rb
foreman_ansible-12.0.7 app/jobs/sync_roles_and_variables.rb
foreman_ansible-10.4.4 app/jobs/sync_roles_and_variables.rb
foreman_ansible-7.1.8 app/jobs/sync_roles_and_variables.rb
foreman_ansible-12.0.6 app/jobs/sync_roles_and_variables.rb
foreman_ansible-12.0.5 app/jobs/sync_roles_and_variables.rb
foreman_ansible-10.4.3 app/jobs/sync_roles_and_variables.rb
foreman_ansible-12.0.4 app/jobs/sync_roles_and_variables.rb