From 1bb2ff5128d48639933e14cbce4d6f29151535fc Mon Sep 17 00:00:00 2001 From: Chris Frage Date: Mon, 27 Sep 2021 21:50:21 +0200 Subject: [PATCH] Fix require_two_factor_authentication can't be null (#3453) * fix: require_two_factor_authentication default=false * chore: add changelog fragment * docs: require_two_factor_authentication default value * fix: don't send require_two_factor_authentication null value * chore: fix changelog --- ...ab_group-require_two_factor_authentication-cant_be_null.yml | 2 ++ plugins/modules/source_control/gitlab/gitlab_group.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3453-fix-gitlab_group-require_two_factor_authentication-cant_be_null.yml diff --git a/changelogs/fragments/3453-fix-gitlab_group-require_two_factor_authentication-cant_be_null.yml b/changelogs/fragments/3453-fix-gitlab_group-require_two_factor_authentication-cant_be_null.yml new file mode 100644 index 0000000000..3077b4a45d --- /dev/null +++ b/changelogs/fragments/3453-fix-gitlab_group-require_two_factor_authentication-cant_be_null.yml @@ -0,0 +1,2 @@ +bugfixes: + - gitlab_group - avoid passing wrong value for ``require_two_factor_authentication`` on creation when the option has not been specified (https://github.com/ansible-collections/community.general/pull/3453). diff --git a/plugins/modules/source_control/gitlab/gitlab_group.py b/plugins/modules/source_control/gitlab/gitlab_group.py index 6ea252e7e0..a82756d81e 100644 --- a/plugins/modules/source_control/gitlab/gitlab_group.py +++ b/plugins/modules/source_control/gitlab/gitlab_group.py @@ -206,10 +206,11 @@ class GitLabGroup(object): 'project_creation_level': options['project_creation_level'], 'auto_devops_enabled': options['auto_devops_enabled'], 'subgroup_creation_level': options['subgroup_creation_level'], - 'require_two_factor_authentication': options['require_two_factor_authentication'], } if options.get('description'): payload['description'] = options['description'] + if options.get('require_two_factor_authentication'): + payload['require_two_factor_authentication'] = options['require_two_factor_authentication'] group = self.createGroup(payload) changed = True else: