Sha256: 67d3d8f5143e34cb428dbdd088b3be8e46aa52d0aa8701c26b5cc63240f0effd

Contents?: true

Size: 483 Bytes

Versions: 5

Compression:

Stored size: 483 Bytes

Contents

namespace :rh_cloud_insights do
  desc "Synchronize Insights inventory"
  task sync: :environment do
    if !ENV['organization_id'].nil?
      organizations = [ Organization.where(:id => ENV['organization_id']).first ]
    else
      organizations = Organization.all
    end

    organizations.each do |organization|
      InventorySync::Async::InventoryFullSync.perform_now(organization)
      puts "Synchronized inventory for organization '#{organization.name}'"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.14 lib/tasks/insights.rake
foreman_rh_cloud-0.9.13.1 lib/tasks/insights.rake
foreman_rh_cloud-0.9.13 lib/tasks/insights.rake
foreman_rh_cloud-0.9.12 lib/tasks/insights.rake
foreman_rh_cloud-0.9.11 lib/tasks/insights.rake