Set a list as productproperty of a package ?

nicolaslebrun
Beiträge: 73
Registriert: 18 Apr 2011, 11:43

Set a list as productproperty of a package ?

Beitragvon nicolaslebrun » 06 Feb 2015, 17:43

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

Benutzeravatar
n.wenselowski
Beiträge: 2712
Registriert: 04 Apr 2013, 12:15

Re: Set a list as productproperty of a package ?

Beitragvon n.wenselowski » 09 Feb 2015, 09:45

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
Kein Support per DM!
_________________________
opsi support - uib gmbh
For productive opsi installations we recommend support contracts.

nicolaslebrun
Beiträge: 73
Registriert: 18 Apr 2011, 11:43

Re: Set a list as productproperty of a package ?

Beitragvon nicolaslebrun » 22 Feb 2015, 13:05

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

nicolaslebrun
Beiträge: 73
Registriert: 18 Apr 2011, 11:43

Re: Set a list as productproperty of a package ?

Beitragvon nicolaslebrun » 22 Feb 2015, 13:39

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

Benutzeravatar
n.wenselowski
Beiträge: 2712
Registriert: 04 Apr 2013, 12:15

Re: Set a list as productproperty of a package ?

Beitragvon n.wenselowski » 23 Feb 2015, 10:54

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
Kein Support per DM!
_________________________
opsi support - uib gmbh
For productive opsi installations we recommend support contracts.

nicolaslebrun
Beiträge: 73
Registriert: 18 Apr 2011, 11:43

Re: Set a list as productproperty of a package ?

Beitragvon nicolaslebrun » 23 Feb 2015, 15:01

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

Benutzeravatar
n.wenselowski
Beiträge: 2712
Registriert: 04 Apr 2013, 12:15

Re: Set a list as productproperty of a package ?

Beitragvon n.wenselowski » 24 Feb 2015, 09:47

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
Kein Support per DM!
_________________________
opsi support - uib gmbh
For productive opsi installations we recommend support contracts.

nicolaslebrun
Beiträge: 73
Registriert: 18 Apr 2011, 11:43

Re: Set a list as productproperty of a package ?

Beitragvon nicolaslebrun » 26 Feb 2015, 21:01

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

Benutzeravatar
wolfbardo
Beiträge: 1071
Registriert: 01 Jul 2008, 12:10

Re: Set a list as productproperty of a package ?

Beitragvon wolfbardo » 27 Feb 2015, 08:31

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:

Code: Alles auswählen

setProductProperty


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

Code: Alles auswählen

/tmp/property_config.json


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


opsi workshops in Mainz

Basis 27.-30.8.2018

Paketierung: Vertiefung 06.-07.9.2018

Basis 24.-27.9.2018

Basis 5.-8.11.2018

Paketierung: Einführung13.-14.11.2018

Basis 3.-6.12.2018


opsi support by uib gmbh

http://www.uib.de

Benutzeravatar
n.wenselowski
Beiträge: 2712
Registriert: 04 Apr 2013, 12:15

Re: Set a list as productproperty of a package ?

Beitragvon n.wenselowski » 20 Mär 2018, 16:17

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
Kein Support per DM!
_________________________
opsi support - uib gmbh
For productive opsi installations we recommend support contracts.