OPSI Howto
API
opsi-admin
method names start with get or set are compability methods for opsi 3 calls. Opsi 4 method names start with the object type, eg:
method host_getIdents method product_getIdents method product_getHashes productOnClient_getObjects
Product Properties
Packages have defined default values for there properties.
Client Product Properties
Product properties can be set individually on every client using the Opsi-Gui.
Depot Product Properties
A Depot Server can have its own set of product properties. When a new Opsi is added to a depot server, these depot values are also used for the client, if the client does not overwrite these properties.
The depot defaults can be defined when installing a new package:
opsi-package-manager -i -p ask PAKET.opsi
Additionally, these properties can be quering and modified using the Opsi-JSON-RPC API calls.
Example:
# query the properties of the product "winxppro" on the server DEPOT-SERVER-ID opsi-admin -d method getProductProperties_hash winxppro DEPOT-SERVER-ID # change the property "productkey" of the product winxppro on the server DEPOT-SERVER-ID opsi-admin -d method setProductProperty winxppro "productkey" "ABCDE-FGHIJ-KLMNO-QRTUV-WXYZ1" DEPOT-SERVER-ID
Change Product Properties for all Clients on a Depot Server
opsi-admin -d method productPropertyState_create productId propertyId objectId *values
- objectId
- Depot-Server or Client-Name
Global Defaults
Global defaults can be changed using the following API calls:
opsi-admin -d method productProperty_getObjects [] '{"productId":"winxppro"}' > /tmp/winxppro_config.json vi /tmp/winxppro_config.json # change possible values and defaults here (eg.: orgname="dass IT GmbH" opsi-admin -d method productProperty_updateObjects < /tmp/winxppro_config.json # check the result opsi-admin -d method getProductProperties_hash winxppro
Bitlocker and Reinstallation
if you plan to reinstall a system that is using Bitlocker, disk must be wiped before!
Otherwise Windows Installer fails, because it claims that access to the harddisk is restricted.