Skip to content

Add support for multiple values per key#555

Merged
skyamgarp merged 5 commits intopuppetlabs:mainfrom
bwitt:pr-481-multivalue
Apr 17, 2026
Merged

Add support for multiple values per key#555
skyamgarp merged 5 commits intopuppetlabs:mainfrom
bwitt:pr-481-multivalue

Conversation

@bwitt
Copy link
Copy Markdown
Contributor

@bwitt bwitt commented Jan 8, 2026

Summary

This is a clone of #481 to hopefully get it passing and merged.

This change adds support for ini files in which the same key is used multiple times for lists of values, for example:

[section]
foo=a
foo=b

To set multiple values, an array of values can be passed to the value property of ini_setting.

When passing a single value, the module works as before, with one exception: when a single value is passed to value, but the ini file already contains multiple lines with the same key, any additional lines will now be removed instead of retained.

Thanks to @omolenkamp for the original PR.

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Fixes #41
Related to #481

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@bwitt bwitt marked this pull request as ready for review January 8, 2026 06:23
@bwitt bwitt requested review from a team, bastelfreak, ekohl and smortex as code owners January 8, 2026 06:23
@span786
Copy link
Copy Markdown
Contributor

span786 commented Apr 9, 2026

@bwitt Please resolve the conflicts.

@bwitt bwitt force-pushed the pr-481-multivalue branch from 104cb93 to 9340597 Compare April 9, 2026 18:39
@bwitt
Copy link
Copy Markdown
Contributor Author

bwitt commented Apr 9, 2026

@span786 done!

@skyamgarp
Copy link
Copy Markdown
Contributor

A PR has been created to execute tests for this contribution: #562

@skyamgarp
Copy link
Copy Markdown
Contributor

A PR has been created to execute tests for this contribution: #562

@bwitt , can you please fix the failing specs?

Signed-off-by: Brian Witt <brianwitt@gmail.com>
@bwitt
Copy link
Copy Markdown
Contributor Author

bwitt commented Apr 16, 2026

@skyamgarp I've added a fix, let me know how that looks!

@skyamgarp skyamgarp merged commit 546d4bb into puppetlabs:main Apr 17, 2026
1 check passed
@skyamgarp
Copy link
Copy Markdown
Contributor

Tested against #562. Thank you @bwitt.

@bwitt bwitt deleted the pr-481-multivalue branch April 18, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't set the same key twice

4 participants