3.8. General Management: Kickstart

Kickstart is a way to script and automate system creation. Kickstart is a key component for provisioning systems. Subscription setup can be included in kickstart instructions as a post-install script.
Kickstart setups can follow any workflow an administrator wants to use: registering to hosted services, registering with a Subscription Asset Manager instance using an activation key, manually attaching subscriptions, whatever. First learn which subscription workflow to use, and then use the subscription-manager command to run through each of the required steps.

3.8.1. The Environment: Scripted Environments

Kickstart is used to script system creation, so this is used in environments where instances may be created and destroyed routinely, such as test environments, or in data centers and private clouds.

3.8.2. Workflow

To register a system and attach subscriptions as part of kickstart, run the subscription-manager command as a post-install script.
%post --log=/root/ks-post.log
/usr/sbin/subscription-manager register --username rhn_username --password rhn_password --auto-attach
In this example, the subscription configuration is the default configuration, meaning that the system is registered with the Customer Portal Subscription Management (hosted) system. Additionally, this uses the --auto-attach option to attach the best-matched subscriptions.

3.8.3. Options and Details

Kickstart can follow any of the supported configurations, but it can require using additional post-install scripts first to set up the environment.
  • Set a service level preference using the --servicelevel option.
  • To attach subscriptions manually, leave off the --auto-attach option and run a second script with the attach command or add the subscriptions later.
  • By default, Red Hat Subscription Manager uses the Customer Portal hosted subscription and content services. To use an on-premise service like Subscription Asset Manager, first run the subscription-manager config command and reset the Red Hat Subscription Manager configuration, and then register the system using the new configuration.
  • To register a system and attach subscriptions using an activation key, first configure Red Hat Subscription Manager to use the appropriate subscription service and then register with the activation key.