Commit Graph

34 Commits

Author SHA1 Message Date
Brant Evans
34ce174d55 Fix errors when ipaservers variable is not set 2019-05-08 16:08:24 -06:00
Thomas Woerner
9148dde50a ipaclient_setup_nss: Create DNS SSHFP records, update to latest FreeIPA
There have been several settings in ipaclient_setup_nss that have been
hard coded instead of using the settings from the role. This has been
fixed and the code in ipaclient_setup_nss has been updated to the latest
version of FreeIPA with compatibility changes for older FreeIPA versions.
Additionally the api is now properly configured so that the DNS SSHFP
records are now properly created if no_dns_sshfp is not enabled.
2019-04-26 13:13:43 +02:00
Thomas Woerner
c18b777141 ipaclient_setup_ntp: Fixed NTP config for FreeIPA versions without sync_time
The old name ntpconf has been still used in one place of the NTP
configuration for FreeIPA versions that do not provide the sync_time
function.

Fixes: #76 (Ansible Configure NTP Task)
2019-04-26 12:50:34 +02:00
Thomas Woerner
81916b4528 ipaclient_api: Do not use version numbers for backward compatibility checks
The use of version numbers for backward compatibility checks is not
optimal because the version number is not changed if changes are back
ported. The version dependant check has been replaced with an inspect
argspec check.
2019-04-26 11:53:33 +02:00
Thomas Woerner
7a617281d7 ipaclient_setup_sssd: Use proper setting for no_krb5_offline_passwords
options.no_krb5_offline_passwords was set using the not existing role
variable krb5_offline_passwords instead of no_krb5_offline_passwords.
2019-04-26 11:51:06 +02:00
Thomas Woerner
2cffd6ebf9 ipaclient_setup_ntp: Use time sync code from 4.6.4 if sync_time is not defined
The FreeIPA versions since 4.7.0 are using chrony and also the new
sync_time function for time synchronization which has been added to
ipaclient/install/client.py.

The old version in ipaclient_setup_ntp has been updated to the code that
has been used in 4.6.4.
2019-04-17 14:36:50 +02:00
Thomas Woerner
cdc431ff92 ipa[client,replica,server]: Make sure that installer logs are created
The installer logs have not been created using the ansible ipaclient,
ipareplica and ipaserver roles. This has been fixed and the installer
logs are created now. This is a new and fixed version of 2113c79 where
verbose mode is turned off.
2019-04-16 14:50:55 +02:00
Thomas Woerner
658f830970 ipaclient_setup_ntp: Add missing cli_servers, fix options.ntp_servers check
cli_servers from ipaclient_test was missing in ipaclient_setup_ntp. This
resulted in a backtrace and is fixed now. Fix options.ntp_servers check
to not use length on NoneType.
2019-04-05 19:09:08 +02:00
Thomas Woerner
0b5b5756c7 Revert "ipa[client,replica,server]: Make sure that installer logs are created"
The call of standard_logging_setup results in verbose and debug output in
the ansible modules. This needs to be done in an altenative way.

This reverts commit 2113c79111.
2019-04-05 18:12:07 +02:00
Thomas Woerner
15f650ccaa ipaclient: Fix issues with FreeIPA 4.6 and prior
check_ldap_conf is only available in FreeIPA 4.7 and later and
tasks.is_nosssd_supported is only available since 4.6.90.pre2.

check_ldap_conf is None (ansible_ipa_client) if it can not be imported.
hasattr has been added to check if is_nosssd_supported is a valid
attribute in tasks.

Fixes: #61 (ipaserver role - Fails on ipaclient install)
2019-04-04 17:28:37 +02:00
Thomas Woerner
818db5cb4d ipa[client,server]: Inspect validate_domain_name for 4.6 and prior
The entity argument for validate_domain_name is only available in
FreeIPA 4.7 and later. This has been fixed using inspect to be able to
detect if entity is a valid argument. If not the whole realm name check
is skipped.

Related: #61 (ipaserver role - Fails on ipaclient install)
Fixes: #66 (Python 2 error with validate_domain)
2019-04-04 17:20:15 +02:00
Thomas Woerner
2113c79111 ipa[client,replica,server]: Make sure that installer logs are created
The installer logs have not been created using the ansible ipaclient,
ipareplica and ipaserver roles. This has been fixed and the installer
logs are created now.
2019-04-03 14:20:18 +02:00
Thomas Woerner
059eae4717 ipaclient_test: Added error message to ScriptError calls only using rval
The use of ScriptError without an error message but with rval resulted in
very limited information in ansible. The error messages from logger.error
calls have have added to these ScriptError raises.
2019-03-26 11:34:07 +01:00
Thomas Woerner
314010c043 ipaclient_test: Remove debugging warning output
A remain from debugging in ipaclient_test has been removed.
2019-03-26 09:43:11 +01:00
Thomas Woerner
a6ee0d0756 ipaclient: End install if already installed and no allow_repair and force_join
If the client is already installed and the allow_repair and force_join
options are not set end the playbook processing. This is useful if an
inventory file contains existing and new machines.
2019-03-25 19:51:58 +01:00
Thomas Woerner
099317fe9c New ipaclient_setup_krb5: Use ipaclient_setup_krb5 instead of ipa-krb5 role
The advantage of this is that the krb5 configuration is created in the same
way as in the normal installers. The same functionality as in the normal
installers is used in ipaclient_setup_krb5. There is no need to adapt the
ipa-krb5 role or the the ask file for changes in how the krb5 configuration
is done. Additionally ipaclient_force is now a supported parameter as
it is in the normal installer.

New config option:

ipaclient_force

The variable has been added to ipaclient/defaults/main.yml.
2019-03-25 16:53:32 +01:00
Thomas Woerner
b942661788 New ipaclient_ipa_conf: Use ipaclient_ipa_conf instead of ipaconf role
The advantage of this is that the ipa default configuration is created in
the same way as in the normal installers. The same functionality as in the
normal installers is used in ipaclient_ipa_conf.
2019-03-25 16:48:29 +01:00
Thomas Woerner
d0ba53153e ipaclient_setup_ssh: Keep no_ for prefix for settings, use ssh_trust_dns
The no_ prefix for the ssh and sshd settings has been added back. The
naming of the settings should be the same all over the ipcalient role.
The exception is sssd here as it has been deprected and is used from
ipaclient_test.

The name for the setting ssh_trust_dns has been fixed to the command line
option name and not the internl optinos name.
2019-03-25 15:04:36 +01:00
Thomas Woerner
2983d4e7b3 ipaclient_setup_sssd: Update and cleanup
ipaclient_setup_sssd is now using configure_sssd_conf from
ipaclient/install/client.py instead. This simplified the module a lot
and also adds more configuratino options for sssd.

These are new config options supported by ipaclient_setup_sssd:

ipaclient_no_sudo
ipassd_fixed_primary
ipassd_permit
ipassd_enable_dns_updates
ipassd_no_krb5_offline_passwords
ipassd_preserve_sssd

These variables have been added to ipaclient/defaults/main.yml.
2019-03-25 14:04:34 +01:00
Thomas Woerner
c5ce754850 ipaclient_test: More tests from ipaclient installer, updated ansible_ipa_client
The ipaclient_test module was not doing all tests that should be done
with the provided settings. All tests from ipaclient installer parts
are now part of ipaclient_test. There are some minor changes though to
make sure that the repair mode could still be used.

ansible_ipa_client bindings have been updated to fullfill new needs.
2019-03-25 13:56:18 +01:00
Thomas Woerner
bf1f8bff5c ipaclient/library/ipaclient_setup_ntp: Fix import of ansible_ipa_client
The import line of ansible_ipa_client was not correct and used a test
version of the binding that is not possible anymore due to the move of
the module_utils directories into the specific role locations.
2019-03-25 13:33:36 +01:00
Thomas Woerner
61862820e0 ipaclient: New module ipaclient_setup_ntp, dropped ipaclient_ntp setting
The new module ipaclient_setup_ntp to configure and sync time with the NTP
server has been added. The irregular setting ipaclient_ntp has been removed.

The ipaclient_setup_ntp module is using either the new sync_time call or
for compatibility with older FreeIPA versions synconce_ntp.

The reference for ipaclient_ntp in REPLICA.md has been removed also.

This also fixes #55.
2019-03-21 18:20:50 +01:00
Thomas Woerner
4b2fc33b35 ipaclient: Replace extras module with ssh, automount, firefox and nis modules
ipaclient_extras could configure several things internally according to
provided settings. These have been ssh, sshd, automount, firefox an also
nis. The ssh and sshd configuration is now plocated in ipaclient_setup_ssh,
the automount configuration in ipaclient_setup_automount, the firefox
configuration in ipaclient_setup_firefox and the nis configuration in
ipaclient_setup_nis.

The following additional settings have been added to
roles/ipaclient/defaults/main.yml to provide the same configruation options
as ipa-client-install does:

ipaclient_no_ssh: no
ipaclient_no_sshd: no
ipaclient_no_nisdomain: no
ipaclient_configure_firefox: no
2019-03-21 15:26:40 +01:00
Thomas Woerner
7c378d9c4d ipaclient role: Fix naming of modules, action_plugins and registered vars
The naming in the ipaclient role has not been following the naming scheme
and conventions used in the ipaserver and ipareplica roles. Also registered
results of modules and commands have not been unsing the result_ prefix as
in the other roles. All this has been fixed and the naming is consistent
now.

These are the renames:

ipahost -> ipaclient_get_otp
ipaapi -> ipaclient_api
ipaextras -> ipaclient_extras
ipafixca -> ipaclient_fix_ca
ipafstore -> ipaclient_fstore
ipa_facts -> ipaclient_get_facts
ipahost -> ipaclient_get_otp
ipajoin -> ipaclient_join
ipanss -> ipaclient_setup_nss
ipasssd -> ipaclient_setup_sssd
ipadiscovery -> ipaclient_test
ipatest -> ipaclient_test_keytab
2019-03-21 13:52:34 +01:00
Alessandro De Blasis
3c952cdb16 Fixes #51 upstream 2019-02-01 13:15:44 +00:00
Thomas Woerner
dc0d1fc196 ipaclient: Fix gathering of subject_base from server in ipaapi.py module
The api command to get the server config is failing with more recent
freeipa versions. Therefore another way to gather the server config using
api.Backend.rpcclient.forward has been added in case the first version
fails.

The new code is from freeipa commit 8af6accfa5734a7e9a7c92fcf38d5440482413d4
(https://github.com/freeipa/freeipa/commit/8af6accf)
2018-11-21 17:13:15 +01:00
Thomas Woerner
695d09aa69 ipaclient: Backup and set hostname explicitly
This is needed to use ipaclient in ipareplica for client deployment.
2018-07-19 14:14:45 +02:00
Thomas Woerner
34fe6103db ipaclient/library/ipanss.py: Fixed wrong name in paths.GETENT compat check
The paths.GETENT compat check was using "KDESTROY" instead of "GETENT".
2018-06-28 17:32:07 +02:00
Ian Tewksbury
d6ff55d8c6 ipadiscovery.py - fix typo of timconf to timeconf 2018-06-27 14:23:46 -04:00
Thomas Woerner
1ed9379c9c ipaclient: Fix OTP action plugin to work with python3 bindings
As the action plugin is used with the default python interpreter and
the change to python3 for FreeIPA, the use of OTP was not working anymore.

The ansible_python_interpreter is not automatically used for the module
part of the action plugin. Therefore ansible_python_interpreter needed to
be added to the action plugin call as a new var to make sure that the
module part is used with the proper python version.

Also a new import for the Python2/3 import test has been added to discover
of the server is supporting python2 or python3. The old
ansible_python_interpreter setting is saved before doing this and restored
after the one-time password has been generated on the server.
2018-06-21 13:08:44 +02:00
Thomas Woerner
4063b6caa3 ipaclient: Add support for IPA 4.7 (4.6.90-pre2)
With IPA 4.7 bigger changes have been introduced

Changes:
- Use of timeconf and chrony instead of ntpconf and ntpd.
- A new option ntp_pool has been introduced.
2018-06-21 13:04:32 +02:00
Thomas Woerner
2d6c9bb381 ipaclient/library/ipa_facts.py: Fix version_info for new pre versions
With 4.6.90 pre versions have been introduced. The version parsing in
ipa_facts broke with this as it did not know about pre versions so far.
2018-06-21 12:52:10 +02:00
Thomas Woerner
285790231a ipaclient: Use paths variables for executables used in modules
paths.KDESTROY instead of "kdestroy" and paths.GETENT instead of "getent"

Affected modules:
  roles/ipaclient/library/ipahost.py
  roles/ipaclient/library/ipajoin.py
  roles/ipaclient/library/ipanss.py
2018-06-21 12:48:24 +02:00
Thomas Woerner
1ecc194ca6 ipclient: Move library and action_plugins into ipaclient role directory
The directories library and action_plugins do only contain ipaclient specific
modules and plugins. Therefore these directories should be located in the
ipaclient role directory.
2018-06-21 11:34:50 +02:00