foreman_rh_cloud 6.0.44 → 6.0.45

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44056fad5c50d5b78e64b5e13a622818525fd5e8176159462825ae8306cd035f
4
- data.tar.gz: 6fa455af9f99ea4864c0d813962ecb7fcc9706517daf9459953c378ec547814d
3
+ metadata.gz: fb8068bce51d58d6cdf66eb5448db68133fbae198cde25a09be6f07733947653
4
+ data.tar.gz: faf0658dbfbece4a47df461daa7bb2c861c6513bb1cf09a34580fd2cd9aedb53
5
5
  SHA512:
6
- metadata.gz: 9fb003eeadd973880052b4d5d04a682d46938e4805a5bd0aad57ae9c22a0ea5cd05488f8e827838db2c5093d04dd5c91d2cc44332f2472a0e5e76bcf2c78126d
7
- data.tar.gz: efef456d8ecad910cb36ae64fb82202225733d484a227d6a142e71b145046a5533b626e2349d99d9f257282c03dc026a04de62ff8d436158226dd0f5a7fdcdb8
6
+ metadata.gz: e601daeac30fd710eea4b35eb0a9aa4c1ca4d62fa95307b0df29bf4746ecd723acc432823b164fb8b50b0ba73aeeede2cdfd4f36f7215fc437ceb9fcbfa05aaf
7
+ data.tar.gz: a4bae0cbbf09b01ce22a0f89c0a6bd4133b95e5611ead0aec6b10e1c8bd3527e9d175ca076aa5759d7154426d46df650f34a37f0886bfda204f329f7c5a8384c
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '6.0.44'.freeze
2
+ VERSION = '6.0.45'.freeze
3
3
  end
@@ -0,0 +1,64 @@
1
+ require 'io/console'
2
+
3
+ namespace :rh_cloud do |args|
4
+ desc 'Register Satellite Organization with Hybrid Cloud API. \
5
+ Specify org_id=x replace your organization ID with x. \
6
+ Specify SATELLITE_RH_CLOUD_URL=https://x with the Hybrid Cloud endpoint you are connecting to.'
7
+ task hybridcloud_register: [:environment] do
8
+ include ::ForemanRhCloud::CertAuth
9
+ include ::InsightsCloud::CandlepinCache
10
+
11
+ def logger
12
+ @logger ||= Logger.new(STDOUT)
13
+ end
14
+
15
+ def registrations_url
16
+ logger.warn("Custom url is not set, using the default one: #{ForemanRhCloud.base_url}") if ENV['SATELLITE_RH_CLOUD_URL'].empty?
17
+ ForemanRhCloud.base_url + '/api/identity/certificate/registrations'
18
+ end
19
+
20
+ if ENV['org_id'].nil?
21
+ logger.error('ERROR: org_id needs to be specified.')
22
+ exit(1)
23
+ end
24
+
25
+ @organization = Organization.find_by(id: ENV['org_id'].to_i) # saw this coming in as a string, so making sure it gets passed as an integer.
26
+ @uid = cp_owner_id(@organization)
27
+ @hostname = ForemanRhCloud.foreman_host_name
28
+ logger.error('Organization provided does not have a manifest imported.') + exit(1) if @uid.nil?
29
+
30
+ puts 'Paste your token, output will be hidden.'
31
+ @token = STDIN.noecho(&:gets).chomp
32
+ logger.error('Token was not entered.') + exit(1) if @token.empty?
33
+
34
+ def headers
35
+ {
36
+ Authorization: "Bearer #{@token}"
37
+ }
38
+ end
39
+
40
+ def payload
41
+ {
42
+ "uid": @uid,
43
+ "display_name": "#{@hostname}+#{@organization.label}"
44
+ }
45
+ end
46
+
47
+ def method
48
+ :post
49
+ end
50
+
51
+ begin
52
+ response = execute_cloud_request(
53
+ organization: @organization,
54
+ method: method,
55
+ url: registrations_url,
56
+ headers: headers,
57
+ payload: payload.to_json
58
+ )
59
+ logger.debug(response)
60
+ rescue Exception => ex
61
+ logger.error(ex)
62
+ end
63
+ end
64
+ end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "6.0.44",
3
+ "version": "6.0.45",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.44
4
+ version: 6.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-01 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -241,6 +241,7 @@ files:
241
241
  - lib/inventory_sync/async/inventory_self_host_sync.rb
242
242
  - lib/inventory_sync/async/query_inventory_job.rb
243
243
  - lib/tasks/foreman_rh_cloud_tasks.rake
244
+ - lib/tasks/hybrid_cloud.rake
244
245
  - lib/tasks/insights.rake
245
246
  - lib/tasks/rh_cloud_inventory.rake
246
247
  - locale/Makefile
@@ -679,7 +680,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
679
680
  - !ruby/object:Gem::Version
680
681
  version: '0'
681
682
  requirements: []
682
- rubygems_version: 3.3.7
683
+ rubygems_version: 3.2.33
683
684
  signing_key:
684
685
  specification_version: 4
685
686
  summary: Summary of ForemanRhCloud.