Blame roles/ipaserver/README.md

Packit 8cb997
ipaserver role
Packit 8cb997
==============
Packit 8cb997
Packit 8cb997
Description
Packit 8cb997
-----------
Packit 8cb997
Packit 8cb997
This role allows to configure and IPA server.
Packit 8cb997
Packit 8cb997
**Note**: The ansible playbooks and role require a configured ansible environment where the ansible nodes are reachable and are properly set up to have an IP address and a working package manager.
Packit 8cb997
Packit 8cb997
Packit 8cb997
Features
Packit 8cb997
--------
Packit 8cb997
* Server deployment
Packit 8cb997
Packit 8cb997
Packit 8cb997
Supported FreeIPA Versions
Packit 8cb997
--------------------------
Packit 8cb997
Packit 8cb997
FreeIPA versions 4.5 and up are supported by the server role.
Packit 8cb997
Packit 8cb997
Packit 8cb997
Supported Distributions
Packit 8cb997
-----------------------
Packit 8cb997
Packit 8cb997
* RHEL/CentOS 7.6+
Packit 8cb997
* Fedora 26+
Packit 8cb997
* Ubuntu
Packit 8cb997
Packit 8cb997
Packit 8cb997
Requirements
Packit 8cb997
------------
Packit 8cb997
Packit 8cb997
**Controller**
Packit 8cb997
* Ansible version: 2.8+
Packit 8cb997
Packit 8cb997
**Node**
Packit 8cb997
* Supported FreeIPA version (see above)
Packit 8cb997
* Supported distribution (needed for package installation only, see above)
Packit 8cb997
Packit 8cb997
Packit 8cb997
Limitations
Packit 8cb997
-----------
Packit 8cb997
Packit 8cb997
External signed CA
Packit 8cb997
Packit 8cb997
External signed CA is now supported. But the currently needed two step process is an issue for the processing in a simple playbook.
Packit 8cb997
Packit 8cb997
Work is planned to have a new method to handle CSR for external signed CAs in a separate step before starting the server installation.
Packit 8cb997
Packit 8cb997
Packit 8cb997
Usage
Packit 8cb997
=====
Packit 8cb997
Packit 8cb997
Example inventory file with fixed domain and realm, setting up of the DNS server and using forwarders from /etc/resolv.conf:
Packit 8cb997
Packit 8cb997
    [ipaserver]
Packit 8cb997
    ipaserver2.example.com
Packit 8cb997
    
Packit 8cb997
    [ipaserver:vars]
Packit 8cb997
    ipaserver_domain=example.com
Packit 8cb997
    ipaserver_realm=EXAMPLE.COM
Packit 8cb997
    ipaserver_setup_dns=yes
Packit 8cb997
    ipaserver_auto_forwarders=yes
Packit 8cb997
Packit 8cb997
Example playbook to setup the IPA server using admin and dirman passwords from an [Ansible Vault](http://docs.ansible.com/ansible/latest/playbooks_vault.html) file:
Packit 8cb997
Packit 8cb997
    - name: Playbook to configure IPA server
Packit 8cb997
      hosts: ipaserver
Packit 8cb997
      become: true
Packit 8cb997
      vars_files:
Packit 8cb997
      - playbook_sensitive_data.yml
Packit 8cb997
    
Packit 8cb997
      roles:
Packit 8cb997
      - role: ipaserver
Packit 8cb997
        state: present
Packit 8cb997
Packit 8cb997
Example playbook to unconfigure the IPA client(s) using principal and password from inventory file:
Packit 8cb997
Packit 8cb997
    - name: Playbook to unconfigure IPA server
Packit 8cb997
      hosts: ipaserver
Packit 8cb997
      become: true
Packit 8cb997
    
Packit 8cb997
      roles:
Packit 8cb997
      - role: ipaserver
Packit 8cb997
        state: absent
Packit 8cb997
Packit 8cb997
Example inventory file with fixed domain, realm, admin and dirman passwords:
Packit 8cb997
Packit 8cb997
    [ipaserver]
Packit 8cb997
    ipaserver.example.com
Packit 8cb997
    
Packit 8cb997
    [ipaserver:vars]
Packit 8cb997
    ipaserver_domain=example.com
Packit 8cb997
    ipaserver_realm=EXAMPLE.COM
Packit 8cb997
    ipaadmin_password=MySecretPassword123
Packit 8cb997
    ipadm_password=MySecretPassword234
Packit 8cb997
Packit 8cb997
Example playbook to setup the IPA server using admin and dirman passwords from inventory file:
Packit 8cb997
Packit 8cb997
    - name: Playbook to configure IPA server
Packit 8cb997
      hosts: ipaserver
Packit 8cb997
      become: true
Packit 8cb997
    
Packit 8cb997
      roles:
Packit 8cb997
      - role: ipaserver
Packit 8cb997
        state: present
Packit 8cb997
Packit 8cb997
Example playbook to setup the IPA primary with external signed CA using the previous inventory file:
Packit 8cb997
Packit 8cb997
Server installation step 1: Generate CSR, copy to controller as `<ipaserver hostname>-ipa.csr`
Packit 8cb997
Packit 8cb997
```yaml
Packit 8cb997
---
Packit 8cb997
- name: Playbook to configure IPA server step1
Packit 8cb997
  hosts: ipaserver
Packit 8cb997
  become: true
Packit 8cb997
  vars:
Packit 8cb997
    ipaserver_external_ca: yes
Packit 8cb997
Packit 8cb997
  roles:
Packit 8cb997
  - role: ipaserver
Packit 8cb997
    state: present
Packit 8cb997
Packit 8cb997
  post_tasks:
Packit 8cb997
  - name: Copy CSR /root/ipa.csr from node to "{{ groups.ipaserver[0] + '-ipa.csr' }}"
Packit 8cb997
    fetch:
Packit 8cb997
      src: /root/ipa.csr
Packit 8cb997
      dest: "{{ groups.ipaserver[0] + '-ipa.csr' }}"
Packit 8cb997
      flat: yes
Packit 8cb997
```
Packit 8cb997
Packit 8cb997
Sign with CA: This is up to you
Packit 8cb997
Packit 8cb997
Server installation step 2: Copy `<ipaserver hostname>-chain.crt` to the IPA server and continue with installation of the primary.
Packit 8cb997
Packit 8cb997
```yaml
Packit 8cb997
- name: Playbook to configure IPA server step3
Packit 8cb997
  hosts: ipaserver
Packit 8cb997
  become: true
Packit 8cb997
  vars:
Packit 8cb997
    ipaserver_external_cert_files: "/root/chain.crt"
Packit 8cb997
Packit 8cb997
  pre_tasks:
Packit 8cb997
  - name: Copy "{{ groups.ipaserver[0] + '-chain.crt' }}" to /root/chain.crt on node
Packit 8cb997
    copy:
Packit 8cb997
      src: "{{ groups.ipaserver[0] + '-chain.crt' }}"
Packit 8cb997
      dest: "/root/chain.crt"
Packit 8cb997
      force: yes
Packit 8cb997
Packit 8cb997
  roles:
Packit 8cb997
  - role: ipaserver
Packit 8cb997
    state: present
Packit 8cb997
```
Packit 8cb997
Packit 8cb997
The files can also be copied automatically: Set `ipaserver_copy_csr_to_controller` to true in the server installation step 1 and set `ipaserver_external_cert_files_from_controller` to point to the `chain.crt` file in the server installation step 2.
Packit 8cb997
Packit 8cb997
Packit 8cb997
Playbooks
Packit 8cb997
=========
Packit 8cb997
Packit 8cb997
The playbooks needed to deploy or undeploy a server are part of the repository in the playbooks folder. There are also playbooks to deploy and undeploy clusters.
Packit 8cb997
```
Packit 8cb997
install-server.yml
Packit 8cb997
uninstall-server.yml
Packit 8cb997
```
Packit 8cb997
Please remember to link or copy the playbooks to the base directory of ansible-freeipa if you want to use the roles within the source archive.
Packit 8cb997
Packit 8cb997
Packit 8cb997
How to setup a server
Packit 8cb997
---------------------
Packit 8cb997
Packit 8cb997
```bash
Packit 8cb997
ansible-playbook -v -i inventory/hosts install-server.yml
Packit 8cb997
```
Packit 8cb997
This will deploy the server defined in the inventory file.
Packit 8cb997
Packit 8cb997
Packit 8cb997
Variables
Packit 8cb997
=========
Packit 8cb997
Packit 8cb997
Base Variables
Packit 8cb997
--------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver` | This group with the single IPA server full qualified hostname. (list of strings) | yes
Packit 8cb997
`ipadm_password` | The password for the  Directory Manager. (string) | no
Packit 8cb997
`ipaadmin_password` | The password for the IPA admin user (string) | no
Packit 8cb997
`ipaserver_ip_addresses` | The list of master server IP addresses. (list of strings) | no
Packit 8cb997
`ipaserver_domain` | The primary DNS domain of an existing IPA deployment. (string) | no
Packit 8cb997
`ipaserver_realm` | The Kerberos realm of an existing IPA deployment. (string) | no
Packit 8cb997
`ipaserver_hostname` | Fully qualified name of the server. (string) | no
Packit 8cb997
`ipaserver_no_host_dns` | Do not use DNS for hostname lookup during installation. (bool, default: false) | no
Packit 8cb997
Packit 8cb997
Server Variables
Packit 8cb997
----------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver_setup_adtrust` | Configure AD Trust capability. (bool, default: false) | no
Packit 8cb997
`ipaserver_setup_kra` | Install and configure a KRA on this server. (bool, default: false) | no
Packit 8cb997
`ipaserver_setup_dns` | Configure an integrated DNS server, create DNS zone specified by domain. (bool, default: false) | no
Packit 8cb997
`ipaserver_idstart` | The starting user and group id number. (integer, default: random) | no
Packit 8cb997
`ipaserver_idmax` | The maximum user and group id number. (integer, default: idstart+199999) | no
Packit 8cb997
`ipaserver_no_hbac_allow` | Do not install allow_all HBAC rule. (bool) | no
Packit 8cb997
`ipaserver_no_ui_redirect` | Do not automatically redirect to the Web UI. (bool) | no
Packit 8cb997
`ipaserver_dirsrv_config_file` | The path to LDIF file that will be used to modify configuration of dse.ldif during installation. (string) | no
Packit 8cb997
`ipaserver_pki_config_override` | Path to ini file with config overrides. This is only usable with recent FreeIPA versions. (string) | no
Packit 8cb997
Packit 8cb997
SSL certificate Variables
Packit 8cb997
-------------------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver_dirsrv_cert_files` | Files containing the Directory Server SSL certificate and private keys. (list of strings) | no
Packit 8cb997
`ipaserver_http_cert_file` | File containing the Apache Server SSL certificate and private key. (string) | no
Packit 8cb997
`ipaserver_pkinit_cert_file` | File containing the Kerberos KDC SSL certificate and private key. (string) | no
Packit 8cb997
`ipaserver_dirsrv_pin` | The password to unlock the Directory Server private key. (string) | no
Packit 8cb997
`ipaserver_http_pin` | The password to unlock the Apache Server private key. (string) | no
Packit 8cb997
`ipaserver_pkinit_pin` | The password to unlock the Kerberos KDC private key. (string) | no
Packit 8cb997
`ipaserver_dirsrv_cert_name` | Name of the Directory Server SSL certificate to install. (string) | no
Packit 8cb997
`ipaserver_http_cert_name` | Name of the Apache Server SSL certificate to install. (string) | no
Packit 8cb997
`ipaserver_pkinit_cert_name` | Name of the Kerberos KDC SSL certificate to install. (string) | no
Packit 8cb997
Packit 8cb997
Client Variables
Packit 8cb997
----------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaclient_ntp_servers` | The list defines the NTP servers to be used. | no
Packit 8cb997
`ipaclient_ntp_pool` | The string value defines the ntp server pool to be used. | no
Packit 8cb997
`ipaclient_no_ntp` | The bool value defines if NTP will not be configured and enabled. `ipaclient_no_ntp` defaults to `no`. | no
Packit 8cb997
`ipaclient_ssh_trust_dns` | The bool value defines if OpenSSH client will be configured to trust DNS SSHFP records.  `ipaclient_ssh_trust_dns` defaults to `no`. | no
Packit 8cb997
`ipaclient_no_ssh` | The bool value defines if OpenSSH client will be configured. `ipaclient_no_ssh` defaults to `no`. | no
Packit 8cb997
`ipaclient_no_sshd` | The bool value defines if OpenSSH server will be configured. `ipaclient_no_sshd` defaults to `no`. | no
Packit 8cb997
`ipaclient_no_sudo` | The bool value defines if SSSD will be configured as a data source for sudo. `ipaclient_no_sudo` defaults to `no`. | no
Packit 8cb997
`ipaclient_no_dns_sshfp` | The bool value defines if DNS SSHFP records will not be created automatically. `ipaclient_no_dns_sshfp` defaults to `no`. | no
Packit 8cb997
Packit 8cb997
Certificate system Variables
Packit 8cb997
----------------------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver_external_ca` | Generate a CSR for the IPA CA certificate to be signed by an external CA. (bool, default: false) | no
Packit 8cb997
`ipaserver_external_ca_type` | Type of the external CA. (choice: generic,ms-cs) | no
Packit 8cb997
`ipaserver_external_ca_profile` | Specify the certificate profile/template to use at the external CA. (string) | no
Packit 8cb997
`ipaserver_external_cert_files` | Files containing the IPA CA certificates and the external CA certificate chains (list of string) | no
Packit 8cb997
`ipaserver_subject_base` | The certificate subject base (default O=<realm-name>). RDNs are in LDAP order (most specific RDN first). (string) | no
Packit 8cb997
`ipaserver_ca_subject` | The CA certificate subject DN (default CN=Certificate Authority,O=<realm-name>). RDNs are in LDAP order (most specific RDN first). (string) | no
Packit 8cb997
`ipaserver_ca_signing_algorithm` | Signing algorithm of the IPA CA certificate. (choice: SHA1withRSA,SHA256withRSA,SHA512withRSA) | no
Packit 8cb997
Packit 8cb997
DNS Variables
Packit 8cb997
-------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver_allow_zone_overlap` | Allow creation of (reverse) zone even if the zone is already resolvable. (bool, default: false) | no
Packit 8cb997
`ipaserver_reverse_zones` | The reverse DNS zones to use. (list of strings) | no
Packit 8cb997
`ipaserver_no_reverse` | Do not create reverse DNS zone. (bool, default: false) | no
Packit 8cb997
`ipaserver_auto_reverse` | Try to resolve reverse records and reverse zones for server IP addresses. (bool, default: false) | no
Packit 8cb997
`ipaserver_zonemgr` | The e-mail address of the DNS zone manager. (string, default: hostmaster@DOMAIN.) | no
Packit 8cb997
`ipaserver_forwarders` | Add DNS forwarders to the DNS configuration. (list of strings) | no
Packit 8cb997
`ipaserver_no_forwarders` | Do not add any DNS forwarders. Root DNS servers will be used instead. (bool, default: false) | no
Packit 8cb997
`ipaserver_auto_forwarders` | Add DNS forwarders configured in /etc/resolv.conf to the list of forwarders used by IPA DNS. (bool, default: false) | no
Packit 8cb997
`ipaserver_forward_policy` | DNS forwarding policy for global forwarders specified using other options. (choice: first|only) | no
Packit 8cb997
`ipaserver_no_dnssec_validation` | Disable DNSSEC validation on this server. (bool, default: false) | no
Packit 8cb997
Packit 8cb997
AD trust Variables
Packit 8cb997
------------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver_enable_compat`| Enables support for trusted domains users for old clients through Schema Compatibility plugin. (bool, default: false) | no
Packit 8cb997
`ipaserver_netbios_name` | The NetBIOS name for the IPA domain. (string) | no
Packit 8cb997
`ipaserver_rid_base` | First RID value of the local domain. (integer) | no
Packit 8cb997
`ipaserver_secondary_rid_base` | Start value of the secondary RID range. (integer) | no
Packit 8cb997
Packit 8cb997
Special Variables
Packit 8cb997
-----------------
Packit 8cb997
Packit 8cb997
Variable | Description | Required
Packit 8cb997
-------- | ----------- | --------
Packit 8cb997
`ipaserver_install_packages` | The bool value defines if the needed packages are installed on the node. (bool, default: true) | no
Packit 8cb997
`ipaserver_setup_firewalld` | The value defines if the needed services will automatically be opened in the firewall managed by firewalld. (bool, default: true) | no
Packit 8cb997
`ipaserver_external_cert_files_from_controller` | Files containing the IPA CA certificates and the external CA certificate chains on the controller that will be copied to the ipaserver host to `/root` folder. (list of string) | no
Packit 8cb997
`ipaserver_copy_csr_to_controller` | Copy the generated CSR from the ipaserver to the controller as `"{{ inventory_hostname }}-ipa.csr"`. (bool) | no
Packit 8cb997
Packit 8cb997
Authors
Packit 8cb997
=======
Packit 8cb997
Packit 8cb997
Thomas Woerner