Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ ini_setting { "sample setting":
}
```

Manage an individual setting in the global (top of the file) section. For example (note the lack of section parameter):

```
ini_setting { "sample global setting":
ensure => present,
path => '/tmp/foo.ini',
setting => 'aglobalsetting',
value => "Look at me ma! I'm at the top of the file!",
}
```


To control multiple values in a setting, use `ini_subsetting`. For example:

```
Expand Down Expand Up @@ -152,7 +164,7 @@ If the above code is added, the resulting configured file will contain only line

* `provider`: The specific backend to use for this `ini_setting` resource. You will seldom need to specify this --- Puppet usually discovers the appropriate provider for your platform. The only available provider for `ini_setting` is ruby.

* `section`: The name of the INI file section in which the setting should be defined. Add a global section --- settings that appear at the beginning of the file, before any named sections --- by specifying a section name of "".
* `section`: The name of the INI file section in which the setting should be defined. Add a global section --- settings that appear at the beginning of the file, before any named sections --- by either not declaring this parameter or by specifying a section name of "".
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you actually say that it 'Defaults to ""' like the other parameters say?


* `setting`: The name of the INI file setting to be defined.

Expand All @@ -174,7 +186,7 @@ If the above code is added, the resulting configured file will contain only line

* `quote_char`: The character used to quote the entire value of the setting. Valid values are '', '"', and "'". Defaults to ''.

* `section`: The name of the INI file section in which the setting should be defined. Add a global section --- settings that appear at the beginning of the file, before any named sections --- by specifying a section name of "".
* `section`: The name of the INI file section in which the setting should be defined. Add a global section --- settings that appear at the beginning of the file, before any named sections --- by either not declaring this parameter or by specifying a section name of "".

* `setting`: The name of the INI file setting to be defined.

Expand Down
4 changes: 3 additions & 1 deletion lib/puppet/type/ini_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
end

newparam(:section) do
desc 'The name of the section in the ini file in which the setting should be defined.'
desc 'The name of the section in the ini file in which the setting should be defined.' +
'If not provided, defaults to global, top of file, sections.'
defaultto("")
end

newparam(:setting) do
Expand Down
4 changes: 3 additions & 1 deletion lib/puppet/type/ini_subsetting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
end

newparam(:section) do
desc 'The name of the section in the ini file in which the setting should be defined.'
desc 'The name of the section in the ini file in which the setting should be defined.' +
'If not provided, defaults to global, top of file, sections.'
defaultto("")
end

newparam(:setting) do
Expand Down