第21章 Ansible Playbook を使用した IdM でのセルフサービスルールの管理
このセクションでは、Identity Management (IdM) のセルフサービスルールを紹介し、Ansible Playbook を使用してセルフサービスアクセスルールを作成および編集する方法を説明します。セルフサービスのアクセス制御ルールにより、IdM エンティティーは IdM Directory Server エントリーで指定の操作を実行できます。
21.1. Ansible を使用してセルフサービスルールが存在する状態にする リンクのコピーリンクがクリップボードにコピーされました!
以下の手順では、Ansible Playbook を使用してセルフサービスルールを定義し、Identity Management (IdM) サーバーに存在させる方法を説明します。この例では、新しいルール Users can manage their own name details (ユーザーに自分の名前の情報を管理することを許可) により、ユーザーに自分の givenname、displayname、title、および initials 属性を変更する権限を付与します。これにより、たとえば、ユーザーは必要に応じて表示名やイニシャルを変更できるようになります。
前提条件
コントロールノード:
- Ansible バージョン 2.15 以降を使用している。
-
freeipa.ansible_freeipaコレクションがインストールされている。 - ~/MyPlaybooks/ ディレクトリーに、IdM サーバーの完全修飾ドメイン名 (FQDN) を使用して Ansible インベントリーファイル が作成されている (この例の場合)。
-
secret.yml Ansible vault に
ipaadmin_passwordが保存されており、secret.yml ファイルを保護するパスワードを格納しているファイルにアクセスできる (この例の場合)。
-
ターゲットノード (
freeipa.ansible_freeipaモジュールが実行されるノード) が、IdM クライアント、サーバー、またはレプリカとして IdM ドメインに含まれている。
手順
~/MyPlaybooks/ ディレクトリーに移動します。
cd ~/MyPlaybooks/
$ cd ~/MyPlaybooks/Copy to Clipboard Copied! Toggle word wrap Toggle overflow /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/selfservice/ディレクトリーにあるselfservice-present.ymlファイルのコピーを作成します。cp /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/selfservice/selfservice-present.yml selfservice-present-copy.yml
$ cp /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/selfservice/selfservice-present.yml selfservice-present-copy.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Ansible Playbook ファイル (
selfservice-present-copy.yml) を開きます。 freeipa.ansible_freeipa.ipaselfserviceタスクセクションで次の変数を設定して、ファイルを変更します。-
name変数は、新しいセルフサービスルールの名前に設定します。 -
permission変数は、付与するパーミッションをコンマ区切りのリスト (readおよびwrite) で設定します。 -
attribute変数は、ユーザーが管理できる属性 (givenname、displayname、title、およびinitials) をリストとして設定します。
以下は、今回の例で使用するように変更した Ansible Playbook ファイルです。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
ファイルを保存します。
FreeIPA Ansible コレクション内の変数とサンプル Playbook の詳細は、コントロールノードの
/usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/README-selfservice.mdファイルと/usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/selfserviceディレクトリーを参照してください。Ansible Playbook を実行します。Playbook ファイル、secret.yml ファイルを保護するパスワードを格納するファイル、およびインベントリーファイルを指定します。
ansible-playbook --vault-password-file=password_file -v -i inventory selfservice-present-copy.yml
$ ansible-playbook --vault-password-file=password_file -v -i inventory selfservice-present-copy.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow