[PR #6404/e49c6a33 backport][stable-5] ini_file: removing required=true for 'section' option (#6410)

ini_file: removing required=true for 'section' option (#6404)

Fix ini_file by removing required=true for 'section' option.

(cherry picked from commit e49c6a339e)

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/6426/head
patchback[bot] 2023-04-23 18:49:29 +02:00 committed by GitHub
parent af4ac4813e
commit 3db3608335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- "ini_file - make ``section`` parameter not required so it is possible to pass ``null`` as a value. This only was possible in the past due to a bug in ansible-core that now has been fixed (https://github.com/ansible-collections/community.general/pull/6404)."

View File

@ -35,10 +35,9 @@ options:
description:
- Section name in INI file. This is added if I(state=present) automatically when
a single value is being set.
- If left empty or set to C(null), the I(option) will be placed before the first I(section).
- If left empty, being omitted, or being set to C(null), the I(option) will be placed before the first I(section).
- Using C(null) is also required if the config format does not support sections.
type: str
required: true
option:
description:
- If set (required for changing a I(value)), this is the name of the option.
@ -423,7 +422,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
path=dict(type='path', required=True, aliases=['dest']),
section=dict(type='str', required=True),
section=dict(type='str'),
option=dict(type='str'),
value=dict(type='str'),
values=dict(type='list', elements='str'),