mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-08 17:29:11 -07:00
* Add additional auth support to Gitlab (#705)
- removed unused imports from module_utils.gitlab
- fix bug in gitlab_project to check if avatar_path is provided
* add doc_fragment and argument_spec for gitlab auth
* doc fixes and remove avatar_path bug fix
* small doc changes, pass validate_certs to requests call
* update changelog
(cherry picked from commit 52ad0a5fbb
)
Co-authored-by: Josh <josham@users.noreply.github.com>
This commit is contained in:
parent
cce68def8b
commit
ec0bd3143a
15 changed files with 298 additions and 250 deletions
|
@ -14,7 +14,7 @@ DOCUMENTATION = '''
|
|||
module: gitlab_deploy_key
|
||||
short_description: Manages GitLab project deploy keys.
|
||||
description:
|
||||
- Adds, updates and removes project deploy keys
|
||||
- Adds, updates and removes project deploy keys
|
||||
author:
|
||||
- Marcus Watkins (@marwatk)
|
||||
- Guillaume Martinez (@Lunik)
|
||||
|
@ -22,13 +22,10 @@ requirements:
|
|||
- python >= 2.7
|
||||
- python-gitlab python module
|
||||
extends_documentation_fragment:
|
||||
- community.general.auth_basic
|
||||
- community.general.auth_basic
|
||||
- community.general.gitlab
|
||||
|
||||
options:
|
||||
api_token:
|
||||
description:
|
||||
- GitLab token for logging in.
|
||||
type: str
|
||||
project:
|
||||
description:
|
||||
- Id or Full path of project in the form of group/name.
|
||||
|
@ -126,7 +123,7 @@ from ansible.module_utils.api import basic_auth_argument_spec
|
|||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.gitlab import find_project, gitlab_authentication
|
||||
from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, find_project, gitlab_authentication
|
||||
|
||||
|
||||
class GitLabDeployKey(object):
|
||||
|
@ -238,8 +235,8 @@ class GitLabDeployKey(object):
|
|||
|
||||
def main():
|
||||
argument_spec = basic_auth_argument_spec()
|
||||
argument_spec.update(auth_argument_spec())
|
||||
argument_spec.update(dict(
|
||||
api_token=dict(type='str', no_log=True),
|
||||
state=dict(type='str', default="present", choices=["absent", "present"]),
|
||||
project=dict(type='str', required=True),
|
||||
key=dict(type='str', required=True, no_log=False),
|
||||
|
@ -251,13 +248,16 @@ def main():
|
|||
argument_spec=argument_spec,
|
||||
mutually_exclusive=[
|
||||
['api_username', 'api_token'],
|
||||
['api_password', 'api_token']
|
||||
['api_username', 'api_oauth_token'],
|
||||
['api_username', 'api_job_token'],
|
||||
['api_token', 'api_oauth_token'],
|
||||
['api_token', 'api_job_token'],
|
||||
],
|
||||
required_together=[
|
||||
['api_username', 'api_password']
|
||||
],
|
||||
required_one_of=[
|
||||
['api_username', 'api_token']
|
||||
['api_username', 'api_token', 'api_oauth_token', 'api_job_token']
|
||||
],
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue