Forge Home

inifile

Resource types for managing settings in INI files

12,902,898 downloads

6,962 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 6.1.1 (latest)
  • 6.1.0
  • 6.0.0
  • 5.4.1
  • 5.4.0
  • 5.3.0
  • 5.2.0
  • 5.1.0
  • 5.0.1
  • 5.0.0
  • 4.4.0
  • 4.3.1
  • 4.3.0
  • 4.2.0
  • 4.1.0
  • 4.0.0
  • 3.1.0
  • 3.0.0
  • 2.5.0
  • 2.4.0
  • 2.3.0
  • 2.2.2
  • 2.2.1
  • 2.2.0
  • 2.1.1
  • 2.1.0
  • 2.0.0
  • 1.6.0
  • 1.5.0
  • 1.4.3
  • 1.4.2
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.4
  • 1.0.3
  • 1.0.1 (deleted)
  • 1.0.0
released Apr 27th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.10 < 7.0.0
  • , , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-inifile', '4.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-inifile
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-inifile --version 4.2.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/inifile — version 4.2.0 Apr 27th 2020

Reference

Table of Contents

Resource types

  • ini_setting: ini_settings is used to manage a single setting in an INI file
  • ini_subsetting: ini_subsettings is used to manage multiple values in a setting in an INI file

Functions

Resource types

ini_setting

ini_settings is used to manage a single setting in an INI file

Properties

The following properties are available in the ini_setting type.

ensure

Valid values: present, absent

Ensurable method handles modeling creation. It creates an ensure property

Default value: present

value

The value of the setting to be defined.

Parameters

The following parameters are available in the ini_setting type.

name

namevar

An arbitrary name used as the identity of the resource.

section

The name of the section in the ini file in which the setting should be defined.

Default value: ''

setting

The name of the setting to be defined.

force_new_section_creation

Valid values: true, false, yes, no

Create setting only if the section exists

Default value: true

path

The ini file Puppet will ensure contains the specified setting.

show_diff

Valid values: true, md5, false

Whether to display differences when the setting changes.

Default value: true

key_val_separator

The separator string to use between each setting name and value.

Default value: =

section_prefix

The prefix to the section name\'s header.

Default value: [

section_suffix

The suffix to the section name\'s header.

Default value: ]

indent_char

The character to indent new settings with.

Default value:

indent_width

The number of indent_chars to use to indent a new setting.

refreshonly

Valid values: true, false, yes, no

A flag indicating whether or not the ini_setting should be updated only when called as part of a refresh event

Default value: false

ini_subsetting

ini_subsettings is used to manage multiple values in a setting in an INI file

Properties

The following properties are available in the ini_subsetting type.

ensure

Valid values: present, absent

Ensurable method handles modeling creation. It creates an ensure property

Default value: present

value

The value of the subsetting to be defined.

Parameters

The following parameters are available in the ini_subsetting type.

name

namevar

An arbitrary name used as the identity of the resource.

section

The name of the section in the ini file in which the setting should be defined.

Default value: ''

setting

The name of the setting to be defined.

subsetting

The name of the subsetting to be defined.

subsetting_separator

The separator string between subsettings. Defaults to the empty string.

Default value:

subsetting_key_val_separator

The separator string between the subsetting name and its value. Defaults to the empty string.

Default value: ''

path

The ini file Puppet will ensure contains the specified setting.

show_diff

Valid values: true, md5, false

Whether to display differences when the setting changes.

Default value: true

key_val_separator

The separator string to use between each setting name and value.

Default value: =

quote_char

The character used to quote the entire value of the setting. Valid values are '', '\"' and \"'\"

Default value: ''

use_exact_match

Valid values: true, false

Set to true if your subsettings don\'t have values and you want to use exact matches to determine if the subsetting exists.

Default value: false

insert_type

Valid values: start, end, before, after, index

Where the new subsetting item should be inserted

  • :start - insert at the beginning of the line.
  • :end - insert at the end of the line (default).
  • :before - insert before the specified element if possible.
  • :after - insert after the specified element if possible.
  • :index - insert at the specified index number.

Default value: end

insert_value

The value for the insert types which require one.

Functions

create_ini_settings

Type: Ruby 4.x API

DEPRECATED. Use the namespaced function inifile::create_ini_settings instead.

create_ini_settings(Any *$args)

The create_ini_settings function.

Returns: Any

*args

Data type: Any

inifile::create_ini_settings

Type: Ruby 4.x API

This function is used to create a set of ini_setting resources from a hash

inifile::create_ini_settings(Hash $settings, Optional[Hash] $defaults)

The inifile::create_ini_settings function.

Returns: Any

settings

Data type: Hash

A hash of settings you want to create ini_setting resources from

defaults

Data type: Optional[Hash]

A hash of defaults you would like to use in the ini_setting resources