6.12. Ansible を使用して IdM で DNS 正引きゾーンを複数配置する手順
本セクションでは、Identity Management (IdM) 管理者が Ansible Playbook を使用して IdM の DNS 正引きゾーンに複数のフォワーダーを配置する方法を説明します。以下の手順の例では、IdM 管理者が example.com
の DNS 正引きゾーンが 8.8.8.8
と 4.4.4.4
に転送されるようにします。
前提条件
- Ansible コントローラーに ansible-freeipa パッケージがインストールされている。これは、この手順の内容を実行するホストです。
- IdM 管理者パスワードを把握している。
手順
/usr/share/doc/ansible-freeipa/playbooks/dnsconfig
ディレクトリーに移動します。$ cd /usr/share/doc/ansible-freeipa/playbooks/dnsconfig
インベントリーファイルを開き、設定する IdM サーバーが
[ipaserver]
セクションに記載されていることを確認します。たとえば、Ansible に対してserver.idm.example.com
を設定するように指示するには、次のコマンドを実行します。[ipaserver] server.idm.example.com
Ansible Playbook ファイル (
forwarders-absent.yml
) のコピーを作成します。以下に例を示します。$ cp forwarders-absent.yml ensure-presence-multiple-forwarders.yml
-
ensure-presence-multiple-forwarders.yml
ファイルを開いて編集します。 以下の変数を設定してファイルを調整します。
-
Playbook の
name
変数は、IdM DNS の DNS 正引きゾーンに複数のフォワーダーを配置する Playbook
の設定に変更します。 -
tasks
セクションで、タスクのname
をEnsure presence of 8.8.8.8 and 4.4.4.4 forwarders in dnsforwardzone for example.com
に変更します。 -
tasks
セクションで、ipadnsconfig
のヘディングをipadnsforwardzone
に変更します。 ipadnsforwardzone
セクションで以下を実行します。-
ipaadmin_password
変数を追加して、IdM 管理者パスワードに設定します。 -
name
変数を追加してexample.com
に設定します。 forwarders
セクションで、以下を実行します。-
ip_address
とport
の行を削除します。 配置する DNS サーバーの IP アドレスを、前にダッシュをつけて追加します。
- 8.8.8.8 - 4.4.4.4
-
- state 変数を present に変更します。
今回の例で使用するように変更した Ansible Playbook ファイル:
-
--- - name: name: Playbook to ensure the presence of multiple forwarders in a dnsforwardzone in IdM DNS hosts: ipaserver become: true tasks: - name: Ensure presence of 8.8.8.8 and 4.4.4.4 forwarders in dnsforwardzone for example.com ipadnsforwardzone: ipaadmin_password: password01 name: example.com forwarders: - 8.8.8.8 - 4.4.4.4 state: present
-
Playbook の
- ファイルを保存します。
Playbook を実行します。
$ ansible-playbook -v -i inventory.file ensure-presence-multiple-forwarders.yml
関連情報
-
/usr/share/doc/ansible-freeipa/
ディレクトリーのREADME-dnsforwardzone.md
ファイルを参照してください。