Defined Type: hashfile::ini

Defined in:
manifests/ini.pp

Summary

Defined type provides an implementation of the hash2ini function, creating an INI file from the input hash

Overview

Examples:

hashfile::ini { '/some/file.ini':
  file => {
    ensure => file,
    owner  => 'root',
    group  => 'root',
    mode   => '0644',
  }
  data => {
    section1 => {
      key1   => 'value1',
    }
  }
}

Parameters:

  • file_props

    Properties of the target file resource. Accepts and requires the same parameters of a puppet “file”

  • data_hash

    Hash representation of the INI file, to include section names and key/value pairs

  • options (Hash) (defaults to: {})

    Optional hash of values to format output. See the “hash2ini” function for details.

  • file (Hash)
  • data (Hash)


24
25
26
27
28
29
30
31
32
# File 'manifests/ini.pp', line 24

define hashfile::ini (
  Hash $file,
  Hash $data,
  Hash $options = {},
) {
  File {$name:
    * => merge($file, content => hash2ini($data, $options)),
  }
}