Sha256: a96494190277ddac4fc95cd2d4cea7384e3e9660ccb65b4b4cda7cbd5f22fc82

Contents?: true

Size: 1.08 KB

Versions: 36

Compression:

Stored size: 1.08 KB

Contents

namespace :rh_cloud_insights do
  desc "Synchronize Insights hosts hits"
  task sync: [:environment, 'dynflow:client'] do
    ForemanTasks.sync_task(InsightsCloud::Async::InsightsFullSync, Organization.unscoped.all)
    puts "Synchronized Insights hosts hits data"
  end

  desc "Remove insights client report statuses by searching on host criteria"
  task clean_statuses: [:environment] do
    hosts_search = ENV['SEARCH']

    if hosts_search.empty?
      puts 'Must specify SEARCH= criteria for hosts search'
      next
    end

    cleaner = ForemanRhCloud::InsightsStatusCleaner.new
    deleted_count = cleaner.clean(hosts_search)

    puts "Deleted #{deleted_count} insights statuses"
  end

  desc "Re-announce all organizations into Sources on RH cloud."
  task announce_to_sources: [:environment] do
    logger = Logging::Logger.new(STDOUT)
    Organization.unscoped.each do |org|
      presence = ForemanRhCloud::CloudPresence.new(org, logger)
      presence.announce_to_sources
    rescue StandardError => ex
      logger.warn(ex)
    end

    logger.info('Reannounced all organizations')
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
foreman_rh_cloud-9.0.59 lib/tasks/insights.rake
foreman_rh_cloud-9.0.58 lib/tasks/insights.rake
foreman_rh_cloud-9.0.57 lib/tasks/insights.rake
foreman_rh_cloud-9.0.56 lib/tasks/insights.rake
foreman_rh_cloud-9.0.55 lib/tasks/insights.rake
foreman_rh_cloud-9.0.54 lib/tasks/insights.rake
foreman_rh_cloud-9.0.53 lib/tasks/insights.rake
foreman_rh_cloud-9.0.52 lib/tasks/insights.rake
foreman_rh_cloud-8.0.52 lib/tasks/insights.rake
foreman_rh_cloud-9.0.51 lib/tasks/insights.rake
foreman_rh_cloud-8.0.51 lib/tasks/insights.rake
foreman_rh_cloud-7.0.48 lib/tasks/insights.rake
foreman_rh_cloud-7.0.47 lib/tasks/insights.rake
foreman_rh_cloud-8.0.50 lib/tasks/insights.rake
foreman_rh_cloud-8.0.49 lib/tasks/insights.rake
foreman_rh_cloud-8.0.48 lib/tasks/insights.rake
foreman_rh_cloud-8.0.47 lib/tasks/insights.rake
foreman_rh_cloud-8.0.46 lib/tasks/insights.rake
foreman_rh_cloud-6.0.45 lib/tasks/insights.rake
foreman_rh_cloud-5.0.46 lib/tasks/insights.rake