Seite 1 von 1
Set a list as productproperty of a package ?
Verfasst: 06 Feb 2015, 17:43
von nicolaslebrun
Hi,
On my server,
Code: Alles auswählen
opsi-admin -dr method getProductProperties_hash opsi-clonezilla nomdemachine.fqdn.fr
{"setup_after_install": "opsi-domain-join,opsi-patch-domain-seven", "drbl_ocs_conf": "", "mount_image_share": "False", "imageshare": "//opsiserver/opsi_images", "askbeforeinst": "True", "imagefile": "une-image", "rebootflag": "reboot", "architecture": "32bit", "runcommand": "ocs-live"}
The value of setup_after_install is a list ... But I can't change this list...
If i make
Code: Alles auswählen
opsi-admin -dr method setProductProperty opsi-clonezilla setup_after_install [windomain,jedit,javavm]
The value is created, but it is a string, not a list... I tried to set a list with { or ' ... but i can't get it working ...
Any idea ?
Greetings,
Nicolas Lebrun
Re: Set a list as productproperty of a package ?
Verfasst: 09 Feb 2015, 09:45
von n.wenselowski
Hello Nicolas,
for the update you are working with
JSON. To create a list you use square brackes - [ ].
Try this:
Code: Alles auswählen
"setup_after_install": ["opsi-domain-join", "opsi-patch-domain-seven"]
With kind regards
Niko
Re: Set a list as productproperty of a package ?
Verfasst: 22 Feb 2015, 13:05
von nicolaslebrun
Thanks Niko for your answer... i hadn't seen till today...
I just tried many solutions :
Code: Alles auswählen
opsi-admin -dr method setProductProperty opsi-clonezilla "setup_after_install" ["opsi-domain-join", "opsi-patch-domain-seven"]
doesn't work. Too many arguments.
Code: Alles auswählen
opsi-admin -dr method setProductProperty opsi-clonezilla "setup_after_install" [ "opsi-domain-join" , "opsi-patch-domain-seven" ]
doesn't work. Too many arguments.
It seem's opsi-admin parses on space caracters...
Code: Alles auswählen
opsi-admin -d method setProductProperty opsi-clonezilla "setup_after_install" ["opsi-domain-join","opsi-patch-domain-seven"]
seems too work.
But, ["opsi-domain-join","opsi-patch-domain-seven"] is used as a string...
If I try with a colon, with space or not
Code: Alles auswählen
opsi-admin -dr method setProductProperty opsi-clonezilla "setup_after_install" : ["opsi-domain-join","opsi-patch-domain-seven"]
i get too many or too few arguments...
well, sorry, Niko, but I can't get it working...
Regards,
Nico
Re: Set a list as productproperty of a package ?
Verfasst: 22 Feb 2015, 13:39
von nicolaslebrun
Another try,
None of these intructions give an error...
But I can't get a list value for setup_after_install ...
Code: Alles auswählen
opsi-admin -d method setProductProperties opsi-clonezilla '{"setup_after_install":["opsi-domain-join,opsi-patch-domain-seven"], "drbl_ocs_conf": "", "runcommand": "ocs-live", "imageshare": "//opsi/opsi_images", "askbeforeinst": "False", "imagefile": "ChoisirLeNomDeLIMage", "rebootflag": "halt", "architecture": "32bit", "mount_image_share": "True"}'
Code: Alles auswählen
opsi-admin -d method setProductProperties opsi-clonezilla '{"setup_after_install":["opsi-domain-join","opsi-patch-domain-seven"], "drbl_ocs_conf": "", "runcommand": "ocs-live", "imageshare": "//opsi/opsi_images", "askbeforeinst": "False", "imagefile": "ChoisirLeNomDeLIMage", "rebootflag": "halt", "architecture": "32bit", "mount_image_share": "True"}'
Code: Alles auswählen
opsi-admin -d method setProductProperties opsi-clonezilla '{"setup_after_install": ["opsi-domain-join","opsi-patch-domain-seven"], "drbl_ocs_conf": "", "runcommand": "ocs-live", "imageshare": "//opsi/opsi_images", "askbeforeinst": "False", "imagefile": "ChoisirLeNomDeLIMage", "rebootflag": "halt", "architecture": "32bit", "mount_image_share": "True"}'
I really think it isn't well parsed...
Regards
Re: Set a list as productproperty of a package ?
Verfasst: 23 Feb 2015, 10:54
von n.wenselowski
Hello Nicolas,
nicolaslebrun hat geschrieben:I really think it isn't well parsed...
This probably is the problem.
The most easy solution I can currently think of is to use the configed in a current version to set the properties you want through the GUI. To do this select the depot view and then change to the default properties tab.
Another alternative would be to re-package the product with the settings you want and reinstall it with the option
--properties package.
The last thing would be to connect through the opsi-backend through a script and then do the setting you want.
With kind regards
Niko
Re: Set a list as productproperty of a package ?
Verfasst: 23 Feb 2015, 15:01
von nicolaslebrun
Thks Niko,
But we have about 150 opsi servers and I can't imagine doing this with configed ...
I hope it will be possible in a next release of opsi-admin...
Must I open an issue ?
Regards,
Nico
Re: Set a list as productproperty of a package ?
Verfasst: 24 Feb 2015, 09:47
von n.wenselowski
Hello Nico,
nicolaslebrun hat geschrieben:But we have about 150 opsi servers and I can't imagine doing this with configed ...
Please give it a try. Editing multiple depots is possible by just seleting them - or pressing
++ to have all depots selected.
nicolaslebrun hat geschrieben:I hope it will be possible in a next release of opsi-admin...
Must I open an issue ?
I did open one. No guarantee that this will be fixed in the next version though.
If it is important for you just contact us through support. With that many depots i'm sure you have a
support contract
With kind regards
Niko
Re: Set a list as productproperty of a package ?
Verfasst: 26 Feb 2015, 21:01
von nicolaslebrun
Hi Niko,
Please give it a try. Editing multiple depots is possible by just seleting them - or pressing ++ to have all depots selected.
But we have 150 opsi servers ... not 150 opsi depots ! About 30000 clients... and the choice made two years ago, was to have 150 servers...
Nico
Re: Set a list as productproperty of a package ?
Verfasst: 27 Feb 2015, 08:31
von wolfbardo
Hi Nicolas,
nicolaslebrun hat geschrieben:
But we have 150 opsi servers ... not 150 opsi depots ! About 30000 clients...
Nico
great.
We recommend for productiv opsi environments a support contract with uib gmbh.
Regarding your question:
is a legacy opsi3-method.
Some of them are very usefull, others may become depricated.
As Nico mentioned, one workaround is
n.wenselowski hat geschrieben:
... to re-package the product with the settings you want and reinstall it with the option --properties package.
With kind regards
Niko
Another possibility is working analogous
viewtopic.php?t=3017
Code: Alles auswählen
opsi-admin -d method productProperty_getObjects [] '{"productId":"opsi-clonezilla"}' > /tmp/property_config.json
edit
and
Code: Alles auswählen
opsi-admin -d method productProperty_updateObjects < /tmp/property_config.json
check with
Code: Alles auswählen
opsi-admin -d method getProductProperties_hash opsi-clonezilla
regards,
bardo wolf
Re: Set a list as productproperty of a package ?
Verfasst: 20 Mär 2018, 16:17
von n.wenselowski
Hi,
as to answer to the initial problem: this seems to have been an problem in setProductProperty / setProductProperties.
This seems to have not been an problem with opsi-admin but the method.
There is a corrected version in python-opsi 4.0.7.58 for opsi 4.0 and 4.1.1.30 for opsi 4.1.
Feedback is welcome for this!
Kind regards
Niko