Skip to content

Instantly share code, notes, and snippets.

@abrader
Created July 24, 2017 19:34
Show Gist options
  • Select an option

  • Save abrader/757a02f79f8093b7096ba8fa2dcc0e63 to your computer and use it in GitHub Desktop.

Select an option

Save abrader/757a02f79f8093b7096ba8fa2dcc0e63 to your computer and use it in GitHub Desktop.
TAPP: Splunk domeger/splunk-uf-universal module review

splunk-logo

Reference documentation:

General Notes:

  • Adherence to Puppet Style
  • Puppet types have weak to no validation
    • Should bolster your types by providing constraints on user provided data and conformance standards
  • Puppet manifest classes are not documented in known standards
  • Data types should be used for parameters in Puppet DSL classes
  • Puppet DSL should contain data validation
    • Should provide proper validation of data provided by module users
      • Use data types where possible as this will provide basic validation
      • Provide additonal validation via custom functions

README.md

  • README should be written out to follow a similar style used by Puppet

init.pp

  • Conditional logic should be used to determine which package is suitable for which OS
    • Common use of $facts['os']['family'] fact can be used to determine package type
  • Data types should be used for parameters in Puppet DSL classes
  • Hardcoded values can make module inflexible
    • Considering exposing values (i.e., file paths) where possible to allow for flexibility

params.pp

  • Explicit hiera lookups not required
    • Exposure of parameters causes Hiera to automatically lookup key
  • Conditional logic should be use to determine if OS is systemd vs SysV
    • Comparison of $facts['os']['family'] and $facts['os']['release']['full'] will work
    • Custom function also suitable
  • No validation
    • Should provide proper validation of data provided by module users
      • Use data types where possible
      • Provide additional validation via custom functions
  • Data types should be used for parameters in Puppet DSL classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment