Commit Graph

144 Commits

Author SHA1 Message Date
Thomas Woerner
813d5bbf97 ipaclient_get_otp: Remove ansible_python_interpreter handling
With the deactivation of the Python2/3 test the handling of
ansible_python_interpreter needs to be removed as the setting might
not exist and is not changed in with the Python2/3 test any more.
2019-06-12 11:06:38 +02:00
Thomas Woerner
9a53e71de8 ipaclient_test: Use validate_hostname with constants.MAXHOSTNAMELEN
Run validate_hostname to check for valid host name if constants.MAXHOSTNAMELEN
is defined. The call has not been used in older FreeIPA versions.
2019-06-07 17:25:12 +02:00
Thomas Woerner
c82867585b Increase minimal Ansible version to 2.8
ansible-freeipa is a new Ansible Collection introduced with Ansible 2.8 and
Ansible Galaxy 3.2.
2019-06-05 17:55:21 +02:00
Thomas Woerner
c822423b14 Move role documentation into the specific role locations as README.md
This will result in a better role documentation on galaxy.
2019-06-05 16:38:12 +02:00
Thomas Woerner
b51397eb89 ipa[server,replica,client]: Deactivate Python2/3 test
This test is not properly working with EL-8 nodes as the default system
python is not located in /usr/bin. Additionally Ansible 2.8 is able to
detect the default python version on the system. As the installation
base for IPA 4.5.90 where the Python 3 bindings have not been working
properly should be really small or not existing any more the deactivation
of this test should be fine.
2019-06-04 11:58:52 +02:00
Thomas Woerner
9397776501 ipaclient/tasks/install.yml: Save and restore ipaadmin_password with OTP
The generated OTP password is stored into ipaadmin_password. The original
password is now saved and restored later on again.

This fixes the failure with incorrect password while installing the client
part in a replica deployment.
2019-05-31 17:22:56 +02:00
Thomas Woerner
be04079fc7 ipaclient/tasks/install.yml: Disable One-Time Password for on_master
if _on_master is set, deactivate _get_otp as OTP is not needed at all
for the client side install part on a master.
2019-05-31 17:21:26 +02:00
Thomas Woerner
5bdaa9aa6f ipaclient/action_plugins/ipaclient_get_otp: Only require gssapi for keytab
gssapi is only needed for OTP if keytab is used. The common case with
password does not require gssapi.

This change also fixes the new ansible 2.8 failure if gssapi is not
installed on the controller. Ansible 2.8 seems to also transfer and load
action plugins to the node if they are not used.
2019-05-31 17:19:05 +02:00
Thomas Woerner
bdf3ad4a9c Merge pull request #81 from spoore1/length_fix
ipaclient install role length typo
2019-05-31 16:39:30 +02:00
Scott Poore
e0c85c5af4 ipaclient install role length typo
Correcting small typo for lenth to length in a check
2019-05-13 11:07:06 -05:00
Brant Evans
34ce174d55 Fix errors when ipaservers variable is not set 2019-05-08 16:08:24 -06:00
Thomas Woerner
93f9b900c6 ipaclient: Replace empty string test with length 0 test 2019-05-03 19:07:42 +02:00
Thomas Woerner
e5be194d57 ipaclient: Fix indent in install.yml 2019-05-03 18:45:01 +02:00
Thomas Woerner
65fb75feaf ipaclient: Calm down ansible and yaml lint in ansible-galaxy 2019-05-03 18:37:22 +02:00
Thomas Woerner
8c77c34d5f ipa[server,replica,client]: Update galaxy info
Dependencies and platforms have been updated. Commented out lines has been
removed.
2019-05-03 17:37:32 +02:00
Thomas Woerner
12006859d9 Fix white space issues in yaml files and ansible vars 2019-05-03 17:36:52 +02: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
4d759b64ab Revert "ipa[server,replica,client]: Do not enforce ansible_fqdn as hostname"
This reverts commit bbaaf1f74c.
2019-04-18 17:56:14 +02:00
Thomas Woerner
0954f84572 ipa[server,replica,client]: Do not use meta end_play
Meta end_play has been used as a simple solution to end the playbook
processing in special conditions, like for example when the deployment
was already done before.

meta end_play has been replaced with blocks and conditions for these
blocks.

Fixes: #70 (Avoid using meta end_play)
2019-04-17 15:08:36 +02:00
Thomas Woerner
bbaaf1f74c ipa[server,replica,client]: Do not enforce ansible_fqdn as hostname
The ansible_fqdn hostname has been enforced to be set and used in
ipaserver, ipareplica and also ipaclient role. This has been removed as
the hostname should only be set if specified explicitly with
ipa[server,replica,client]_hostname.
2019-04-17 15:06:23 +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
de039aa0c8 ipaclient: Use ipaclient_all_ip_addresses instead of ipahost_all_ip_addresses (2)
This setting had the wrong and unsed prefix ipahost. THis has been fixed and
the proper prefix ipaclient is now used.

The change in ipaclient/defaults/main.yml was missing from the first commit
b5d6dc00d2
2019-04-03 21:30: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
b5d6dc00d2 ipaclient: Use ipaclient_all_ip_addresses instead of ipahost_all_ip_addresses
This setting had the wrong and unsed prefix ipahost. THis has been fixed and
the proper prefix ipaclient is now used.
2019-04-03 14:17:16 +02:00
Thomas Woerner
07a97cb83f ipaclient: Krb5 should only be configured if ipaclient_on_master is not set
Krb5 configuration was also done if ipaclient_on_master was set. This
resulted in a reverted configuration while deploying the client part in
a server deploment.
2019-04-03 14:08:45 +02:00
Thomas Woerner
4557292743 ipa[server,replica,client]: Do not try to execute tasks after the role test
The role test is executed in the ipa[server,replica,client] roles first.
These tests are usable in the Ansible test mode, but the folllowing steps
in the task list are not. Therefore the blocks following the tests are
limited to not being executed in test mode.
2019-03-26 14:22:26 +01:00
Thomas Woerner
82588026bf python_2_3_test: Make sure that python_2_3_test is also executed in test mode
python_2_3_test needs to be executed also in test mode to make sure that the
follwing ipa[server,replica,client]_test modules could be executed also in
test mode.
2019-03-26 14:19:56 +01:00
Thomas Woerner
7ce09b2cc9 python_2_3_test: Add result_ prefix to registered result from py3test.py script
For consitency the result_ prefix has been added to the registered result
of the py3test.py script.
2019-03-26 14:03:31 +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