Bug 56000 - Network module ignores predefined values for computer objects
Network module ignores predefined values for computer objects
Status: NEW
Product: UCS
Classification: Unclassified
Component: UMC - Networks
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-04-20 17:06 CEST by Mirac Erdemiroglu
Modified: 2023-05-22 13:54 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023040421000331
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mirac Erdemiroglu univentionstaff 2023-04-20 17:06:25 CEST
UCS: 5.0-3 errata642

If an administrator wants to create a computer object with a json file via the import of the RestAPI, predefined values of the json file are not considered and overwritten, because when selecting a predefined network, the network mapping module is triggered. Thus the computer object gets a free IP from the network and among other things, "dnsEntryZoneForward" and "dnsEntryZoneReverse" entries are overwritten.
The same applies, of course, if the computer object is created via the UMC.
The assignment of a computer object to a network is used in various places for administrators, for example, to clearly determine which subnet a device is assigned to.
Leaving the assignment of the IP address, DNS and DHCP entries to the automation behind the assignment to a network is not a good option for some administrators, because the expectation at this point would be that the automatic assignment of IP address, DNS and DHCP entries does not take effect if they are already defined in the JSON object. The same is true for 'fqdn' and 'domain' by the way.
Comment 1 Stefan Gohmann univentionstaff 2023-05-13 07:36:31 CEST
Workaround which allows to set the network during the windows computer creation:

## Create Network API Hook
cat <<_EOL_ > /usr/local/share/network-api-udm-hook.py
# -*- coding: utf-8 -*-
import univention.debug
from univention.admin.hook import simpleHook

class NetworkAPIHook(simpleHook):
    def hook_ldap_addlist(self, module, al=[]):
        for a in al:
            if a[0] == 'univentionFreeAttribute18':
                al.append(('univentionNetworkLink', a[1], a[2]))
        return al
_EOL_

## Register Network API Hook

. /usr/share/univention-lib/ldap.sh
ucs_registerLDAPExtension \
  --packagename network-api \
  --packageversion 1.0 \
  --udm_hook /usr/local/share/network-api-udm-hook.py \
  --ucsversionstart 5.0-0 \
  --ucsversionend 5.9-99


## Create Extended Attribut

udm settings/extended_attribute create \
--position "cn=custom attributes,cn=univention,$(ucr get ldap/base)" \
--set name=network-api \
--set CLIName=network-api \
--set copyable=0 \
--set disableUDMWeb=1 \
--set doNotSearch=1 \
--set hook=NetworkAPIHook \
--set ldapMapping=univentionFreeAttribute18 \
--set mayChange=1 \
--set module=computers/windows \
--set multivalue=0 \
--set notEditable=0 \
--set objectClass=univentionFreeAttributes \
--set shortDescription=Network-API \
--set syntax=network \
--set valueRequired=0