waveclaw / puppet-subscription_manager

Handle Client Registration to RedHat Satellite 6 or Katello
https://rhn.redhat.com
Other
6 stars 34 forks source link

add rhsm_environment fact #105

Closed vchepkov closed 2 years ago

vchepkov commented 4 years ago

In addition to system id,/usr/sbin/subscription-manager identity command provides additional valuable information:

# /usr/sbin/subscription-manager identity
system identity: 0970a886-b77a-41e1-b2b5-8337a8110c91
name: puppet.example.com
org name: Example Inc
org ID: EINC
environment name: Library/RHEL-7

Please add rhsm_environment fact, it can be used to customize systems configuration

kallies commented 3 years ago

I've had the same requirement (especially the lifecycle environement name). A quick fix was a modified copy of rhsm_identity.rb. A better solution would be to have a fact like the mention rhsm_environment with keys like

rhsm_environment.system_identity = 0970a886-b77a-41e1-b2b5-8337a8110c91
rhsm_environment.name = puppet.example.com
rhsm_environment.org_name =Example Inc
rhsm_environment.org_id = EINC
rhsm_environment.lce = Library
rhsm_environment.cv = RHEL-7