#9487 ipa-client-install --automount-location does not work
Closed: fixed a year ago by frenaud. Opened a year ago 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

a year ago

master:

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

ipa-4-11:

  • 6340e88 Fix ipa-client-automount install/uninstall with new install states
  • 1876496 ipatests: Test client install/uninstall with automount enabled
  • 526147e ipa-client-automount: Don't use deprecated ipadiscovery.IPADiscovery

ipa-4-10:

  • d169e92 Fix ipa-client-automount install/uninstall with new install states
  • a2264f4 ipatests: Test client install/uninstall with automount enabled
  • 624e739 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)

a year ago

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

a year ago

Log in to comment on this ticket.

Metadata