22.4. OpenShift Container Platform インスタンスについての Subscription Manager の登録
ノードが正常にプロビジョニングされると、次の手順としてすべてのノードを subscription-manager で正常に登録し、正常な OpenShift Container Platform インストールに必要なすべてのパッケージをインストールする必要があります。これを簡単に実行できるように repos.yml ファイルが作成され、提供されています。
$ cat ~/repos.yml
---
- name: Enable the proper repositories for OpenShift installation
hosts: OSEv3
become: yes
tasks:
- name: Register with activationkey and consume subscriptions matching Red Hat Cloud Suite or Red Hat OpenShift Container Platform
redhat_subscription:
state: present
activationkey: <key-name>
org_id: <orig_id>
pool: '^(Red Hat Cloud Suite|Red Hat OpenShift Container Platform)$'
- name: Disable all current repositories
rhsm_repository:
name: '*'
state: disabled
- name: Enable Repositories
rhsm_repository:
name: "{{ item }}"
state: enabled
with_items:
- rhel-7-server-rpms
- rhel-7-server-extras-rpms
- rhel-7-server-ansible-2.6-rpms
- rhel-7-server-ose-3.11-rpms
リポジトリーの設定 を参照し、有効にする適切なリポジトリーおよびバージョンを確認します。上記のファイルはサンプルであることに注意してください。
repos.yml を使用して ansible-playbook コマンドを実行します。
$ ansible-playbook repos.yml
上記の例では、すべての登録に Ansible の redhat_subscription および rhsm_repository モジュールを使用し、リポジトリーの無効化および有効化を行います。この特定の例では、Red Hat アクティべーションキーを利用しています。アクティべーションキーがない場合は、Ansible の redhat_subscription モジュールにアクセスして、例に示されるようにユーザー名およびパスワードを使用して変更を実行してください (https://docs.ansible.com/ansible/2.6/modules/redhat_subscription_module.html)。
redhat_subscription モジュールは特定ノードで失敗することが時折あります。この問題が生じる場合は、subscription-manager を使用して OpenShift Container Platform インスタンスを手動で登録してください。