Simon Matthews via FreeIPA-users wrote:
The Redhat documentation provides a script for importing automount
maps. The script also uses ldapadd to add some data into the LDAP server. This part
doesn't appear to work. It's not clear to me that this part needs to work.
The part of the script is:
basedn=$(ipa env basedn | tr -d '[:space:]' | cut -f2 -d:)
cat > /tmp/amap.ldif <<EOF
dn: nis-domain=$2+nis-map=$4,cn=NIS Server,cn=plugins,cn=config
objectClass: extensibleObject
nis-domain: $2
nis-map: $4
nis-base: automountmapname=$4,cn=$1,cn=automount,$basedn
nis-filter: (objectclass=*)
nis-key-format: %{automountKey}
nis-value-format: %{automountInformation}
EOF
ldapadd -x -h $3 -D "cn=Directory Manager" -W -f /tmp/amap.ldif
Apart from the fact that $3 is probably the wrong variable (it points to the hostname of
the NIS server, which is likely different), when I try to run it, I get:
ldapadd -x -D "cn=Directory Manager" -W -f /tmp/amap.ldif
Enter LDAP Password:
adding new entry "nis-domain=blue+nis-map=auto.home,cn=NIS
Server,cn=plugins,cn=config"
ldap_add: No such object (32)
The file /tmp/amap.ldif contains:
dn: nis-domain=blue+nis-map=auto.home,cn=NIS Server,cn=plugins,cn=config
objectClass: extensibleObject
nis-domain: blue
nis-map: auto.home
nis-base:
automountmapname=auto.home,cn=default,cn=automount,dc=ipa,dc=bluepearlsoftware,dc=com
nis-filter: (objectclass=*)
nis-key-format: %{automountKey}
nis-value-format: %{automountInformation}
["blue" is my NIS domain].
Assuming that you want IPA to provide maps over NIS as you transition
away from it, you need to enable the plugin with: ipa-nis-manage enable
Then restart dirsrv. ipactl restart is probably the easiest way to do that.
Then the ldif should load.
rob