action #169492
openper worker-class settings in salt states size:S
0%
Description
Motivation¶
We want worker-class specific settings which we can specify in workers.ini. That should be configurable with salt, e.g. in https://gitlab.suse.de/openqa/salt-states-openqa, but should use a new upstream openQA feature parsing a new to be designed syntax in workers.ini
Acceptance criteria¶
- AC1: worker-class specific settings can be specified in workers.ini
Suggestions¶
Allow additional sections like [class:tap]
in workers.ini
. The config parser of the worker would go though the list of classes and consider all settings of matching classes as well. The instance-specific settings in the numbered sections would still have precedence of course.
Further details¶
See conversation at: https://gitlab.suse.de/openqa/salt-pillars-openqa/-/merge_requests/924#note_685345
Original motivation¶
I think the salt states need a way to apply certain settings to workers with different values, depending on the class:
One example is of poo#168097, where it would be great to be able to set a variable to be applied to all workers, like REPO_MIRROR_HOST
with an overriden default, per class:
location-nue3:
- REPO_MIRROR_HOST=https://nue3.example.com
location-lab:
- REPO_MIRROR_HOST=https://lab.example.com
And have these settings applied to all workers, with said class.
Not sure if this should happen at the level of whatever manages the workers, or code in openQA
Updated by mkittler 11 days ago · Edited
Yes, e.g. by allowing additional sections like [class:tap]
in workers.ini
. The config parser of the worker would go though the list of classes and consider all settings of matching classes as well. The instance-specific settings in the numbered sections would still have precedence of course.
This would help to simplify my local workers.ini
a lot as many settings are actually related to a class.
Updated by mkittler 10 days ago
The redundancy in lots of instance configurations could be reduced. So
[11]
BACKEND = svirt
WORKER_CLASS = svirt-vmware
VIRSH_HOSTNAME=127.0.0.1
VIRSH_USERNAME=root
#VIRSH_PASSWORD=
VIRSH_CMDLINE=ifcfg=dhcp
VIRSH_INSTANCE=9
VMWARE_HOST=…
VMWARE_PASSWORD=…
[12]
BACKEND = svirt
WORKER_CLASS = svirt-vmware
VIRSH_HOSTNAME=127.0.0.1
VIRSH_USERNAME=root
#VIRSH_PASSWORD=
VIRSH_CMDLINE=ifcfg=dhcp
VIRSH_INSTANCE=10
VMWARE_HOST=…
VMWARE_PASSWORD=…
could become:
[11]
WORKER_CLASS = svirt-vmware
VIRSH_INSTANCE=9
VMWARE_HOST=…
VMWARE_PASSWORD=…
[12]
WORKER_CLASS = svirt-vmware
VIRSH_INSTANCE=10
VMWARE_HOST=…
VMWARE_PASSWORD=…
[class:svrit-vmware]
BACKEND = svirt
VIRSH_HOSTNAME=127.0.0.1
VIRSH_USERNAME=root
VIRSH_PASSWORD=…
VIRSH_CMDLINE=ifcfg=dhcp