Sha256: 3a41135ad7a370ddc15ce01057f9125206b6f13ca9d39b30e946db793ac31366

Contents?: true

Size: 807 Bytes

Versions: 87

Compression:

Stored size: 807 Bytes

Contents

namespace :katello do
  namespace :receptor do
    desc 'Extract Organization details for Receptor and write to OUTPUT_FILE.'
    task :extract_orgs => ["dynflow:client", "check_ping"] do
      output_file = ENV['OUTPUT_FILE']

      unless output_file
        fail("The OUTPUT_FILE environment variable must be specified")
      end

      data = Organization.with_upstream_pools.map do |org|
        {
          id: org.id,
          redhat_account_number: org.redhat_account_number,
          cert: org.owner_details.dig(:upstreamConsumer, :idCert, :cert),
          key: org.owner_details.dig(:upstreamConsumer, :idCert, :key)
        }
      end

      File.write(output_file, JSON.pretty_generate(data))

      puts "Wrote results to #{output_file}. Please delete it when finished."
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
katello-4.4.0 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.4.0.rc2 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.4.0.rc1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.2 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.3.0 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.3.0.rc4 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.3.0.rc3 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.3.0.rc2.1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.3.0.rc2 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.3.0.rc1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.0.1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.1.4 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.0.1.rc3 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.0.1.rc2 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.0.rc2 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.1.3 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.2.0.rc1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.1.2.1 lib/katello/tasks/receptor/extract_orgs.rake
katello-4.1.2 lib/katello/tasks/receptor/extract_orgs.rake