Code Monkey home page Code Monkey logo

Comments (4)

jhoblitt avatar jhoblitt commented on August 12, 2024

@razorsedge Sorry for the delay in responding, github email notifications continue to be MIA most of the time for me.

You've obviously encountered a case that was never considered by the API. device_options is a hash so in your example the '/dev/cciss/c0d0' key is being redefined over and over again.

I think the API needs to be changed to devices being an Array of Array or an Array of Hash with device_options being removed. Something like:

class { 'smartd':
  devices => [
    [ '/dev/cciss/c0d0', '-d cciss,0 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,1 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,2 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,3 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,4 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,5 -a -o on -S on' ],
  ],
}

or

class { 'smartd':
  devices  => [
    { 'dev' => '/dev/cciss/c0d0', options => '-d cciss,0 -a -o on -S on' },
    { 'dev' => '/dev/cciss/c0d0', options => '-d cciss,1 -a -o on -S on' },
    ...
  ],
}

Another possibility would be to abandon both attributes and try to use a defined type but that would require setting a unique namevar for your case.

smartd::device { 'cciss1':
  device  =>  '/dev/cciss/c0d0',
  options => '-d cciss,1 -a -o on -S on',
}

What are your thoughts?

from puppet-smartd.

razorsedge avatar razorsedge commented on August 12, 2024

@jhoblitt I am kind of ambivalent. I know that right now I want to use Hiera data bindings to provide the settings with the possibility to merge parts of the hierarchy into the smartd.conf. This probably precludes defined types. A hash would allow for Hiera hash merging.

Long-term I would want fact discovery to automatically find all DASD block devices, figure out if they are behind hardware RAID, and apply the correct '/dev/cciss/c0d0', '-d cciss,4' '/dev/sdg', '-d megaraid,2' pairings to the smartd.conf.

from puppet-smartd.

jhoblitt avatar jhoblitt commented on August 12, 2024

Could you take a look at #9 and see if it covers your needs? I added a test based on your example.

from puppet-smartd.

razorsedge avatar razorsedge commented on August 12, 2024

#9 fixes it. Thanks.

from puppet-smartd.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.