29.10. 使用 Ansible 确保在 IdM 中禁用了 DNS 全局转发器
本节描述了身份管理(IdM)管理员如何使用 Ansible playbook 来确保在 IdM 中禁用了 DNS 全局转发器。在以下示例流程中,IdM 管理员确保全局转发器的转发策略被设为 none
,这样可有效地禁用全局转发器。
先决条件
您已配置了 Ansible 控制节点以满足以下要求:
- 您使用 Ansible 版本 2.8 或更高版本。
-
您已在 Ansible 控制器上安装了
ansible-freeipa
软件包。 - 示例假定在 ~/MyPlaybooks/ 目录中,您已创建了一个带有 IdM 服务器的完全限定域名(FQDN)的 Ansible 清单文件。
-
示例假定 secret.yml Ansible vault 存储了
ipaadmin_password
。
- 您知道 IdM 管理员密码。
流程
导航到
/usr/share/doc/ansible-freeipa/playbooks/dnsconfig
目录:$ cd /usr/share/doc/ansible-freeipa/playbooks/dnsconfig
打开清单文件,并确保
[ipaserver]
部分中列出了您要配置的 IdM 服务器。例如,要指示 Ansible 配置server.idm.example.com
,请输入:[ipaserver] server.idm.example.com
验证
disable-global-forwarders.yml
Ansible playbook 文件的内容,其已配置为禁用所有 DNS 全局转发器。例如:$ cat disable-global-forwarders.yml --- - name: Playbook to disable global DNS forwarders hosts: ipaserver vars_files: - /home/user_name/MyPlaybooks/secret.yml tasks: - name: Disable global forwarders. ipadnsconfig: forward_policy: none
运行 playbook:
$ ansible-playbook --vault-password-file=password_file -v -i inventory.file disable-global-forwarders.yml
其它资源
-
请参阅
/usr/share/doc/ansible-freeipa/
目录中的README-dnsconfig.md
文件。