Blame roles/ipaclient/README.md

Packit Service 0a38ef
ipaclient role
Packit Service 0a38ef
==============
Packit Service 0a38ef
Packit Service 0a38ef
This [Ansible](https://www.ansible.com/) role allows to join hosts as clients to an IPA domain. This can be done in different ways using auto-discovery of the servers, domain and other settings or by specifying them.
Packit Service 0a38ef
Packit Service 0a38ef
**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 Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Features
Packit Service 0a38ef
--------
Packit Service 0a38ef
* Client deployment
Packit Service 0a38ef
* One-time-password (OTP) support
Packit Service 0a38ef
* Repair mode
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Supported FreeIPA Versions
Packit Service 0a38ef
--------------------------
Packit Service 0a38ef
Packit Service 0a38ef
FreeIPA versions 4.5 and up are supported by the client role. There is also limited support for version 4.4.
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Supported Distributions
Packit Service 0a38ef
-----------------------
Packit Service 0a38ef
Packit Service 0a38ef
* RHEL/CentOS 7.4+
Packit Service 0a38ef
* Fedora 26+
Packit Service 0a38ef
* Ubuntu
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Requirements
Packit Service 0a38ef
------------
Packit Service 0a38ef
Packit Service 0a38ef
**Controller**
Packit Service 0a38ef
* Ansible version: 2.8+
Packit Service 0a38ef
* /usr/bin/kinit is required on the controller if a one time password (OTP) is used
Packit Service 0a38ef
* python3-gssapi is required on the controller if a one time password (OTP) is used with keytab
Packit Service 0a38ef
Packit Service 0a38ef
**Node**
Packit Service 0a38ef
* Supported FreeIPA version (see above)
Packit Service 0a38ef
* Supported distribution (needed for package installation only, see above)
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Usage
Packit Service 0a38ef
=====
Packit Service 0a38ef
Packit Service 0a38ef
Example inventory file with fixed principal using auto-discovery with DNS records:
Packit Service 0a38ef
Packit Service 0a38ef
```ini
Packit Service 0a38ef
[ipaclients]
Packit Service 0a38ef
ipaclient1.example.com
Packit Service 0a38ef
ipaclient2.example.com
Packit Service 0a38ef
Packit Service 0a38ef
[ipaclients:vars]
Packit Service 0a38ef
ipaadmin_principal=admin
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
Example playbook to setup the IPA client(s) using principal from inventory file and password from an [Ansible Vault](http://docs.ansible.com/ansible/latest/playbooks_vault.html) file:
Packit Service 0a38ef
Packit Service 0a38ef
```yaml
Packit Service 0a38ef
- name: Playbook to configure IPA clients with username/password
Packit Service 0a38ef
  hosts: ipaclients
Packit Service 0a38ef
  become: true
Packit Service 0a38ef
  vars_files:
Packit Service 0a38ef
  - playbook_sensitive_data.yml
Packit Service 0a38ef
Packit Service 0a38ef
  roles:
Packit Service 0a38ef
  - role: ipaclient
Packit Service 0a38ef
    state: present
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
Example playbook to unconfigure the IPA client(s) using principal and password from inventory file:
Packit Service 0a38ef
Packit Service 0a38ef
```yaml
Packit Service 0a38ef
- name: Playbook to unconfigure IPA clients
Packit Service 0a38ef
  hosts: ipaclients
Packit Service 0a38ef
  become: true
Packit Service 0a38ef
Packit Service 0a38ef
  roles:
Packit Service 0a38ef
  - role: ipaclient
Packit Service 0a38ef
    state: absent
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
Example inventory file with fixed servers, principal, password and domain:
Packit Service 0a38ef
Packit Service 0a38ef
```ini
Packit Service 0a38ef
[ipaclients]
Packit Service 0a38ef
ipaclient1.example.com
Packit Service 0a38ef
ipaclient2.example.com
Packit Service 0a38ef
Packit Service 0a38ef
[ipaservers]
Packit Service 0a38ef
ipaserver.example.com
Packit Service 0a38ef
Packit Service 0a38ef
[ipaclients:vars]
Packit Service 0a38ef
ipaclient_domain=example.com
Packit Service 0a38ef
ipaadmin_principal=admin
Packit Service 0a38ef
ipaadmin_password=MySecretPassword123
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
Example playbook to setup the IPA client(s) using principal and password from inventory file:
Packit Service 0a38ef
Packit Service 0a38ef
```yaml
Packit Service 0a38ef
- name: Playbook to configure IPA clients with username/password
Packit Service 0a38ef
  hosts: ipaclients
Packit Service 0a38ef
  become: true
Packit Service 0a38ef
Packit Service 0a38ef
  roles:
Packit Service 0a38ef
  - role: ipaclient
Packit Service 0a38ef
    state: present
Packit Service 0a38ef
```
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Playbooks
Packit Service 0a38ef
=========
Packit Service 0a38ef
Packit Service 0a38ef
The playbooks needed to deploy or undeploy a client are part of the repository in the playbooks folder. There are also playbooks to deploy and undeploy clusters.
Packit Service 0a38ef
```
Packit Service 0a38ef
install-client.yml
Packit Service 0a38ef
uninstall-client.yml
Packit Service 0a38ef
```
Packit Service 0a38ef
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 Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
How to setup a client
Packit Service 0a38ef
---------------------
Packit Service 0a38ef
Packit Service 0a38ef
```bash
Packit Service 0a38ef
ansible-playbook -v -i inventory/hosts install-client.yml
Packit Service 0a38ef
```
Packit Service 0a38ef
This will deploy the clients defined in the inventory file.
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Variables
Packit Service 0a38ef
=========
Packit Service 0a38ef
Packit Service 0a38ef
Base Variables
Packit Service 0a38ef
--------------
Packit Service 0a38ef
Packit Service 0a38ef
Variable | Description | Required
Packit Service 0a38ef
-------- | ----------- | --------
Packit Service 0a38ef
`ipaclients` | This group is a list of the names of the IPA clients in FQDN form. All these clients will be installed or configured using the playbook. | yes
Packit Service 0a38ef
`ipaclient_domain` | This string value sets the DNS domain that will be used for client installation. Usually the DNS domain is a lower-cased name of the Kerberos realm. If the role is for example used in a cluster inventory and `ipaserver_domain` is set, then it will be used. | no
Packit Service 0a38ef
`ipaclient_realm` | This string value sets the Kerberos realm that will be used for client installation. Usually the Kerberos realm is an upper-cased name of the DNS domain. If the role is for example used in a cluster inventory and `ipaserver_realm` is set, then it will be used. If `ipaclient_realm` is not set, then it will be generated from `ipaclient_domain` if this is set. | no
Packit Service 0a38ef
`ipaclient_mkhomedir` | This bool value defines if PAM will be configured to create a users home directory if it does not exist. `ipaclient_mkhomedir` defaults to `no`. | no
Packit Service 0a38ef
 `ipaclient_force_join` | This bool value defines if an already enrolled host can join again. `ipaclient_force_join` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_kinit_attempts` | The int value defines the number of tries to repeat the request for a failed host Kerberos ticket. `ipaclient_kinit_attempts` defaults to 5.| no
Packit Service 0a38ef
`ipaclient_ntp_servers` | The list defines the NTP servers to be used. | no
Packit Service 0a38ef
`ipaclient_ntp_pool` | The string value defines the ntp server pool to be used. | no
Packit Service 0a38ef
`ipaclient_no_ntp` | The bool value defines if NTP will not be configured and enabled. `ipaclient_no_ntp` defaults to `no`. | no
Packit Service 0a38ef
`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 Service 0a38ef
`ipaclient_no_ssh` | The bool value defines if OpenSSH client will be configured. `ipaclient_no_ssh` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_no_sshd` | The bool value defines if OpenSSH server will be configured. `ipaclient_no_sshd` defaults to `no`. | no
Packit Service 0a38ef
`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 Service 0a38ef
`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 Service 0a38ef
`ipaclient_force` | The bool value defines if settings will be forced even in the error case. `ipaclient_force` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_force_ntpd` | The bool value defines if ntpd usage will be forced. This is not supported anymore and leads to a warning. `ipaclient_force_ntpd` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_nisdomain` | This string value defines the NIS domain name. | no
Packit Service 0a38ef
`ipaclient_no_nisdomain` | The bool value defines if the NIS domain name will not be configured. `ipaclient_no_nisdomain` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_configure_firefox` | The bool value defines if Firefox will be configured to use IPA domain credentials. `ipaclient_configure_firefox` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_firefox_dir` | The string value defines the Firefox installation directory. For example: '/usr/lib/firefox'. | no
Packit Service 0a38ef
`ipaclient_all_ip_addresses` | The bool value defines if DNS A/AAAA records for each IP address on the client will be created. `ipaclient_all_ip_addresses` defaults to `no`. | no
Packit Service 0a38ef
`ipasssd_fixed_primary` | The bool value defines if SSSD will be configured to use a fixed server as the primary IPA server. `ipasssd_fixed_primary` defaults to `no`. | no
Packit Service 0a38ef
`ipasssd_permit` | The bool value defines if SSSD will be configured to permit all access. Otherwise the machine will be controlled by the Host-based Access Controls (HBAC) on the IPA server. `ipasssd_permit` defaults to `no`. | no
Packit Service 0a38ef
`ipasssd_enable_dns_updates` | The bool value tells SSSD to automatically update DNS with the IP address of this client. `ipasssd_enable_dns_updates` defaults to `no`. | no
Packit Service 0a38ef
`ipasssd_no_krb5_offline_passwords` | The bool value defines if SSSD will be configured not to store user password when the server is offline . `ipasssd_no_krb5_offline_passwords` defaults to `no`. | no
Packit Service 0a38ef
`ipasssd_preserve_sssd` | The bool value defines if the old SSSD configuration will be preserved if it is not possible to merge it with a new one. `ipasssd_preserve_sssd` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_request_cert` | The bool value defines if the certificate for the machine wil be requested. The certificate will be stored in /etc/ipa/nssdb under the nickname "Local IPA host". . `ipaclient_request_cert` defaults to `no`. The option is deprecated and will be removed in a future release. | no
Packit Service 0a38ef
`ipaclient_keytab` | The string value contains the path on the node of a backup host keytab from a previous enrollment. | no
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Server Variables
Packit Service 0a38ef
----------------
Packit Service 0a38ef
Packit Service 0a38ef
Variable | Description | Required
Packit Service 0a38ef
-------- | ----------- | --------
Packit Service 0a38ef
`ipaservers` | This group is a list of the IPA server full qualified host names. In a topology with a chain of servers and replicas, it is important to use the right server or replica as the server for the client. If there is a need to overwrite the setting for a client in the `ipaclients` group, please use the list `ipaclient_servers` explained below. If no `ipaservers` group is defined than the installation preparation step will try to use DNS autodiscovery to identify the the IPA server using DNS txt records. | mostly
Packit Service 0a38ef
`ipaadmin_keytab` | The string variable enables the use of an admin keytab as an alternative authentication method. The variable needs to contain the local path to the keytab file. If `ipaadmin_keytab` is used, then `ipaadmin_password` does not need to be set. If `ipaadmin_keytab` is used with `ipaclient_use_otp: yes` then the keytab needs to be available on the controller, else on the client node. The use of full path names is recommended.  | no
Packit Service 0a38ef
`ipaadmin_principal` | The string variable only needs to be set if the name of the Kerberos admin principal is not "admin". If `ipaadmin_principal` is not set it will be set internally to "admin". | no
Packit Service 0a38ef
`ipaadmin_password` | The string variable contains the Kerberos password of the Kerberos admin principal. If `ipaadmin_keytab` is used, then `ipaadmin_password` does not need to be set. | mostly
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Topology Variables
Packit Service 0a38ef
------------------
Packit Service 0a38ef
Packit Service 0a38ef
These variables can be used to define or change how clients are arranged within a cluster for example.
Packit Service 0a38ef
Packit Service 0a38ef
Variable | Description | Required
Packit Service 0a38ef
-------- | ----------- | --------
Packit Service 0a38ef
`ipaclient_no_dns_lookup` | The bool value defines if the `ipaservers` group will be used as servers for the clients automatically. If enabled this deactivates DNS lookup in Kerberos in client installations. `ipaclient_no_dns_lookup` defaults to `no`. | no
Packit Service 0a38ef
`ipaclient_servers` | The optional list can be used to manually override list of servers on a per client basis. The list of servers is normally taken from from `ipaservers` group. | no
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Special Variables
Packit Service 0a38ef
-----------------
Packit Service 0a38ef
Packit Service 0a38ef
Variable | Description | Required
Packit Service 0a38ef
-------- | ----------- | --------
Packit Service 0a38ef
`ipaclient_use_otp` | The bool value defines if a one-time password will be generated to join a new or existing host. `ipaclient_use_otp` defaults to `no`. The enforcement on an existing host is not done if there is a working krb5.keytab on the host. If the generation of an otp is enforced for an existing host entry, then the host gets disabled and the containing keytab gets removed. | no
Packit Service 0a38ef
`ipaclient_otp` | The string value sets an already generated one-time password for the host. The role will use it and not try to generate a new one. Do not enable `ipaclient_use_otp` additionally. | no
Packit Service 0a38ef
`ipaclient_allow_repair` | The bool value defines if an already joined or partly set-up client can be repaired. `ipaclient_allow_repair` defaults to `no`. Contrary to `ipaclient_force_join=yes` the host entry will not be changed on the server. | no
Packit Service 0a38ef
`ipaclient_install_packages` | The bool value defines if the needed packages are installed on the node. `ipaclient_install_packages` defaults to `yes`. | no
Packit Service 0a38ef
`ipaclient_on_master` | The bool value is only used in the server and replica installation process to install the client part. It should not be set otherwise. `ipaclient_on_master` defaults to `no`. | no
Packit Service 0a38ef
Packit Service 0a38ef
Packit Service 0a38ef
Authors
Packit Service 0a38ef
=======
Packit Service 0a38ef
Packit Service 0a38ef
Florence Blanc-Renaud
Packit Service 0a38ef
Packit Service 0a38ef
Thomas Woerner