Commit Graph

269 Commits

Author SHA1 Message Date
Thomas Woerner
475df2bf5e ipareplica_test: Added ntp_server, ntp_pool and some ntp related tests
ntp_server and ntp_pool are now provided to ipareplica_test. A conflict
test with no_ntp has been added from the normal installer.

Also added are references to options.password and options.dm_password, but
these are commented out and not used or provided to the module.

Proper ntp_servers and ntp_pool tests are needed still.
2019-03-26 13:39:36 +01:00
Thomas Woerner
a441df090b ipareplica_prepare: Use MIN_DOMAIN_LEVEL instead of DOMAIN_LEVEL_1 in checks
With FreeIPA 4.7.0 there is no support for domain level 0 anymore, the
check for the minimal domain level should use MIN_DOMAIN_LEVEL instead of
DOMAIN_LEVEL_1.
2019-03-26 11:42:15 +01:00
Thomas Woerner
1df12a614b ipareplica py3test: Try to import promote_check if install_check is not defined
Since FreeIPA version 4.7.1 there is no install_check defined anymore in
ipaserver.install.server.replicainstall.
2019-03-26 11:38:44 +01: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
3251d0acd4 ipaclient/tasks/install.yml: Removed empty line in ipaclient_setup_sssd section
Removed addtional empty line in ipaclient_setup_sssd sectio
2019-03-26 11:08:12 +01:00
Thomas Woerner
c7fd2cacf3 ipaclient/tasks/install.yml: Removed default(omit) for bool variables
default(omit) is not needed for bool values, as these need to be set either
way.
2019-03-26 11:05:30 +01:00
Thomas Woerner
90b101310a module_utils/ansible_ipa_client: Deactivate __getattr__ in installer_obj
The __getattr__ method in installer_obj was used for debugging to make
sure that all needed settings in the installer object have been set.
2019-03-26 09:56:49 +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
fdb44fc2c4 ipaclient_get_otp: Fix password encoding
Deploying a client with one-time password use was failing in latest tests
using ansible 2.7 and FreeIPA 4.7 because of an encoding problem.
2019-03-25 19:52:40 +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
Thomas Woerner
0a67c03116 Merge pull request #56 from dawud/feature/move_module_utils_to_specific_role
Move module_utils to role specific locations
2019-03-21 13:51:38 +01:00
David Sastre Medina
9504c71214 Move module_utils to role specific locations 2019-02-20 11:05:59 +01:00
Thomas Woerner
a28378396f ipa[server,replica]: Renamed X_no_firewalld to X_setup_firewalld
The use of the _no_ prefix was not good and has been fixed now.

The X_setup_firewalld settings default to yes.
2019-02-12 13:50:07 +01:00
Thomas Woerner
77d0a1067a ipa[server,replica,client]: New setting X_install_packages
With these settings for server, replica and client it is possible to skip
package installation. This is for example useful if the packages are already
installed. The settings default to yes

The setting ipareplica_no_package_install has been removed.
2019-02-12 13:50:04 +01:00
Thomas Woerner
1ba0391f22 Merge pull request #52 from deblasis/master
Fixes #51 upstream
2019-02-12 13:32:40 +01:00
Thomas Woerner
b09e58895f Update README.md 2019-02-11 17:15:38 +01:00
Thomas Woerner
124b9bf9dc Update README.md
New information about requirements, limitations, installation and usage
2019-02-11 17:14:42 +01:00
Alessandro De Blasis
3c952cdb16 Fixes #51 upstream 2019-02-01 13:15:44 +00:00
Thomas Woerner
e6cf0e1578 ipareplica: Make ipaserver_enable_ipa module working for ipareplica role
The ipareplica role is reusing the ipaserver_enable_ipa module. This module
needed some extensions on the server to enable the delayed services and
also to dump DNS configuration (see commit a128726).
For replica it is not needed to dump the DNS configuration, therefore it is
simply possible to set detup_dns to no to make this module also working
for ipareplica.
2018-11-26 15:56:00 +01:00
Thomas Woerner
b39fa3b738 ipareplica: Fix typo in tasks/install.yml
This typo has been introduced with 20d25d0 in import_tasks for the
Python 2/3 test.
2018-11-23 16:27:36 +01:00
Thomas Woerner
36c7e0e122 ipaserver_setup_custodia: options.promote needs to be set
The use of custodiainstance.get_custodia_instance requires that
options.promote exists. As this is a server installation, promote
is set to False.
2018-11-22 16:29:34 +01:00
Thomas Woerner
20d25d0d43 Replace deprecated include with import_tasks and include_tasks
As the old way to include tasks is deprecated, replace static include
statements with import_tasks and dynamic ones with include_tasks.

Increaded the required ansible version to 2.5.0 to make sure that
include_tasks and import_tasks is working as expected.

Fixes issue #38
2018-11-22 16:26:58 +01:00
Thomas Woerner
6910d99fc9 ipaserver: Fix NameError: name 'api_Backend_ldap2_connect' is not defined
ipaserver_setup_adtrust was using api_Backend_ldap2_connect instead of
api_Backend_ldap2 with attribute connect set to True.

Fixes issue #39
2018-11-22 15:39:41 +01:00
Thomas Woerner
cd96c8a07c ipaserver: Transform DNS overlap end_play into a failure
This is more like the normal installer behavior and should also help with
issue #50: https://github.com/freeipa/ansible-freeipa/issues/50
2018-11-22 15:27:12 +01:00
Thomas Woerner
785cff9a0e ipaserver: Fix use of subject_validator in ipaserver_test
subject_validator and also VALID_SUBJECT_ATTRS are provided of the ca
binding.

Fixes issue #43
2018-11-22 12:36:20 +01:00
Thomas Woerner
0ee92a5ab3 Revert "ipareplica: Limit the number of concurrent executions for the setup of CA"
This reverts commit 7a76f73bc4.

It needs to be done as ansible 2.7.1 is now complaining on unknown attribues.

This fixes issue #48: https://github.com/freeipa/ansible-freeipa/issues/48
2018-11-22 12:00:54 +01:00
Thomas Woerner
a128726567 ipaserver: Delay enabling services until end of installer
Service entries in cn=FQDN,cn=masters,cn=ipa,cn=etc are no longer
created as enabled. Instead they are flagged as configuredService. At
the very end of the installer, the service entries are switched from
configured to enabled service.

This is related to freeipa upstream commit:

Delay enabling services until end of installer:
  https://github.com/freeipa/freeipa/commit/7284097
2018-11-22 11:51:36 +01:00
Thomas Woerner
73b0505299 ipaserver: Use Custodia instance in installers and setup before CA
Custodia is configured before CA and used in the setup of CA. Also add
support for name FIRST_MASTER as a replacement for MASTER_PEER.

This is related to the freeipa upstream commits:

Use single Custodia instance in installers:
  https://github.com/freeipa/freeipa/commit/994f71a
Rename CustodiaModes.STANDALONE to CustodiaModes.FIRST_MASTER:
  https://github.com/freeipa/freeipa/commit/842cb5f
2018-11-22 11:51:08 +01: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
b2583f7078 Ubuntu support added (partly pick from pyguy)
This is a partly pick of the changes done by pyguy for pull request #28.
The unrelated changed on inventory files have been removed and the change
to the README has been adapted to use the "Supported Distributions" section.

The original commits by pyguy in https://github.com/pyguy/ansible-freeipa
are:

commit 1ed1fa845eafd69432b1fd1fc8e5329e4991e84a
Author: pyguy <hr.josheghani@gmail.com>
Date:   Mon Jun 25 17:17:31 2018 +0430

    Ubuntu Support added

commit 9a4a7c84e4af20af27e814aba4fc2c6b8b35ec0f
Author: pyguy <hr.josheghani@gmail.com>
Date:   Sun Jun 24 10:58:07 2018 +0430

    Ubuntu support added
2018-07-23 11:07:23 +02:00
Thomas Woerner
7a76f73bc4 ipareplica: Limit the number of concurrent executions for the setup of CA
There is a pull request and also a proposal for ansible be able to limit the
number of concurrent executions for a single task:

- https://github.com/ansible/proposals/issues/129
- https://github.com/ansible/ansible/pull/42528

The keyword is currently named max_concurrent, but might be renamed later
on. If the keyword is present, but not supported by ansible, it will be
simply ignored. Therefore there is no issue right now with adding in here
early.
2018-07-19 14:30:18 +02:00
Thomas Woerner
9264187173 ipareplica: Use ipaclient role to deploy client
The ipaclient role is now used instead of ipa-client-install.
2018-07-19 14:19:08 +02:00
Thomas Woerner
915cc39b31 ipaclient,ipareplica: Set ipaclient_ssh_trust_dns to no by default 2018-07-19 14:15:47 +02: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
e6cd47bcce ipa-krb5/tasks/main.yml: Create additional .ipabkp for krb5.conf
This is done in IPAChangeConf.changeConf and IPAChangeConf.newConf
2018-07-19 14:10:01 +02:00
Thomas Woerner
1b2f6d7e8b ipaclient: Set default_domain in krb5.conf in the same way as ipa-client-install
Set default_domain if not ipadiscovery.dnsok or not ipadiscovery.kdc like it
is done in ipa-client-install.
2018-07-19 13:00:39 +02:00
Thomas Woerner
0154f36a69 Added ipa- prefix to krb5 and sssd roles as these are ansible-freeipa specific
These roles will most likely not work in the common case. Therefore the roles
have been renamed.

The ipa-krpb5 role is used by ipcalient, but the ipa-sssd role is currently
not used.
2018-07-19 12:58:30 +02:00
Thomas Woerner
eced45bb53 ipareplica/library/ipareplica_custodia_import_dm_password: Fix post 4.7 use
custodiainstance.import_dm_password does not support master_host_name post
4.6.90 anymore. A new inspect call has been added to verify if the arg is
supported or not.
2018-07-17 13:49:10 +02:00
Thomas Woerner
70f756fd83 New REPLICA.md file 2018-07-09 13:58:28 +02:00
Thomas Woerner
b26d366732 ipareplica/library/ipareplica_custodia_import_dm_password: Also use custodia here
custodia needs to be used here with newer IPA versions (introduced with 4.6.4).
With this master_host_name does is not supplied to custodia.import_dm_password
as an arguemtn anymore.
2018-07-09 13:48:03 +02:00
Thomas Woerner
f69c13cfd6 ipareplica: Do no use IPA version to check for get_custodia_instance existance
The use of IPA versions to determine if get_custodia_instance should be
used was not optimal as the patch that introduced this has been back-ported
to the EL-7 package with verion 4.5.4. As get_custodia_instance was not
available before we can simply check if get_custodia_instance exists in
custodiainstance.
2018-07-09 13:47:09 +02:00