#9487 ipa-client-install --automount-location does not work
Closed: fixed by frenaud. Opened by cheimes.

Issue

ipa-client-install --automount-location=location should configure a host for automount of e.g. NFS home directories. However the option does not work. Automount configuration always fails because the automount tool thinks that the system is not (yet) an IPA client.

Steps to Reproduce

  1. Install an IPA client with ipa-client-install --automount-location=default

Actual behavior

System is not configured for automount. ipa-client-install does not fail either. Instead it ignores the error and logs the error to the ipaclient install log.

Configuring automount:
2023-11-28T12:24:12Z DEBUG Starting external process
2023-11-28T12:24:12Z DEBUG args=['/usr/sbin/ipa-client-automount', '--debug', '-U', '--location', 'default']
2023-11-28T12:24:13Z DEBUG Process finished, return code=2
2023-11-28T12:24:13Z DEBUG stdout=IPA client is not configured on this system
2023-11-28T12:24:13Z DEBUG stderr=
2023-11-28T12:24:13Z ERROR Automount configuration failed: CalledProcessError(Command ['/usr/sbin/ipa-client-automount', '--debug', '-U', '--location', 'default'] returned non-zero exit status 2: '')

Expected behavior

ipa-client-install successfully configures a system for automount.

Version/Release/Distribution

ipa-client-4.10.2-4.el9_3.1.x86_64

Additional info:

Any additional information, configuration, data or log snippets that is needed for reproduction or investigation of the issue.

Log file locations: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Linux_Domain_Identity_Authentication_and_Policy_Guide/config-files-logs.html
Troubleshooting guide: https://www.freeipa.org/page/Troubleshooting


Problem:
- ipa-client-automount checks the installation state of the host and fails if the current host is not an IPA client
- ipa-client-install sets the installation state after it runs ipa-client-automount, https://github.com/freeipa/freeipa/blob/60fe752da468e84a642af51090b27468446606f7/ipaclient/install/client.py#L3307-L3340

The simplest fix for the problem is to move configure_automount(options) after statestore.backup_state('installation', 'complete', True).

That could work. We'd need special handling to ensure that in the unlikely case the embedded ipa-client-automount call failed it would fail the entire client install.

The uninstall has the same issue if executed with ipa-client-install --uninstall. Things are left over in the sysrestore state file because the uninstall exits early because it thinks the client is not configured.

Metadata Update from @rcritten:
- Issue assigned to rcritten

https://github.com/freeipa/freeipa/pull/7100

master:

  • e4420624ffed47c42b3bd0dfd580cd98f667e843 Fix ipa-client-automount install/uninstall with new install states
  • ce811db6be532a9f258d7429234028975eb99f50 ipatests: Test client install/uninstall with automount enabled
  • 54fb1173f9ab1025c12a77b3a5bf205afa8f63e2 ipa-client-automount: Don't use deprecated ipadiscovery.IPADiscovery

ipa-4-11:

  • 6340e88341b09b06391b35e50e8c4d7619b12dab Fix ipa-client-automount install/uninstall with new install states
  • 18764964b72ba237eba5f7b1078185b2f0393d72 ipatests: Test client install/uninstall with automount enabled
  • 526147ec9362124191a54c9ae8debd0234af3d49 ipa-client-automount: Don't use deprecated ipadiscovery.IPADiscovery

ipa-4-10:

  • d169e92b0960a09556a23736eee35223f107809f Fix ipa-client-automount install/uninstall with new install states
  • a2264f4738de23b950dcafd419316e1e12fe6dfe ipatests: Test client install/uninstall with automount enabled
  • 624e73912893b011e601a32fa7702d7af30905a3 ipa-client-automount: Don't use deprecated ipadiscovery.IPADiscovery

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://issues.redhat.com/browse/RHEL-21810

Metadata