4.5. cloud-init を使用した Red Hat サブスクリプションの管理
rh_subscription
ディレクティブを使用してシステムを登録できます。サブスクリプションごとに、ユーザーデータを編集する必要があります。以下の手順では、rh_subscription
ディレクティブを使用して加えることのできる変更の例をいくつか示します。
手順
自動アタッチ
オプションとサービスレベル
オプションを使用するには、次の手順を実行します。rh_subscription
の下にusername
とpassword
を追加して、auto-attach
をTrue
に設定し、service-level
をself-support
に設定します。rh_subscription: username: sample@redhat.com password: 'mypassword' auto-attach: True service-level: self-support
注記service-level
オプションでは、auto-attach
オプションを使用する必要があります。activation-key
およびorg
オプションを使用するには、以下の手順を実行します。rh_subscription
の下にactivation key
とorg
の番号を追加し、auto-attach
をTrue
に設定します。rh_subscription: activation-key: example_key org: 12345 auto-attach: True
サブスクリプションプールを追加するには、以下の手順を実行します。
rh_subscription
の下に、username
、password
、およびプール番号を追加します。rh_subscription: username: sample@redhat.com password: 'password' add-pool: XYZ01234567
注記このサンプルは、
subscription-manager attach --pool=XYZ01234567
コマンドに相当します。/etc/rhsm/rhsm.conf
ファイルでサーバーのホスト名を設定するには、以下の手順を実行します。rh_subscription
の下にusername
、password
、server-hostname
を追加し、auto-attach
をTrue
に設定します。rh_subscription: username: sample@redhat.com password: 'password' server-hostname: test.example.com auto-attach: True