Storage layout based on machine tags

Hi,
I’m trying to run specific commissioning script for specific machine type (tag). I’ve tried tagging machine and script, but it does not work. It was like:

Machine has tag “node”
commissioning script (41-xxxx) hast tags “node,noauto”

and while commissioning the 41-xxxx script is not started. When I remove “noauto” it is started for every machine, regardless of the tag. How can I start specific commissioning script for specific machine/group of machines??
Or maybe I can use something like this in commissioning script:

{{if 'bigDisk' in (node.tag_names())}}
  ...
{{elif 'smallDisk' in (node.tag_names())}}
  ...
{{else}}
  ...
{{endif}}

? Will it work with python script?

I can’t find any good documentation for using tags, I would really appreciate someone’s help - thanks in advance.

Hi @bkslash
If I understand correctly, you wish you run specific commissioning scripts for machines with specific tags? As far as I’m aware, there is no way of doing this via a script. Your best bet might be to filter machines by tag, and manually select and commission, selecting the commissioning script you want to be run for the machine

“manually” is what I’m trying to avoid :slight_smile: we have 3-4 different types of machines and I need different storage layout for each type, that’s why I’m trying to somehow “link” machine type with commissioning script…

I understand, and I’m sorry that there doesn’t seem to be a better solution for you, in this case. Like I said, as far as I’m aware there is currently way of doing this in MAAS other than manually.