Sha256: d47d84afe3fac96079367c67454f1412fccd76593a0e6532e5ec03d81a2df4b0

Contents?: true

Size: 497 Bytes

Versions: 2

Compression:

Stored size: 497 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|
      ForemanTasks.async_task(InventorySync::Async::InventoryFullSync, organization)
      puts "Synchronized inventory for organization '#{organization.name}'"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.20 lib/tasks/insights.rake
foreman_rh_cloud-3.0.19 lib/tasks/insights.rake