Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , ,
Plans:
- update_host_keys
Start using this module
Add this module to your Puppetfile:
mod 'puppetfinland-easy_ipa', '3.1.1'
Learn more about managing modules with a PuppetfileDocumentation
easy_ipa Puppet module
Overview
This module will install and configure IPA servers, replicas, and clients. This module was forked from huit-ipa, and refactored with a focus on simplicity and ease of use.
The following features work great:
- Creating a domain.
- Adding IPA server replicas.
- Joining clients.
- WebUI proxy to https://localhost:8440 (for vagrant testing).
The following features were stripped out and are currently unavailable:
- Autofs configuration.
- Sudo rule management.
- Host management (beyond simple clinet domain joins).
- Host joins via one time passwords.
- Dns zone management (beyond creating an initial zone).
Dependencies
This module requires puppetlabs/stdlib >= 4.13.0.
Usage
Example usage:
Creating an IPA master, with the WebUI proxied to https://localhost:8440
.
class {'easy_ipa':
ipa_role => 'master',
domain => 'vagrant.example.lan',
ipa_server_fqdn => 'ipa-server-1.vagrant.example.lan',
admin_password => 'vagrant123',
directory_services_password => 'vagrant123',
install_ipa_server => true,
ip_address => '192.168.56.35',
enable_ip_address => true,
enable_hostname => true,
manage_host_entry => true,
install_epel => true,
webui_disable_kerberos => true,
webui_enable_proxy => true,
webui_force_https => true,
}
Adding a replica:
class {'::easy_ipa':
ipa_role => 'replica',
domain => 'vagrant.example.lan',
ipa_server_fqdn => 'ipa-server-2.vagrant.example.lan',
domain_join_password => 'vagrant123',
install_ipa_server => true,
ip_address => '192.168.56.36',
enable_ip_address => true,
enable_hostname => true,
manage_host_entry => true,
install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan',
}
Add monitoring with monit. Depends on the puppetfinland-monit module:
class { '::easy_ipa::monit::server':
email => 'monitoring@domain.com',
}
Add iptables/ip6tables allow rules:
class { '::easy_ipa::packetfilter::server':
allow_address_ipv4 => '10.0.0.0/8',
allow_address_ipv6 => '::1',
}
Add a backup job to cron:
easy_ipa::backup { 'full':
type => 'full',
timestamp => false,
monthday => 1,
weekday => undef,
hour => 4,
minute => 15,
email => 'admin@domain.com',
}
Backup type can be 'full' or 'data'. Timestamp is either true (default) or false. A wrapper script is used as ipa-backup always adds a timestamp to the backup directory, which makes no sense if an external system (e.g. Bacula) is handling backup versioning anyways.
Adding a local named.conf configuration fragment:
::easy_ipa::config::named { 'tsig-key':
content => template('profile/named-tsig-key.conf.erb'),
}
These can be used for various purposes, for example to add a key which allows dynamic DNS updates to certain DNS zones.
Adding a client:
class {'::easy_ipa':
ipa_role => 'client',
domain => 'vagrant.example.lan',
domain_join_password => 'vagrant123',
install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan',
}
Support for systems without ipa client packages
This module has partial support configuring ipa clients on operating systems which lack ipa client package and thus the ipa-client-install script. Right now Debian 9 is the only operating system supported in this way. Client-side is configured with the exception that sshd_config is not touched to prevent configuration overlap with other Puppet modules. Adapt the following procedure (adapted from here) to complete the enrollment of a host into IPA.
On the IPA master:
kinit admin
ipa host-add --ip-address=192.168.56.40 ipa-client-4.vagrant.example.lan
ipa host-add-managedby --hosts=ipa-server-1.vagrant.example.lan ipa-client-4.vagrant.example.lan
ipa-getkeytab --server=ipa-server-1.vagrant.example.lan -p host/ipa-client-4.vagrant.example.lan -k /tmp/ipa-client-4.keytab
chmod 644 /tmp/ipa-client-4.keytab
Copy the keytab to /etc/krb5.keytab on the client host to be enrolled and in there run
chown root:root /etc/krb5.keytab
chmod 600 /etc/krb5.keytab
Assuming you had ran Puppet on the client and launching of sssd had failed, try again now:
systemctl restart sssd
You should now be able to use kinit normally on the enrolled client:
kinit admin
Many of these steps could be automated with exported resources, but getting the Kerberos keytab back to the enrolled would somewhat be challenging.
Mandatory Parameters
domain
Mandatory. The name of the IPA domain to create or join.
ipa_role
Mandatory. What role the node will be. Options are 'master', 'replica', and 'client'.
admin_password
Mandatory if ipa_role
is set as 'Master' or 'Replica'.
Password which will be assigned to the IPA account named 'admin'.
directory_services_password
Mandatory if ipa_role
is set as 'Master'.
Password which will be passed into the ipa setup's parameter named "--ds-password".
Optional Parameters
autofs_package_name
Name of the autofs package to install if enabled.
configure_dns_server
If true, then the parameter '--setup-dns' is passed to the IPA server installer. Also, triggers the install of the required dns server packages.
configure_replica_ca
If true, then the parameter '--setup-ca' is passed to the IPA replica installer.
configure_ntp
If false, then the parameter '--no-ntp' is passed to the IPA server installer.
custom_dns_forwarders
Each element in this array is prefixed with '--forwarder ' and passed to the IPA server installer.
domain_join_principal
The principal (usually username) used to join a client or replica to the IPA domain.
domain_join_password
The password for the domain_join_principal.
enable_hostname
If true, then the parameter '--hostname' is populated with the parameter 'ipa_server_fqdn'
and passed to the IPA installer. On client installs '--hostname' is populated with $::fqdn
.
enable_ip_address
If true, then the parameter '--ip-address' is populated with the parameter 'ip_address' and passed to the IPA installer.
fixed_primary
If true, then the parameter '--fixed-primary' is passed to the IPA installer.
idstart
From the IPA man pages: "The starting user and group id number". Note that this will clash with installer on RedHat 9. See adjust_login_defs parameter.
idmax
From the IPA man pages: "The max value for the IDs range (default: idstart+199999)".
install_autofs
If true, then the autofs packages are installed.
install_epel
If true, then the epel repo is installed. The epel repo is usually required for sssd packages.
install_kstart
If true, then the kstart packages are installed.
install_ldaputils
If true, then the ldaputils packages are installed.
install_sssdtools
If true, then the sssdtools packages are installed.
ipa_client_package_name
Name of the IPA client package.
ipa_server_package_name
Name of the IPA server package.
install_ipa_client
If true, then the IPA client packages are installed if the parameter 'ipa_role' is set to 'client'.
install_ipa_server
If true, then the IPA server packages are installed if the parameter 'ipa_role' is not set to 'client'.
install_sssd
If true, then the sssd packages are installed.
ip_address
IP address to pass to the IPA installer.
ipa_server_fqdn
Actual fqdn of the IPA server or client.
kstart_package_name
Name of the kstart package.
ldaputils_package_name
Name of the ldaputils package.
ipa_master_fqdn
FQDN of the server to use for a client or replica domain join.
manage_host_entry
If true, then a host entry is created using the parameters 'ipa_server_fqdn' and 'ip_address'.
mkhomedir
If true, then the parameter '--mkhomedir' is passed to the IPA client installer.
no_ui_redirect
If true, then the parameter '--no-ui-redirect' is passed to the IPA server installer.
realm
The name of the IPA realm to create or join.
sssd_package_name
Name of the sssd package.
sssdtools_package_name
Name of the sssdtools package.
̀gssapi_no_negotiate
Suppress setting Negotiate headers based on BrowserMatch. Not sending these headers is useful to work around browsers that do not handle them properly (and incorrectly show authentication popups to users). Example: "Windows". Default undef.
webui_enable_proxy
If true, then httpd is configured to act as a reverse proxy for the IPA Web UI. This allows for the Web UI to be accessed from different ports and hostnames than the default.
webui_force_https
If true, then /etc/httpd/conf.d/ipa-rewrite.conf is modified to force all connections to https. This is necessary to allow the WebUI to be accessed behind a reverse proxy when using nonstandard ports.
webui_proxy_external_fqdn
The public or external FQDN used to access the IPA Web UI behind the reverse proxy.
webui_proxy_https_port
The HTTPS port to use for the reverse proxy. Cannot be 443.
adjust_login_defs
Adjust UID_MAX and GID_MAX in login.defs. This is require on RedHat 9. Default false.
Limitations
This module has only been tested on Centos 7 and RedHat 9.
Testing
A vagrantfile is provided for easy testing.
Steps to get started:
- Install vagrant.
- Install virtualbox.
- Clone this repo.
- Run
vagrant up
in a terminal window from the root of the repo. - Open a browser and navigate to
https://localhost:8440
. Log in with usernameadmin
and passwordvagrant123
.
License
jpuskar/puppet-easy_ipa forked from: huit/puppet-ipa - Puppet module that can manage an IPA master, replicas and clients.
Copyright (C) 2013 Harvard University Information Technology
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Reference
Table of Contents
Classes
Public Classes
easy_ipa
: Manages IPA masters, replicas and clients.easy_ipa::config::admin_user
: Manage admin usereasy_ipa::config::webui
: Configures port and redirect overrides for the IPA server web UI.easy_ipa::install
: Manage easy_ipa installeasy_ipa::install::autofs
: Manage autofseasy_ipa::install::client
: Manage ipa clienteasy_ipa::install::client::debian
: Ensure that home directories get created on Debian and Ubuntu clients.easy_ipa::install::client::manual
: "Manual" configuration of hosts which don't have the freeipa-client package.easy_ipa::install::server
: Manage IPA server installeasy_ipa::install::server::master
: Manage primary servereasy_ipa::install::server::replica
: Manage replica installeasy_ipa::install::sssd
: Manage sssd installeasy_ipa::monit::server
: Manage easy_ipa::monit::servereasy_ipa::named
: Prepare the integrated named-pkcs11 service for local configurationeasy_ipa::packetfilter::server
: Install packet filtering rules for FreeIPA.easy_ipa::params
: Prevent havoc on unsupported operating systems.
Private Classes
easy_ipa::validate_params
: Validates input configs from init.pp.
Defined types
easy_ipa::backup
: Define easy_ipa::backupeasy_ipa::config::named
: Add custom named.conf fragment.easy_ipa::helpers::flushcache
: Manage cache flushing
Plans
easy_ipa::update_host_keys
: Update host keys for a domain-joined node in FreeIPA to match real host keys.
Classes
easy_ipa
TODO: Allow creation of root zone for isolated networks -- https://www.freeipa.org/page/Howto/DNS_in_isolated_networks TODO: Class comments. TODO: Dependencies and metadata updates. TODO: Variable scope and passing. TODO: configurable admin username.
Parameters
The following parameters are available in the easy_ipa
class:
manage
domain
ipa_role
admin_password
directory_services_password
allow_zone_overlap
no_dnssec_validation
client_install_ldaputils
configure_dns_server
configure_replica_ca
configure_ntp
configure_ssh
configure_sshd
custom_dns_forwarders
domain_join_principal
domain_join_password
enable_dns_updates
enable_hostname
enable_ip_address
fixed_primary
idstart
gssapi_no_negotiate
idmax
install_autofs
install_epel
install_kstart
install_sssdtools
install_ipa_client
install_ipa_server
install_sssd
ip_address
ipa_server_fqdn
ipa_master_fqdn
manage_host_entry
mkhomedir
no_ui_redirect
realm
server_install_ldaputils
webui_disable_kerberos
webui_enable_proxy
webui_force_https
webui_proxy_external_fqdn
webui_proxy_https_port
adjust_login_defs
manage
Data type: Boolean
(boolean) Manage easy_ipa with Puppet. Defaults to true. Setting this to to false is useful when a handful of hosts have unsupported operating systems and you'd rather exclude them from FreeIPA instead of including the others individually. Use this with a separate Hiera level (e.g. $::lsbdistcodename) for maximum convenience.
Default value: true
domain
Data type: Stdlib::Fqdn
(string) The name of the IPA domain to create or join.
ipa_role
Data type: Enum['client', 'master', 'replica']
(string) What role the node will be. Options are 'master', 'replica', and 'client'.
admin_password
Data type: Optional[String[8]]
(string) Password which will be assigned to the IPA account named 'admin'.
Default value: undef
directory_services_password
Data type: Optional[String[8]]
(string) Password which will be passed into the ipa setup's parameter named "--ds-password".
Default value: undef
allow_zone_overlap
Data type: Boolean
(boolean) if set to true, allow creating of (reverse) zone even if the zone is already resolvable. Using this option is discouraged as it result in later problems with domain name. You may have to use this, though, when migrating existing DNS domains to FreeIPA.
Default value: false
no_dnssec_validation
Data type: Boolean
(boolean) if set to true, DNSSEC validation is disabled.
Default value: false
client_install_ldaputils
Data type: Boolean
(boolean) If true, then the ldaputils packages are installed if ipa_role is set to client.
Default value: false
configure_dns_server
Data type: Boolean
(boolean) If true, then the parameter '--setup-dns' is passed to the IPA server installer. Also, triggers the install of the required dns server packages.
Default value: true
configure_replica_ca
Data type: Boolean
(boolean) If true, then the parameter '--setup-ca' is passed to the IPA replica installer.
Default value: false
configure_ntp
Data type: Boolean
(boolean) If false, then the parameter '--no-ntp' is passed to the IPA client and server installers.
Default value: true
configure_ssh
Data type: Boolean
(boolean) If false, then the parameter '--no-ssh' is passed to the IPA client and server installers.
Default value: true
configure_sshd
Data type: Boolean
(boolean) If false, then the parameter '--no-sshd' is passed to the IPA client and server installers.
Default value: true
custom_dns_forwarders
Data type: Array[String]
(array[string]) Each element in this array is prefixed with '--forwarder ' and passed to the IPA server installer.
Default value: []
domain_join_principal
Data type: String[1]
(string) The principal (usually username) used to join a client or replica to the IPA domain.
Default value: 'admin'
domain_join_password
Data type: Optional[String[1]]
(string) The password for the domain_join_principal.
Default value: undef
enable_dns_updates
Data type: Boolean
(boolean) If true, then the parameter '--enable-dns-updates' is passed to the IPA installer.
Default value: false
enable_hostname
Data type: Boolean
(boolean) If true, then the parameter '--hostname' is populated with the parameter 'ipa_server_fqdn' and passed to the IPA installer.
Default value: true
enable_ip_address
Data type: Boolean
(boolean) If true, then the parameter '--ip-address' is populated with the parameter 'ip_address' and passed to the IPA installer.
Default value: false
fixed_primary
Data type: Boolean
(boolean) If true, then the parameter '--fixed-primary' is passed to the IPA installer.
Default value: false
idstart
Data type: Integer[10000]
(integer) From the IPA man pages: "The starting user and group id number".
Default value: (fqdn_rand('10737') + 10000
gssapi_no_negotiate
Data type: Variant[Pattern,Undef]
(pattern) Suppress setting Negotiate headers based on BrowserMatch. Not sending these headers is useful to work around browsers that do not handle them properly (and incorrectly show authentication popups to users). Example: "Windows". Default undef.
Default value: undef
idmax
Data type: Variant[Integer,Undef]
(integer) From the IPA man pages: "The max value for the IDs range (default: idstart+199999)".
Default value: undef
install_autofs
Data type: Boolean
(boolean) If true, then the autofs packages are installed.
Default value: false
install_epel
Data type: Boolean
(boolean) If true, then the epel repo is installed. The epel repo is usually required for sssd packages.
Default value: true
install_kstart
Data type: Boolean
(boolean) If true, then the kstart packages are installed.
Default value: true
install_sssdtools
Data type: Boolean
(boolean) If true, then the sssdtools packages are installed.
Default value: true
install_ipa_client
Data type: Boolean
(boolean) If true, then the IPA client packages are installed if the parameter 'ipa_role' is set to 'client'.
Default value: true
install_ipa_server
Data type: Boolean
(boolean) If true, then the IPA server packages are installed if the parameter 'ipa_role' is not set to 'client'.
Default value: true
install_sssd
Data type: Boolean
(boolean) If true, then the sssd packages are installed.
Default value: true
ip_address
Data type: Optional[Stdlib::IP::Address]
(string) IP address to pass to the IPA installer.
Default value: undef
ipa_server_fqdn
Data type: String
(string) Actual fqdn of the IPA server or client.
Default value: $facts['networking']['fqdn']
ipa_master_fqdn
Data type: Optional[Stdlib::Fqdn]
(string) FQDN of the server to use for a client or replica domain join.
Default value: undef
manage_host_entry
Data type: Boolean
(boolean) If true, then a host entry is created using the parameters 'ipa_server_fqdn' and 'ip_address'.
Default value: false
mkhomedir
Data type: Boolean
(boolean) If true, then the parameter '--mkhomedir' is passed to the IPA server and client installers.
Default value: true
no_ui_redirect
Data type: Boolean
(boolean) If true, then the parameter '--no-ui-redirect' is passed to the IPA server installer.
Default value: false
realm
Data type: Optional[Stdlib::Fqdn]
(string) The name of the IPA realm to create or join.
Default value: undef
server_install_ldaputils
Data type: Boolean
(boolean) If true, then the ldaputils packages are installed if ipa_role is not set to client.
Default value: true
webui_disable_kerberos
Data type: Boolean
Disable webui kerberos.
Default value: false
webui_enable_proxy
Data type: Boolean
(boolean) If true, then httpd is configured to act as a reverse proxy for the IPA Web UI. This allows for the Web UI to be accessed from different ports and hostnames than the default.
Default value: false
webui_force_https
Data type: Boolean
(boolean) If true, then /etc/httpd/conf.d/ipa-rewrite.conf is modified to force all connections to https. This is necessary to allow the WebUI to be accessed behind a reverse proxy when using nonstandard ports.
Default value: false
webui_proxy_external_fqdn
Data type: String
(string) The public or external FQDN used to access the IPA Web UI behind the reverse proxy.
Default value: 'localhost'
webui_proxy_https_port
Data type: String
(integer) The HTTPS port to use for the reverse proxy. Cannot be 443.
Default value: '8440'
adjust_login_defs
Data type: Boolean
(boolean) Adjust UID_MAX and GID_MAX in login.defs. Without this newer server installers fail. Default false.
Default value: false
easy_ipa::config::admin_user
Manage admin user
easy_ipa::config::webui
Configures port and redirect overrides for the IPA server web UI.
easy_ipa::install
Manage easy_ipa install
easy_ipa::install::autofs
Manage autofs
easy_ipa::install::client
Manage ipa client
easy_ipa::install::client::debian
This code is needed as the --mkhomedir parameter passed to ipa-client-install does not configure PAM even though it does install the required packages.
Currently Ubuntu 14.04/16.04 and Debian 8/9 are supported.
easy_ipa::install::client::manual
"Manual" configuration of hosts which don't have the freeipa-client package.
easy_ipa::install::server
Manage IPA server install
easy_ipa::install::server::master
Manage primary server
easy_ipa::install::server::replica
Manage replica install
easy_ipa::install::sssd
Manage sssd install
easy_ipa::monit::server
Monitor FreeIPA server processes using monit
This class depends on puppetfinland-monit module
Parameters
The following parameters are available in the easy_ipa::monit::server
class:
email
Data type: String
Email address to send notifications to. Defaults to top-scope variable $::servermonitor.
Default value: $facts['servermonitor']
easy_ipa::named
fragments.
This is only supposed to work on RHEL/CentOS.
easy_ipa::packetfilter::server
Install packet filtering rules for FreeIPA.
Parameters
The following parameters are available in the easy_ipa::packetfilter::server
class:
allow_address_ipv4
Data type: Variant[Stdlib::IP::Address::V4,Array[Stdlib::IP::Address::V4]]
IPv4 address to allow access from.
Default value: '127.0.0.1'
allow_address_ipv6
Data type: Variant[Stdlib::IP::Address::V6,Array[Stdlib::IP::Address::V6]]
IPv6 address to allow access from.
Default value: '::1'
easy_ipa::params
Traditionally this file would be used to abstract away operating system differences. Right now the main purpose is to prevent easy_ipa classes from causing havoc (e.g. partial configurations) on unsupported operating systems by failing early rather than later.
Defined types
easy_ipa::backup
Backup FreeIPA from cron
Parameters
The following parameters are available in the easy_ipa::backup
defined type:
title
The resource title is used as part of the the name for the cronjob.
type
Data type: Enum['full','data']
Backup type. Either 'full' (offline) or 'data' (online).
timestamp
Data type: Boolean
Keep the default timestamp in the backup directory. Valid values are true (default) and false. Set this to false if you have and external system (e.g. bacula) that fetches the backups periodically and handles versioning on its own.
Default value: true
monthday
Data type: Variant[Array[String], Array[Integer[1-31]], String, Integer[1-31]]
Standard parameter for the cron resource.
Default value: '*'
weekday
Data type: Variant[Array[String], Array[Integer[0-7]], String, Integer[0-7]]
Standard parameter for the cron resource.
Default value: '*'
hour
Data type: Variant[Array[String], Array[Integer[0-23]], String, Integer[0-23]]
Standard parameter for the cron resource.
minute
Data type: Variant[Array[String], Array[Integer[0-59]], String, Integer[0-59]]
Standard parameter for the cron resource
email
Data type: String
Email to send cron notifications to. Defaults to $::servermonitor.
Default value: $facts['servermonitor']
easy_ipa::config::named
Add custom named.conf fragment.
Parameters
The following parameters are available in the easy_ipa::config::named
defined type:
basename
Data type: String
(string) Basename of the configuration fragment, without the ".conf" at the end. Defaults to $title.
Default value: $title
content
Data type: String
(string) The value to pass to the File resource's "content" parameter. For example template('profile/templates/tsig-key.erb').
notify_named
Data type: Boolean
(boolean) Whether to restart named-pkcs11 on config changes. Defaults to false.
Default value: false
easy_ipa::helpers::flushcache
Manage cache flushing
Plans
easy_ipa::update_host_keys
Useful when real keys and keys in IPA device account have gone out of sync, e.g. due to rebuilding the server from a snapshot.
This gets a kerberos ticket from the IPA server first, then gathers the SSH keys from IPA clients from their SSH facts, then runs appropriate "ipa host-mod" commands for each IPA client on the IPA server.
Note that it is assumed that the IPA client host name is equal to the $::fqdn fact.
Parameters
The following parameters are available in the easy_ipa::update_host_keys
plan:
ipa_clients
Data type: TargetSpec
One of more IPA clients whose host keys to puload
ipa_server
Data type: TargetSpec
A host which has the "ipa" tools installed. Not necessarily an IPA server.
ipa_user
Data type: String
An IPA user with permission to run "ipa host-mod".
ipa_password
Data type: String
IPA user's password
noop
Data type: Boolean
If true then only imulate what would be done
Default value: true
What are plans?
Modules can contain plans that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Dependencies
- puppetlabs-stdlib (>= 9.0.0 < 10.0.0)
- puppetlabs-cron_core (>=1.0.0 < 2.0.0)
- puppetlabs-k5login_core (>=1.0.2 < 2.0.0)