Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #7505/be4d5b7d backport][stable-8] ini_file - add feature 'section_has_values' #8250

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Apr 20, 2024

This is a backport of PR #7505 as merged into main (be4d5b7).

SUMMARY

ini_file: Add an optional parameter section_has. If the target ini file contains more than one section, use section_has to specify which one should be updated.

Use case: In wireguard config there can be multiple [Peer] sections. See example in source code doc string

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ini_file

* insert new code

* add changelog

* add argument_spec

* sanity check

* docstring version_added

* version-added-must-be-major-or-minor

* Update plugins/modules/ini_file.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* check for default value  `None`

* typo in example

* add integration test and rename option

* add license

* update "version added" in docstring

* insert new code

* remove whitespace

* update examples

* support exclusive, allow_no_value, multiple values in section_has_values

* prefer Todd's variable naming in loops

* resolve number clash in file names

* pass sanity test validate-modules

* Documentation updates

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Todd Lewis <todd_lewis@unc.edu>
(cherry picked from commit be4d5b7)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport feature This issue/PR relates to a feature request integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests labels Apr 20, 2024
@felixfontein felixfontein merged commit 60e4269 into stable-8 Apr 20, 2024
131 of 132 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-8/be4d5b7dc4d63d3a828fd480f9728ce012310133/pr-7505 branch April 20, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants