1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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

Fix ini_file by removing required=true for 'section' option.
This commit is contained in:
Felix Fontein 2023-04-23 16:51:18 +02:00 committed by GitHub
parent 486c47f922
commit e49c6a339e
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

@ -42,10 +42,9 @@ options:
description: description:
- Section name in INI file. This is added if I(state=present) automatically when - Section name in INI file. This is added if I(state=present) automatically when
a single value is being set. 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. - Using C(null) is also required if the config format does not support sections.
type: str type: str
required: true
option: option:
description: description:
- If set (required for changing a I(value)), this is the name of the option. - If set (required for changing a I(value)), this is the name of the option.
@ -430,7 +429,7 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
path=dict(type='path', required=True, aliases=['dest']), path=dict(type='path', required=True, aliases=['dest']),
section=dict(type='str', required=True), section=dict(type='str'),
option=dict(type='str'), option=dict(type='str'),
value=dict(type='str'), value=dict(type='str'),
values=dict(type='list', elements='str'), values=dict(type='list', elements='str'),