Skip to content

smartd_devices should be a list not dict #15

@sebcmp

Description

@sebcmp

It's not possible to specify a 3ware raid controller with the current config definition since the device path is always the same

given

      smartd_devices:
        /dev/twa0:
          type: "3ware,0"
        /dev/twa0:
          type: "3ware,1"

will create a warning

[WARNING]: While constructing a mapping from play.example.yml, line x, column y, found a duplicate dict
key (/dev/twa0). Using last defined value only.

i would suggest a list instead

      smartd_devices:
        - name: "/dev/twa0"
          type: "3ware,0"
        - name: "/dev/twa0"
          type: "3ware,1"

so the template code would become

{% for config in smartd_devices | d([]) %}
        {{- config.name -}}

i know this breaks backward compatibility but maybe with an extra check in the template both variants could be supported?

thanks for the role. i might submit a patch when i find a minute

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions