Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartd_devices should be a list not dict #15

Open
sebcmp opened this issue Sep 22, 2020 · 0 comments
Open

smartd_devices should be a list not dict #15

sebcmp opened this issue Sep 22, 2020 · 0 comments

Comments

@sebcmp
Copy link

sebcmp commented Sep 22, 2020

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

devster31 added a commit to devster31/smartd that referenced this issue Nov 13, 2020
devster31 added a commit to devster31/smartd that referenced this issue Nov 13, 2020
devster31 added a commit to devster31/smartd that referenced this issue Nov 13, 2020
devster31 added a commit to devster31/smartd that referenced this issue Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant