31.7. 使用 Ansible 确保 DNS 全局转发器在 IdM 中被禁用
按照以下流程,使用 Ansible playbook 确保 DNS 全局转发器在 IdM 中被禁用。在以下示例中,IdM 管理员确保将全局转发器的转发策略设置为 none,这样可有效地禁用全局转发器。
先决条件
您已配置了 Ansible 控制节点以满足以下要求:
- 您在使用 Ansible 版本 2.15 或更高版本。
-
已安装
freeipa.ansible_freeipa集合。 - 示例假定在 ~/MyPlaybooks/ 目录中,您已创建了一个具有 IdM 服务器的完全限定域名(FQDN)的 Ansible 清单文件。
-
示例假定 secret.yml Ansible vault 存储了您的
ipaadmin_password,并且您可以访问存储了保护 secret.yml 文件的密码的文件。
-
目标节点(这是执行
freeipa.ansible_freeipa模块的节点)是作为 IdM 客户端、服务器或副本的 IdM 域的一部分。
流程
导航到
/usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/dnsconfig目录:cd /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/dnsconfig
$ cd /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/dnsconfigCopy to Clipboard Copied! Toggle word wrap Toggle overflow 验证
disable-global-forwarders.ymlAnsible playbook 文件的内容,它已配置为禁用所有 DNS 全局转发器。例如:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 运行 playbook:
ansible-playbook --vault-password-file=password_file -v -i inventory.file disable-global-forwarders.yml
$ ansible-playbook --vault-password-file=password_file -v -i inventory.file disable-global-forwarders.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow