29.8. Using Ansible to install an IdM server with integrated eDNS and an integrated root CA
You can use the ipaserver role available in the ansible-freeipa package to install an Identity Management (IdM) server with DNS-over-TLS (DoT) enabled.
You can select either the enforced or relaxed policy. By default, the installer uses the relaxed policy, which attempts DoT but allows fallback to standard, unencrypted DNS if a secure connection cannot be established. To apply the enforced policy, set the ipaserver_dns_policy variable to enforced in the vars section of the Ansible playbook.
For the configuration of DoT, you can use a certificate issued by the integrated IdM Certificate Authority (CA) or provide a custom certificate issued by an external CA. If you do not provide a certificate, the IdM CA automatically issues a DoT certificate during the installation.
Prerequisites
- You are using Ansible version 2.15 or later.
-
You have installed the
ansible-freeipapackage. -
The example assumes that the
secret.ymlAnsible vault stores youripaadmin_passwordand that you have access to a file that stores the password protecting thesecret.ymlfile. - Review the steps outlined in Preparing the system for IdM server installation.
-
For
enforcedDoT, complete the steps in Configuring client and replica systems to use DoT exclusively.
Procedure
Optional: To use a custom PEM-formatted certificate and key for DoT issued by an external certificate authority:
SSH to the host where you are going to install the IdM server:
$ ssh root@server.idm.example.comCreate the two files and assign ownership to the
nameddaemon:# openssl req \ -newkey rsa:2048 \ -nodes \ -keyout /etc/pki/tls/certs/privkey.pem \ -x509 \ -days 36500 \ -out /etc/pki/tls/certs/certificate.pem \ -subj "/C=<country_code>/ST=<state>/L=<location>/O=<organization>/OU=<organizational_unit>/CN=<idm_server_fqdn>/emailAddress=<email>" && \ chown named:named /etc/pki/tls/certs/privkey.pem /etc/pki/tls/certs/certificate.pemExit the SSH session on the IdM server:
# exit
On the Ansible controller, create a playbook file named
install-server-integrated-ca.ymlwith the instructions to install an IdM server with an integrated IdM CA:--- - name: Playbook to configure IPA server hosts: ipaserver become: true vars_files: - /home/user_name/MyPlaybooks/secret.yml vars: ipaserver_domain: idm.example.com ipaserver_realm: IDM.EXAMPLE.COM ipaserver_hostname: server.idm.example.com ipa_admin_password: "{{ vault_admin_password }}" ipadm_password: "{{ vault_dm_password }}" ipaserver_setup_dns: true ipaserver_dot_forwarders: - "<server_ip>#<dns_server_hostname>" ipaserver_dns_over_tls: true ipaserver_auto_reverse: true roles: - role: freeipa.ansible_freeipa.ipaserverIf you are using a custom PEM-formatted certificate and key for DoT issued by an external certificate authority, add the following in the
varssection:ipaserver_dns_over_tls_cert: /etc/pki/tls/certs/certificate.pem ipaserver_dns_over_tls_key: /etc/pki/tls/certs/privkey.pemRun the Ansible playbook:
$ ansible-playbook --vault-password-file=password_file -v -i ~/MyPlaybooks/inventory ~/MyPlaybooks/install-server-integrated-ca.yml
Troubleshooting
SSHto the IdM server:# ssh root@server.idm.example.comEnable detailed logging for the
unboundservice:# unbound-control verbosity 3Restart the
unboundservice to apply the updated configuration:# systemctl restart unboundMonitor real-time logs of the
unboundservice:$ journalctl -u unbound -f