freeipa installation using ansible-freeipa...allow automation of freeipa installations and...

16
FREEIPA INSTALLATION USING ANSIBLE-FREEIPA FOSDEM - 2018-02-03 Thomas Wörner Senior Software Engineer, Red Hat Inc. https://github.com/freeipa/ansible-freeipa/

Upload: others

Post on 21-Aug-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

FREEIPA INSTALLATION USINGANSIBLE-FREEIPA FOSDEM - 2018-02-03 Thomas WörnerSenior Software Engineer, Red Hat Inc. https://github.com/freeipa/ansible-freeipa/

Page 2: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

AGENDAProject goalsIPA installers vs. ansible-freeipaIPA client installation stepsEnrollment workflow with ipa-client-install vs. with ansible-freeipaIPA client OTP use caseIPA client domain configuration with ipa-client-install vs. withansible-freeipaIPA server installation stepsExamples of Ansible inventory files and playbooks

Page 3: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

PROJECT GOALSAllow automation of FreeIPA installations and configuration usingansible-freeipaSame results using normal FreeIPA installers or ansible-freeipa

ansible-freeipa can provide additional featuresProvide Ansible roles and modules for server, client and replicainstallations

The replica installation is still work in progress and not part of therepository yet

Support FreeIPA 4.5+ for ipaserver, ipareplica and ipaclient roles

Page 4: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

FREEIPA INSTALLER SCRIPTS VS.ANSIBLE-FREEIPAINSTALLATION USING FREEIPA INSTALLERS

Log in to every machine, start installation process manuallyUse either principal/password or keytabWait till installation is done

INSTALLATION USING ANSIBLE-FREEIPA

Simple installation on more than one machineOne configuration file (inventory file) per domain or realmOne place for configuration optionsSimple use of OTP for client installation and update, more secure: Admin password not transferred to the clientsAdvanced auto detection for clientsRepair of broken client configurations with one known limitation:

Missing /etc/krb5.keytab

Page 5: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

FREEIPA CLIENT INSTALLATIONSTEPS

Domain discovery and validation of parametersTime synchronization (ntp, chrony)IPA enrollment (Creation of host entry and keytab)SSSD, PAM, NSS configurationKerberos client configurationPKI configurationDNS configuration

Page 6: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

CLIENT CONFIGURATION WITHANSIBLE-FREEIPA

Full autodiscovery: No need to provide domain or realmUsing DNS SRV/TXT records for ldap and kerberos

Autodiscovery of IPA servers: Provide IPA domainEnhanced discovery: Provide only serverNo discovery: Provide server and domainRealm is usually derived from upper-cased name of the IPA domain,or can be forced to a different valueSupported enrollment types

OTPAdmin principal and passwordExisting host keytab

Page 7: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

CLIENT INVENTORY FILE# Example minimal inventory file using full auto-detection[ipaclients]ipaclient.ipadomain.com

# ipaclient_password can be provided by a Vault-protected file

ipaserversipaclientsipaadmin_keytabipaadmin_passwordipaadmin_principalipaclient_domainipaclient_realmipaclient_keytabipaclient_force_ joinipaclient_use_otpipaclient_allow_repairipaclient_kinit_attemptsipaclient_ntpipaclient_mkhomedir

Group of IPA server hostnamesGroup of IPA client hostnamesThe path to the admin keytab used for alternative authenticationThe password for the kerberos admin principalThe authorized kerberos principal used to join the IPA realmThe primary DNS domain of an existing IPA deploymentThe Kerberos realm of an existing IPA deploymentThe path to a backed-up host keytab from previous enrollmentSet force_ join to yes to join the host even if it is already enrolledGenerate a one-time-passwordAllow repair of already joined hostsRepeat the request for host Kerberos ticketSet to no to not configure and enable NTPCreate users home dir

Page 8: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

CLIENT PLAYBOOKSinstall-client.yml---- name: Playbook to configure IPA clients with username/password hosts: ipaclients become: true vars_files: - playbook_sensitive_data.yml

roles: - role: ipaclient state: present

uninstall-client.yml---- name: Playbook to configure IPA clients with username/password hosts: ipaclients become: true vars_files: - playbook_sensitive_data.yml

roles: - role: ipaclient state: absent

Page 9: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

IPA SERVER INSTALLATION STEPSDomain discovery and validation of parameters(Configure firewall)Time synchronization and configuration (ntpd)Directory server configuration (dirsrv)Kerberos configuration (krb5kdc, kadmin)Certificate Server configuration (pki-tomcatd)Further directory server configuration (dirsrv)OTPD configuration (ipa-otpd)Custodia configuration (ipa-custodia)HTTP configuration (httpd)Kerberos KDC configuration (krb5kdc)KRA (Key Recovery Authority) configurationDNS configuration (named)AD trust configuration (smb, winbind)Client configuration on masterEnable IPA service

Page 10: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

SERVER INVENTORY FILE# Example minimal server inventory file[ipaserver]ipaserver.ipadomain.com

[ipaserver:vars]ipaserver_domain=ipadomain.comipaserver_realm=IPADOMAIN.COM# Passwords can be provided by a Vault-protected fileipaadmin_password=SomePassword1ipadm_password=SomePassword2

ipaserveripaadmin_passwordipaserver_domainipaserver_realmipaserver_setup_kraipaserver_setup_dnsipaserver_setup_adtrustipaserver_auto_forwardersipaserver_no_reverseipaclient_no_ntpipaclient_mkhomedir (excerpt)

Group with IPA server hostnameThe password for the kerberos admin principalThe primary DNS domain for the IPA deploymentThe Kerberos realm for the IPA deploymentInstall and configure a KRA on this serverConfigure an integrated DNS serverConfigure AD Trust capabilityAdd DNS forwarders configured in /etc/resolv.confDo not create reverse DNS zoneSet to no to not configure and enable NTPCreate users home dir

Page 11: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

SERVER PLAYBOOKSinstall-server.yml---- name: Playbook to configure IPA server with username/password hosts: ipaserver become: true

roles: - role: ipaserver state: present

uninstall-server.yml---- name: Playbook to configure IPA clients with username/password hosts: ipaserver become: true

roles: - role: ipaserver state: absent

Page 12: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

CLUSTER INVENTORY FILE[ipaserver]ipaserver.ipadomain.local

[ipaserver:vars]ipadm_password=SomePassword123#ipaserver_setup_dns=yes#ipaserver_auto_forwarders=yes

[ipaclients]ipaclient1.ipadomain.localipaclient2.ipadomain.localipaclient3.ipadomain.local

[ipaclients:vars]#ipaclient_use_otp=yesipaclient_allow_repair=yes

[ipa:children]ipaserveripaclients

[ipa:vars]ipaadmin_password=SomePassword456ipaserver_domain=ipadomain.localipaserver_realm=IPADOMAIN.LOCAL

Page 13: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

CLUSTER PLAYBOOKS (1)install-cluster.yml---- name: Install IPA servers hosts: ipaserver become: true

roles: - role: ipaserver state: present

- name: Install IPA clients hosts: ipaclients become: true

roles: - role: ipaclient state: present

Note: Please remember to register the client IP addresses and names if DNS will besetup in the IPA server. This needs to be done before the clients are enrolled.

Page 14: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

CLUSTER PLAYBOOKS (2)uninstall-cluster.yml---- name: Uninstall IPA clients hosts: ipaclients become: true

roles: - role: ipaclient state: absent

- name: Uninstall IPA servers hosts: ipaserver become: true

roles: - role: ipaserver state: absent

Page 15: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

Q/A

Page 16: FREEIPA INSTALLATION USING ANSIBLE-FREEIPA...Allow automation of FreeIPA installations and configuration using ansible-freeipa Same results using normal FreeIPA installers or ansible-freeipa

THANK YOU