In order to install in non-interactive mode plugin ( in ansible task for instance) Avoid this :
root@bullseye:/home/vagrant# fusiondirectory-plugins-manager --install-plugin . Available plugins: 1: fusiondirectory-plugins-document
It's should be interesting to get a feature for installing plugin automaticaly like :
fusiondirectory-plugins-manager --install-plugin ./fusiondirectory-plugins-document/contrib/yaml/description.yaml
which install the document plugin without interaction.
on fresh install on debian bullseye :
I follow : https://fusiondirectory-user-manual.readthedocs.io/en/1.4/fusiondirectory/install/debian/debian-fd-install.html#fusiondirectory-schema-setup see :
root@bullseye:/home/vagrant# fusiondirectory-schema-manager --insert-schema /etc/ldap/schema/core-fd.schema Insertion failed: fopen(/etc/ldap/schema//etc/ldap/schema/core-fd.schema): failed to open stream: No such file or directory Operation aborted
Correct command should be :
root@bullseye:/home/vagrant# fusiondirectory-schema-manager --insert-schema ./fusiondirectory/core-fd.schema Schema /etc/ldap/schema/./fusiondirectory/core-fd.schema inserted as cn=core-fd,cn=schema,cn=config
With fd#6196 we must provided a correct definition a control.yaml file Current definition could be used :
I tried with a more complicated JSON :
{
"attrs": {
"componentGeneric": {
"cn": "TST-DEVICE",
"description": "Description device"
},
"interfacesManagement": {
"networkInterfaces": {
"cn": "eth0",
"ipHostAddress": ["1.1.1.1"],
"macAddress": "AA:BB:CC:DD:EE:FF"
}
}
}
}
CURL command :
curl -X POST "<URL>/rest.php/v1/objects/component" -H "accept: application/json" -H "Session-Token: TOKEN" -H "Content-Type: application/json" -d "{\"attrs\":{\"componentGeneric\":{\"cn\":\"TST-DEVICE\",\"description\":\"Description device\"},\"interfacesManagement\":{\"networkInterfaces\":{\"cn\":\"eth0\",\"ipHostAddress\":[\"1.1.1.1\"],\"macAddress\":\"AA:BB:CC:DD:EE:FF\"}}}}"
Result :
can't parse JSON. Raw result:
Error while Remote Objects[{"class":"TypeError","message":"Argument 3 passed to ListingEntry::__construct() must be of the type string, null given, called in /usr/share/fusiondirectory/plugins/admin/systems/interfaces/class_interfacesManagementFilter.inc on line 112","line":50,"file":"/usr/share/fusiondirectory/include/management/class_ListingEntry.inc"}]
Unable to add a component trough Web Service
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
ii fusiondirectory 1.4-163130 all
ii fusiondirectory-plugin-webservice 1.4-163130 all webservice plugin for FusionDirectory
ii php 2:7.3+69
from debian repository and entreprise fd repository
curl -X POST "<URL Server>/rest.php/v1/objects/component" -H "accept: application/json" -H "Session-Token: <token>" -H "Content-Type: application/json" -d "{\"attrs\":{\"componentGeneric\":{\"cn\":\"TST-DEVICE\",\"description\":\"Description\",\"ipHostNumber\":\"1.1.1.1\"}}}"
JSON :
{
"attrs": {
"componentGeneric": {
"cn": "TST-DEVICE",
"description": "Description",
"ipHostNumber" : "1.1.1.1"
}
}
}
Expected behavior:
a simple device should be created
Actual behavior:
can't parse JSON. Raw result:
Error while Remote Objects[{"class":"SimplePluginPermissionError","message":"Vous n'avez pas les droits n\u00e9cessaires pour modifier le champ \u00abipHostNumber\u00bb de l'objet \u00abnew\u00bb","line":2062,"file":"\/usr\/share\/fusiondirectory\/include\/simpleplugin\/class_simplePlugin.inc","dn":"new","tab":"componentGeneric"}]
Reproduces how often: 100%
Maybe there is a trick to do with adding fdNetworkInterface ? user creation is OK
About Getting all MacAddress By default, opsi return Mac address used by the pxe boot. other MacAddress could be fetched by the webservice ONLY if an hardware audit has been performed : Web service used :
a result is attachedharware.json.zip
I try to import Host from opsi server
Host are imported ( with no template) network interface are imported ( I see macAddress and ipHostNumber)
I want that host must be imported with the new concept of network object ( sub object fdNetworkInterface ) name as eth0 .ethX And if possible with the wireless interface if exist
Could be useful to automatically get all network interface for dhcp / dns / radius features be more compliant with IPAM plugins
maybe complicated for naming nework interface could be :