Project

General

Profile

Feature #18647

Support conditional activation keys

Added by Klaas D over 2 years ago. Updated 11 months ago.

Status:
Needs design
Priority:
Normal
Assignee:
Category:
Activation Key
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Hi,
I've been talking with jsherrill on irc about a problem I have, he suggested opening this feature request, in general this could be fixed by having the possibility to select activation keys for server based on certain things you set in host or hostgroup - these would be content view and lifecycle environment. But maybe we can think a little about what we want to achieve in general with activation keys.

The problem is that at the moment you (can) set lifecycle environment and content view in both the host (or hostgroup/...) and inside the activation key. when you use both the activation key always wins.

Real World Example:
Lifecycle Environments: Library -> Dev -> Prod
Content View: cv_RHEL7 (in all 3 environments)
Activation Key: ak_RHEL7 (Subscription with Lifecycle Environment Library and Content View cv_RHEL7)
Hostgroup: hg_RHEL7 (this includes Puppet Classes/Parameters, Network, OS and Activation Key ak_RHEL7)

Now when I install a server via gui it always ends up in the lifecycle environment and content view of the activation key. I can't install a server into a different lifecycle environment without either creating a new host group or overwriting the activation key manually.

Ideas that could solve this problem:
  • Host group/host can overwrite lifecycle environment and content view set by activation key
  • Activation key gets set conditionally in host group
  • Host group/host don't handle lifecycle environment and content view, activation keys set them
  • Activation Keys don't handle lifecycle environment and content view, host group/host set them

In general I'm not sure why we set lifecycle environemnt and content view at two places :)

Workaround I'm implementing now:
My activation keys are a combination of content view and lifecycle environment and I don't use the activation key set via hostgroups/hosts. In my snippet the registration looks like this:

subscription-manager register --org="<%= @host.rhsm_organization_label %>" --name="<%= @host.name %>" --activationkey="<%= @host.content_view %>-<%= @host.lifecycle_environment %>" 

I only use one activation key but if you need more you can conditionally add @host.params['kt_activation_keys'] if you want :)

Greetings
Klaas

History

#1 Updated by Eric Helms over 2 years ago

  • Status changed from New to Needs design
  • Legacy Backlogs Release (now unused) set to 114

#2 Updated by Klaas D about 2 years ago

I recently had to add additional activation keys for a custom product that is only needed on a couple of servers, my workaround can be extented like I suggested:

<% if @host.params['kt_activation_keys'] %>
subscription-manager register --org="<%= @host.rhsm_organization_label %>" --name="<%= @host.name %>" --activationkey="<%= @host.content_view %>-<%= @host.lifecycle_environment %>,<%= @host.params['kt_activation_keys'] %>" 
<% else -%>
subscription-manager register --org="<%= @host.rhsm_organization_label %>" --name="<%= @host.name %>" --activationkey="<%= @host.content_view %>-<%= @host.lifecycle_environment %>" 
<% end %>

or you could even put it into one line :)

Greetings
Klaas

Also available in: Atom PDF