4.5. cloud-init を使用した Red Hat サブスクリプションの管理
rh_subscription ディレクティブを使用してシステムを登録できます。サブスクリプションごとに、ユーザーデータを編集する必要があります。
例 1
auto-attachオプションとservice-levelオプションを使用できます。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
rh_subscription: username: sample@redhat.com password: 'mypassword' auto-attach: True service-level: self-supportCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注記service-levelオプションでは、auto-attachオプションを使用する必要があります。
例 2
activation-keyオプションおよびorgオプションを使用できます。rh_subscriptionの下にactivation keyとorgの番号を追加し、auto-attachをTrueに設定します。rh_subscription: activation-key: example_key org: 12345 auto-attach: True
rh_subscription: activation-key: example_key org: 12345 auto-attach: TrueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
例 3
サブスクリプションプールを追加できます。
rh_subscriptionの下に、username、password、およびプール番号を追加します。rh_subscription: username: sample@redhat.com password: 'password' add-pool: XYZ01234567
rh_subscription: username: sample@redhat.com password: 'password' add-pool: XYZ01234567Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注記このサンプルは、
subscription-manager attach --pool=XYZ01234567コマンドに相当します。
例 4
/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
rh_subscription: username: sample@redhat.com password: 'password' server-hostname: test.example.com auto-attach: TrueCopy to Clipboard Copied! Toggle word wrap Toggle overflow