Project

General

Profile

Bug #17543

freeipa_register.erb snippet automount fails when providing freeipa_server_server variable.

Added by Marek Hulán over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1399352

note that in following text, idm_ prefix is freeipa_ prefix in upstream template but otherwise it applies to upstream too

Description of problem:

When you set the idm_server parameter on a host it will break the ipa-client-automount with the error "no such option: --domain" This is caused by a reassignment of the host parameter in the snippet to include the --domain option (see additional information)

Version-Release number of selected component (if applicable):
foreman-nightly

How reproducible:
Every time.

Steps to Reproduce:
  1. In the web gui for satellite edit a host, under parameters add a host parameter called idm_server and set the value to an IDM server.
  2. Next add the parameter idm_automount with value of true.
  3. Stage the host build

4. Build the Host
Actual results:
Usage: ipa-client-automount [options]

ipa-client-automount: error: no such option: --domain

Expected results:
successful run of ipa-client-automount

Additional info:
From the Snippet:

<% if @host.params['idm_server'] -%>
<% domain = @host.params['idm_domain'] || @host.realm.name.downcase -%>

idm_server="--server <%= @host.params['idm_server'] > --domain <%=domain %>"
<
end -%>

This code fragment triggers on the parameter being present, and parses the domain name from the parameter value and the --domain switch to idm_server. This needed for this fragment:

usr/sbin/ipa-client-install -w '<%= @host.otp || "$HOST[OTP]" %>' --realm=<%= @host.realm %> -U $idm_mkhomedir $idm_opts $idm_server $idm_ssh

but breaks the ipa-client-automount fragment by using the same modified idm_server parameters:

<% if @host.param_true? 'idm_automount' -%>
if [ -f /usr/sbin/ipa-client-automount ]
then
  /usr/sbin/ipa-client-automount $idm_server $automount_location --unattended
fi
<% end -%>

Since ipa-client-automount does not accept the --domain switch the code breaks. Ipa-client-automount need a unique server parameter or idm_server parameter needs to be handle differently.

Associated revisions

Revision 9c989777 (diff)
Added by Marek Hulán over 3 years ago

Fixes #17543 - fix automount server

History

#1 Updated by Marek Hulán over 3 years ago

  • Subject changed from freeipa_register.erb snippet automount fails when providing freeipa_server_server variable. to freeipa_register.erb snippet automount fails when providing freeipa_server_server variable.
  • Category changed from TFTP to Templates

#2 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Marek Hulán
  • Pull request https://github.com/theforeman/community-templates/pull/320 added

#3 Updated by Marek Hulán over 3 years ago

  • Target version set to 1.10.1

#4 Updated by Anonymous over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 189

Also available in: Atom PDF