From ffa4dbbb80fb7a4b24d3c0e51198182fb0898c77 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Mon, 21 Jul 2025 22:23:42 +1200 Subject: [PATCH] github_repo: deprecate force_defaults=true --- plugins/modules/github_repo.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/modules/github_repo.py b/plugins/modules/github_repo.py index d5091cde3d..ebb9265341 100644 --- a/plugins/modules/github_repo.py +++ b/plugins/modules/github_repo.py @@ -83,11 +83,9 @@ options: version_added: "3.5.0" force_defaults: description: - - Overwrite current O(description) and O(private) attributes with defaults if set to V(true), which currently is the - default. - - The default for this option will be deprecated in a future version of this collection, and eventually change to V(false). + - If V(true), overwrite current O(description) and O(private) attributes with defaults. + - V(true) is deprecated for this option and will not be allowed starting in community.general 13.0.0. V(false) will be the default value then. type: bool - default: true required: false version_added: 4.1.0 requirements: @@ -252,7 +250,7 @@ def main(): private=dict(type='bool'), description=dict(type='str'), api_url=dict(type='str', required=False, default='https://api.github.com'), - force_defaults=dict(type='bool', default=True), + force_defaults=dict(type='bool'), ) module = AnsibleModule( argument_spec=module_args, @@ -262,6 +260,11 @@ def main(): mutually_exclusive=[('username', 'access_token')] ) + if module.params['force_defaults'] is None: + module.deprecate("'force_defaults=true' is deprecated and will not be allowed in community.general 13.0.0, use 'force_defaults=false' instead", + version="13.0.0", collection_name="community.general") + module.params['force_defaults'] = True + if not HAS_GITHUB_PACKAGE: module.fail_json(msg=missing_required_lib( "PyGithub"), exception=GITHUB_IMP_ERR)