[PR #9395/3048d530 backport][stable-9] g*.py: normalize docs (#9414)

g*.py: normalize docs (#9395)

* g*.py: normalize docs

* Update plugins/modules/gandi_livedns.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 3048d5305d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pull/9429/head
patchback[bot] 2024-12-26 22:44:22 +01:00 committed by GitHub
parent 87d63c5bed
commit a66b9fc5c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 633 additions and 683 deletions

View File

@ -8,15 +8,14 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: gandi_livedns module: gandi_livedns
author: author:
- Gregory Thiemonge (@gthiemonge) - Gregory Thiemonge (@gthiemonge)
version_added: "2.3.0" version_added: "2.3.0"
short_description: Manage Gandi LiveDNS records short_description: Manage Gandi LiveDNS records
description: description:
- "Manages DNS records by the Gandi LiveDNS API, see the docs: U(https://doc.livedns.gandi.net/)." - 'Manages DNS records by the Gandi LiveDNS API, see the docs: U(https://doc.livedns.gandi.net/).'
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -27,32 +26,31 @@ attributes:
options: options:
personal_access_token: personal_access_token:
description: description:
- Scoped API token. - Scoped API token.
- One of O(personal_access_token) and O(api_key) must be specified. - One of O(personal_access_token) and O(api_key) must be specified.
type: str type: str
version_added: 9.0.0 version_added: 9.0.0
api_key: api_key:
description: description:
- Account API token. - Account API token.
- Note that these type of keys are deprecated and might stop working at some point. - Note that these type of keys are deprecated and might stop working at some point. Use personal access tokens instead.
Use personal access tokens instead. - One of O(personal_access_token) and O(api_key) must be specified.
- One of O(personal_access_token) and O(api_key) must be specified.
type: str type: str
record: record:
description: description:
- Record to add. - Record to add.
type: str type: str
required: true required: true
state: state:
description: description:
- Whether the record(s) should exist or not. - Whether the record(s) should exist or not.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
default: present default: present
ttl: ttl:
description: description:
- The TTL to give the new record. - The TTL to give the new record.
- Required when O(state=present). - Required when O(state=present).
type: int type: int
type: type:
description: description:
@ -61,25 +59,25 @@ options:
required: true required: true
values: values:
description: description:
- The record values. - The record values.
- Required when O(state=present). - Required when O(state=present).
type: list type: list
elements: str elements: str
domain: domain:
description: description:
- The name of the Domain to work with (for example, "example.com"). - The name of the Domain to work with (for example, V(example.com)).
required: true required: true
type: str type: str
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create a test A record to point to 127.0.0.1 in the my.com domain - name: Create a test A record to point to 127.0.0.1 in the my.com domain
community.general.gandi_livedns: community.general.gandi_livedns:
domain: my.com domain: my.com
record: test record: test
type: A type: A
values: values:
- 127.0.0.1 - 127.0.0.1
ttl: 7200 ttl: 7200
personal_access_token: dummytoken personal_access_token: dummytoken
register: record register: record
@ -90,7 +88,7 @@ EXAMPLES = r'''
type: CNAME type: CNAME
record: mail record: mail
values: values:
- www - www
ttl: 7200 ttl: 7200
personal_access_token: dummytoken personal_access_token: dummytoken
state: present state: present
@ -101,7 +99,7 @@ EXAMPLES = r'''
type: CNAME type: CNAME
record: mail record: mail
values: values:
- www - www
ttl: 10800 ttl: 10800
personal_access_token: dummytoken personal_access_token: dummytoken
state: present state: present
@ -120,46 +118,46 @@ EXAMPLES = r'''
record: test record: test
type: A type: A
values: values:
- 127.0.0.1 - 127.0.0.1
ttl: 7200 ttl: 7200
api_key: dummyapikey api_key: dummyapikey
''' """
RETURN = r''' RETURN = r"""
record: record:
description: A dictionary containing the record data. description: A dictionary containing the record data.
returned: success, except on record deletion returned: success, except on record deletion
type: dict type: dict
contains: contains:
values: values:
description: The record content (details depend on record type). description: The record content (details depend on record type).
returned: success returned: success
type: list type: list
elements: str elements: str
sample: sample:
- 192.0.2.91 - 192.0.2.91
- 192.0.2.92 - 192.0.2.92
record: record:
description: The record name. description: The record name.
returned: success returned: success
type: str type: str
sample: www sample: www
ttl: ttl:
description: The time-to-live for the record. description: The time-to-live for the record.
returned: success returned: success
type: int type: int
sample: 300 sample: 300
type: type:
description: The record type. description: The record type.
returned: success returned: success
type: str type: str
sample: A sample: A
domain: domain:
description: The domain associated with the record. description: The domain associated with the record.
returned: success returned: success
type: str type: str
sample: my.com sample: my.com
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,21 +9,21 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
---
module: gconftool2 module: gconftool2
author: author:
- Kenneth D. Evensen (@kevensen) - Kenneth D. Evensen (@kevensen)
short_description: Edit GNOME Configurations short_description: Edit GNOME Configurations
description: description:
- This module allows for the manipulation of GNOME 2 Configuration via gconftool-2. Please see the gconftool-2(1) man pages for more details. - This module allows for the manipulation of GNOME 2 Configuration using C(gconftool-2). Please see the gconftool-2(1) man pages
for more details.
seealso: seealso:
- name: C(gconftool-2) command manual page - name: C(gconftool-2) command manual page
description: Manual page for the command. description: Manual page for the command.
link: https://help.gnome.org/admin//system-admin-guide/2.32/gconf-6.html.en link: https://help.gnome.org/admin//system-admin-guide/2.32/gconf-6.html.en
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -33,36 +33,37 @@ options:
key: key:
type: str type: str
description: description:
- A GConf preference key is an element in the GConf repository that corresponds to an application preference. - A GConf preference key is an element in the GConf repository that corresponds to an application preference.
required: true required: true
value: value:
type: str type: str
description: description:
- Preference keys typically have simple values such as strings, integers, or lists of strings and integers. This is ignored unless O(state=present). - Preference keys typically have simple values such as strings, integers, or lists of strings and integers. This is
ignored unless O(state=present).
value_type: value_type:
type: str type: str
description: description:
- The type of value being set. This is ignored unless O(state=present). - The type of value being set. This is ignored unless O(state=present).
choices: [bool, float, int, string] choices: [bool, float, int, string]
state: state:
type: str type: str
description: description:
- The action to take upon the key/value. - The action to take upon the key/value.
required: true required: true
choices: [absent, present] choices: [absent, present]
config_source: config_source:
type: str type: str
description: description:
- Specify a configuration source to use rather than the default path. - Specify a configuration source to use rather than the default path.
direct: direct:
description: description:
- Access the config database directly, bypassing server. If O(direct) is specified then the O(config_source) must be specified as well. - Access the config database directly, bypassing server. If O(direct) is specified then the O(config_source) must be
specified as well.
type: bool type: bool
default: false default: false
""" """
EXAMPLES = """ EXAMPLES = r"""
---
- name: Change the widget font to "Serif 12" - name: Change the widget font to "Serif 12"
community.general.gconftool2: community.general.gconftool2:
key: "/desktop/gnome/interface/font_name" key: "/desktop/gnome/interface/font_name"
@ -70,8 +71,7 @@ EXAMPLES = """
value: "Serif 12" value: "Serif 12"
""" """
RETURN = """ RETURN = r"""
---
key: key:
description: The key specified in the module parameters. description: The key specified in the module parameters.
returned: success returned: success
@ -84,15 +84,15 @@ value_type:
sample: string sample: string
value: value:
description: description:
- The value of the preference key after executing the module or V(null) if key is removed. - The value of the preference key after executing the module or V(null) if key is removed.
- From community.general 7.0.0 onwards it returns V(null) for a non-existent O(key), and returned V("") before that. - From community.general 7.0.0 onwards it returns V(null) for a non-existent O(key), and returned V("") before that.
returned: success returned: success
type: str type: str
sample: "Serif 12" sample: "Serif 12"
previous_value: previous_value:
description: description:
- The value of the preference key before executing the module. - The value of the preference key before executing the module.
- From community.general 7.0.0 onwards it returns V(null) for a non-existent O(key), and returned V("") before that. - From community.general 7.0.0 onwards it returns V(null) for a non-existent O(key), and returned V("") before that.
returned: success returned: success
type: str type: str
sample: "Serif 12" sample: "Serif 12"

View File

@ -7,46 +7,43 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
---
module: gconftool2_info module: gconftool2_info
author: author:
- "Alexei Znamensky (@russoz)" - "Alexei Znamensky (@russoz)"
short_description: Retrieve GConf configurations short_description: Retrieve GConf configurations
version_added: 5.1.0 version_added: 5.1.0
description: description:
- This module allows retrieving application preferences from the GConf database, with the help of C(gconftool-2). - This module allows retrieving application preferences from the GConf database, with the help of C(gconftool-2).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
options: options:
key: key:
description: description:
- The key name for an element in the GConf database. - The key name for an element in the GConf database.
type: str type: str
required: true required: true
seealso: seealso:
- name: C(gconftool-2) command manual page - name: C(gconftool-2) command manual page
description: Manual page for the command. description: Manual page for the command.
link: https://help.gnome.org/admin//system-admin-guide/2.32/gconf-6.html.en link: https://help.gnome.org/admin//system-admin-guide/2.32/gconf-6.html.en
- name: gconf repository (archived) - name: gconf repository (archived)
description: Git repository for the project. It is an archived project, so the repository is read-only. description: Git repository for the project. It is an archived project, so the repository is read-only.
link: https://gitlab.gnome.org/Archive/gconf link: https://gitlab.gnome.org/Archive/gconf
""" """
EXAMPLES = """ EXAMPLES = r"""
---
- name: Get value for a certain key in the database. - name: Get value for a certain key in the database.
community.general.gconftool2_info: community.general.gconftool2_info:
key: /desktop/gnome/background/picture_filename key: /desktop/gnome/background/picture_filename
register: result register: result
""" """
RETURN = """ RETURN = r"""
---
value: value:
description: description:
- The value of the property. - The value of the property.
returned: success returned: success
type: str type: str
sample: Monospace 10 sample: Monospace 10

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: gem module: gem
short_description: Manage Ruby gems short_description: Manage Ruby gems
description: description:
@ -49,38 +48,37 @@ options:
repository: repository:
type: str type: str
description: description:
- The repository from which the gem will be installed - The repository from which the gem will be installed.
required: false required: false
aliases: [source] aliases: [source]
user_install: user_install:
description: description:
- Install gem in user's local gems cache or for all users - Install gem in user's local gems cache or for all users.
required: false required: false
type: bool type: bool
default: true default: true
executable: executable:
type: path type: path
description: description:
- Override the path to the gem executable - Override the path to the gem executable.
required: false required: false
install_dir: install_dir:
type: path type: path
description: description:
- Install the gems into a specific directory. - Install the gems into a specific directory. These gems will be independent from the global installed ones. Specifying
These gems will be independent from the global installed ones. this requires user_install to be false.
Specifying this requires user_install to be false.
required: false required: false
bindir: bindir:
type: path type: path
description: description:
- Install executables into a specific directory. - Install executables into a specific directory.
version_added: 3.3.0 version_added: 3.3.0
norc: norc:
type: bool type: bool
default: true default: true
description: description:
- Avoid loading any C(.gemrc) file. Ignored for RubyGems prior to 2.5.2. - Avoid loading any C(.gemrc) file. Ignored for RubyGems prior to 2.5.2.
- The default changed from V(false) to V(true) in community.general 6.0.0. - The default changed from V(false) to V(true) in community.general 6.0.0.
version_added: 3.3.0 version_added: 3.3.0
env_shebang: env_shebang:
description: description:
@ -108,7 +106,7 @@ options:
build_flags: build_flags:
type: str type: str
description: description:
- Allow adding build flags for gem compilation - Allow adding build flags for gem compilation.
required: false required: false
force: force:
description: description:
@ -117,11 +115,11 @@ options:
default: false default: false
type: bool type: bool
author: author:
- "Ansible Core Team" - "Ansible Core Team"
- "Johan Wiren (@johanwiren)" - "Johan Wiren (@johanwiren)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Install version 1.0 of vagrant - name: Install version 1.0 of vagrant
community.general.gem: community.general.gem:
name: vagrant name: vagrant
@ -138,7 +136,7 @@ EXAMPLES = '''
name: rake name: rake
gem_source: /path/to/gems/rake-1.0.gem gem_source: /path/to/gems/rake-1.0.gem
state: present state: present
''' """
import re import re

View File

@ -7,17 +7,17 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
---
module: gio_mime module: gio_mime
author: author:
- "Alexei Znamensky (@russoz)" - "Alexei Znamensky (@russoz)"
short_description: Set default handler for MIME type, for applications using Gnome GIO short_description: Set default handler for MIME type, for applications using Gnome GIO
version_added: 7.5.0 version_added: 7.5.0
description: description:
- This module allows configuring the default handler for a specific MIME type, to be used by applications built with th Gnome GIO API. - This module allows configuring the default handler for a specific MIME type, to be used by applications built with the
Gnome GIO API.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -26,28 +26,27 @@ attributes:
options: options:
mime_type: mime_type:
description: description:
- MIME type for which a default handler will be set. - MIME type for which a default handler will be set.
type: str type: str
required: true required: true
handler: handler:
description: description:
- Default handler will be set for the MIME type. - Default handler will be set for the MIME type.
type: str type: str
required: true required: true
notes: notes:
- This module is a thin wrapper around the C(gio mime) command (and subcommand). - This module is a thin wrapper around the C(gio mime) command (and subcommand).
- See man gio(1) for more details. - See man gio(1) for more details.
seealso: seealso:
- name: C(gio) command manual page - name: C(gio) command manual page
description: Manual page for the command. description: Manual page for the command.
link: https://man.archlinux.org/man/gio.1 link: https://man.archlinux.org/man/gio.1
- name: GIO Documentation - name: GIO Documentation
description: Reference documentation for the GIO API.. description: Reference documentation for the GIO API..
link: https://docs.gtk.org/gio/ link: https://docs.gtk.org/gio/
""" """
EXAMPLES = """ EXAMPLES = r"""
---
- name: Set chrome as the default handler for https - name: Set chrome as the default handler for https
community.general.gio_mime: community.general.gio_mime:
mime_type: x-scheme-handler/https mime_type: x-scheme-handler/https
@ -55,23 +54,22 @@ EXAMPLES = """
register: result register: result
""" """
RETURN = """ RETURN = r"""
---
handler: handler:
description: description:
- The handler set as default. - The handler set as default.
returned: success returned: success
type: str type: str
sample: google-chrome.desktop sample: google-chrome.desktop
stdout: stdout:
description: description:
- The output of the C(gio) command. - The output of the C(gio) command.
returned: success returned: success
type: str type: str
sample: Set google-chrome.desktop as the default for x-scheme-handler/https sample: Set google-chrome.desktop as the default for x-scheme-handler/https
stderr: stderr:
description: description:
- The error output of the C(gio) command. - The error output of the C(gio) command.
returned: failure returned: failure
type: str type: str
sample: 'gio: Failed to load info for handler "never-existed.desktop"' sample: 'gio: Failed to load info for handler "never-existed.desktop"'

View File

@ -11,8 +11,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: git_config module: git_config
author: author:
- Matthew Gamble (@djmattyg007) - Matthew Gamble (@djmattyg007)
@ -20,11 +19,10 @@ author:
requirements: ['git'] requirements: ['git']
short_description: Update git configuration short_description: Update git configuration
description: description:
- The M(community.general.git_config) module changes git configuration by invoking C(git config). - The M(community.general.git_config) module changes git configuration by invoking C(git config). This is needed if you
This is needed if you do not want to use M(ansible.builtin.template) for the entire git do not want to use M(ansible.builtin.template) for the entire git config file (for example because you need to change
config file (for example because you need to change just C(user.email) in just C(user.email) in C(/etc/.git/config)). Solutions involving M(ansible.builtin.command) are cumbersome or do not work
/etc/.git/config). Solutions involving M(ansible.builtin.command) are cumbersome or correctly in check mode.
do not work correctly in check mode.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -36,19 +34,17 @@ options:
list_all: list_all:
description: description:
- List all settings (optionally limited to a given O(scope)). - List all settings (optionally limited to a given O(scope)).
- This option is B(deprecated) and will be removed from community.general 11.0.0. - This option is B(deprecated) and will be removed from community.general 11.0.0. Please use M(community.general.git_config_info)
Please use M(community.general.git_config_info) instead. instead.
type: bool type: bool
default: false default: false
name: name:
description: description:
- The name of the setting. If no value is supplied, the value will - The name of the setting. If no value is supplied, the value will be read from the config if it has been set.
be read from the config if it has been set.
type: str type: str
repo: repo:
description: description:
- Path to a git repository for reading and writing values from a - Path to a git repository for reading and writing values from a specific repo.
specific repo.
type: path type: path
file: file:
description: description:
@ -62,36 +58,34 @@ options:
- If this is set to V(local), you must also specify the O(repo) parameter. - If this is set to V(local), you must also specify the O(repo) parameter.
- If this is set to V(file), you must also specify the O(file) parameter. - If this is set to V(file), you must also specify the O(file) parameter.
- It defaults to system only when not using O(list_all=true). - It defaults to system only when not using O(list_all=true).
choices: [ "file", "local", "global", "system" ] choices: ["file", "local", "global", "system"]
type: str type: str
state: state:
description: description:
- "Indicates the setting should be set/unset. - 'Indicates the setting should be set/unset. This parameter has higher precedence than O(value) parameter: when O(state=absent)
This parameter has higher precedence than O(value) parameter: and O(value) is defined, O(value) is discarded.'
when O(state=absent) and O(value) is defined, O(value) is discarded." choices: ['present', 'absent']
choices: [ 'present', 'absent' ]
default: 'present' default: 'present'
type: str type: str
value: value:
description: description:
- When specifying the name of a single setting, supply a value to - When specifying the name of a single setting, supply a value to set that setting to the given value.
set that setting to the given value. - From community.general 11.0.0 on, O(value) will be required if O(state=present). To read values, use the M(community.general.git_config_info)
- From community.general 11.0.0 on, O(value) will be required if O(state=present). module instead.
To read values, use the M(community.general.git_config_info) module instead.
type: str type: str
add_mode: add_mode:
description: description:
- Specify if a value should replace the existing value(s) or if the new - Specify if a value should replace the existing value(s) or if the new value should be added alongside other values
value should be added alongside other values with the same name. with the same name.
- This option is only relevant when adding/replacing values. If O(state=absent) or - This option is only relevant when adding/replacing values. If O(state=absent) or values are just read out, this option
values are just read out, this option is not considered. is not considered.
choices: [ "add", "replace-all" ] choices: ["add", "replace-all"]
type: str type: str
default: "replace-all" default: "replace-all"
version_added: 8.1.0 version_added: 8.1.0
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Add a setting to ~/.gitconfig - name: Add a setting to ~/.gitconfig
community.general.git_config: community.general.git_config:
name: alias.ci name: alias.ci
@ -147,18 +141,17 @@ EXAMPLES = '''
repo: /etc repo: /etc
scope: local scope: local
value: 'root@{{ ansible_fqdn }}' value: 'root@{{ ansible_fqdn }}'
''' """
RETURN = ''' RETURN = r"""
---
config_value: config_value:
description: When O(list_all=false) and value is not set, a string containing the value of the setting in name description: When O(list_all=false) and value is not set, a string containing the value of the setting in name.
returned: success returned: success
type: str type: str
sample: "vim" sample: "vim"
config_values: config_values:
description: When O(list_all=true), a dict containing key/value pairs of multiple configuration settings description: When O(list_all=true), a dict containing key/value pairs of multiple configuration settings.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -166,7 +159,7 @@ config_values:
color.ui: "auto" color.ui: "auto"
alias.diffc: "diff --cached" alias.diffc: "diff --cached"
alias.remotev: "remote -v" alias.remotev: "remote -v"
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: git_config_info module: git_config_info
author: author:
- Guenther Grill (@guenhter) - Guenther Grill (@guenhter)
@ -19,8 +18,7 @@ version_added: 8.1.0
requirements: ['git'] requirements: ['git']
short_description: Read git configuration short_description: Read git configuration
description: description:
- The M(community.general.git_config_info) module reads the git configuration - The M(community.general.git_config_info) module reads the git configuration by invoking C(git config).
by invoking C(git config).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
@ -44,12 +42,12 @@ options:
- If set to V(system), the system git config is used. O(path) is ignored. - If set to V(system), the system git config is used. O(path) is ignored.
- If set to V(local), O(path) must be set to the repo to read from. - If set to V(local), O(path) must be set to the repo to read from.
- If set to V(file), O(path) must be set to the config file to read from. - If set to V(file), O(path) must be set to the config file to read from.
choices: [ "global", "system", "local", "file" ] choices: ["global", "system", "local", "file"]
default: "system" default: "system"
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Read a system wide config - name: Read a system wide config
community.general.git_config_info: community.general.git_config_info:
name: core.editor name: core.editor
@ -81,14 +79,13 @@ EXAMPLES = '''
community.general.git_config_info: community.general.git_config_info:
scope: file scope: file
path: /etc/gitconfig path: /etc/gitconfig
''' """
RETURN = ''' RETURN = r"""
---
config_value: config_value:
description: > description: >-
When O(name) is set, a string containing the value of the setting in name. If O(name) is not set, empty. When O(name) is set, a string containing the value of the setting in name. If O(name) is not set, empty. If a config key
If a config key such as V(push.pushoption) has more then one entry, just the first one is returned here. such as V(push.pushoption) has more then one entry, just the first one is returned here.
returned: success if O(name) is set returned: success if O(name) is set
type: str type: str
sample: "vim" sample: "vim"
@ -97,8 +94,8 @@ config_values:
description: description:
- This is a dictionary mapping a git configuration setting to a list of its values. - This is a dictionary mapping a git configuration setting to a list of its values.
- When O(name) is not set, all configuration settings are returned here. - When O(name) is not set, all configuration settings are returned here.
- When O(name) is set, only the setting specified in O(name) is returned here. - When O(name) is set, only the setting specified in O(name) is returned here. If that setting is not set, the key will
If that setting is not set, the key will still be present, and its value will be an empty list. still be present, and its value will be an empty list.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -106,7 +103,7 @@ config_values:
color.ui: ["auto"] color.ui: ["auto"]
push.pushoption: ["merge_request.create", "merge_request.draft"] push.pushoption: ["merge_request.create", "merge_request.draft"]
alias.remotev: ["remote -v"] alias.remotev: ["remote -v"]
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,15 +9,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: github_deploy_key module: github_deploy_key
author: "Ali (@bincyber)" author: "Ali (@bincyber)"
short_description: Manages deploy keys for GitHub repositories short_description: Manages deploy keys for GitHub repositories
description: description:
- "Adds or removes deploy keys for GitHub repositories. Supports authentication using username and password, - Adds or removes deploy keys for GitHub repositories. Supports authentication using username and password, username and
username and password and 2-factor authentication code (OTP), OAuth2 token, or personal access token. Admin password and 2-factor authentication code (OTP), OAuth2 token, or personal access token. Admin rights on the repository
rights on the repository are required." are required.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -28,7 +27,7 @@ attributes:
options: options:
github_url: github_url:
description: description:
- The base URL of the GitHub API - The base URL of the GitHub API.
required: false required: false
type: str type: str
version_added: '0.2.0' version_added: '0.2.0'
@ -37,19 +36,19 @@ options:
description: description:
- The name of the individual account or organization that owns the GitHub repository. - The name of the individual account or organization that owns the GitHub repository.
required: true required: true
aliases: [ 'account', 'organization' ] aliases: ['account', 'organization']
type: str type: str
repo: repo:
description: description:
- The name of the GitHub repository. - The name of the GitHub repository.
required: true required: true
aliases: [ 'repository' ] aliases: ['repository']
type: str type: str
name: name:
description: description:
- The name for the deploy key. - The name for the deploy key.
required: true required: true
aliases: [ 'title', 'label' ] aliases: ['title', 'label']
type: str type: str
key: key:
description: description:
@ -58,14 +57,15 @@ options:
type: str type: str
read_only: read_only:
description: description:
- If V(true), the deploy key will only be able to read repository contents. Otherwise, the deploy key will be able to read and write. - If V(true), the deploy key will only be able to read repository contents. Otherwise, the deploy key will be able to
read and write.
type: bool type: bool
default: true default: true
state: state:
description: description:
- The state of the deploy key. - The state of the deploy key.
default: "present" default: "present"
choices: [ "present", "absent" ] choices: ["present", "absent"]
type: str type: str
force: force:
description: description:
@ -74,11 +74,12 @@ options:
default: false default: false
username: username:
description: description:
- The username to authenticate with. Should not be set when using personal access token - The username to authenticate with. Should not be set when using personal access token.
type: str type: str
password: password:
description: description:
- The password to authenticate with. Alternatively, a personal access token can be used instead of O(username) and O(password) combination. - The password to authenticate with. Alternatively, a personal access token can be used instead of O(username) and O(password)
combination.
type: str type: str
token: token:
description: description:
@ -89,10 +90,10 @@ options:
- The 6 digit One Time Password for 2-Factor Authentication. Required together with O(username) and O(password). - The 6 digit One Time Password for 2-Factor Authentication. Required together with O(username) and O(password).
type: int type: int
notes: notes:
- "Refer to GitHub's API documentation here: https://developer.github.com/v3/repos/keys/." - "Refer to GitHub's API documentation here: https://developer.github.com/v3/repos/keys/."
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Add a new read-only deploy key to a GitHub repository using basic authentication - name: Add a new read-only deploy key to a GitHub repository using basic authentication
community.general.github_deploy_key: community.general.github_deploy_key:
owner: "johndoe" owner: "johndoe"
@ -152,33 +153,33 @@ EXAMPLES = '''
read_only: true read_only: true
username: "janedoe" username: "janedoe"
password: "supersecretpassword" password: "supersecretpassword"
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: the status message describing what occurred description: The status message describing what occurred.
returned: always returned: always
type: str type: str
sample: "Deploy key added successfully" sample: "Deploy key added successfully"
http_status_code: http_status_code:
description: the HTTP status code returned by the GitHub API description: The HTTP status code returned by the GitHub API.
returned: failed returned: failed
type: int type: int
sample: 400 sample: 400
error: error:
description: the error message returned by the GitHub API description: The error message returned by the GitHub API.
returned: failed returned: failed
type: str type: str
sample: "key is already in use" sample: "key is already in use"
id: id:
description: the key identifier assigned by GitHub for the deploy key description: The key identifier assigned by GitHub for the deploy key.
returned: changed returned: changed
type: int type: int
sample: 24381901 sample: 24381901
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url from ansible.module_utils.urls import fetch_url

View File

@ -10,7 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: github_issue module: github_issue
short_description: View GitHub issue short_description: View GitHub issue
description: description:
@ -40,24 +40,24 @@ options:
type: int type: int
action: action:
description: description:
- Get various details about issue depending upon action specified. - Get various details about issue depending upon action specified.
default: 'get_status' default: 'get_status'
choices: choices:
- 'get_status' - get_status
type: str type: str
author: author:
- Abhijeet Kasurde (@Akasurde) - Abhijeet Kasurde (@Akasurde)
''' """
RETURN = ''' RETURN = r"""
issue_status: issue_status:
description: State of the GitHub issue description: State of the GitHub issue.
type: str type: str
returned: success returned: success
sample: open, closed sample: open, closed
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Check if GitHub issue is closed or not - name: Check if GitHub issue is closed or not
community.general.github_issue: community.general.github_issue:
organization: ansible organization: ansible
@ -70,7 +70,7 @@ EXAMPLES = '''
ansible.builtin.debug: ansible.builtin.debug:
msg: Do something when issue 23642 is open msg: Do something when issue 23642 is open
when: r.issue_status == 'open' when: r.issue_status == 'open'
''' """
import json import json

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: github_key module: github_key
short_description: Manage GitHub access keys short_description: Manage GitHub access keys
description: description:
@ -29,7 +29,7 @@ options:
type: str type: str
name: name:
description: description:
- SSH key name - SSH key name.
required: true required: true
type: str type: str
pubkey: pubkey:
@ -44,34 +44,36 @@ options:
type: str type: str
force: force:
description: description:
- The default is V(true), which will replace the existing remote key - The default is V(true), which will replace the existing remote key if it is different than O(pubkey). If V(false),
if it is different than O(pubkey). If V(false), the key will only be the key will only be set if no key with the given O(name) exists.
set if no key with the given O(name) exists.
type: bool type: bool
default: true default: true
author: Robert Estelle (@erydo) author: Robert Estelle (@erydo)
''' """
RETURN = ''' RETURN = r"""
deleted_keys: deleted_keys:
description: An array of key objects that were deleted. Only present on state=absent description: An array of key objects that were deleted. Only present on state=absent.
type: list type: list
returned: When state=absent returned: When state=absent
sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': false}] sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ',
'read_only': false}]
matching_keys: matching_keys:
description: An array of keys matching the specified name. Only present on state=present description: An array of keys matching the specified name. Only present on state=present.
type: list type: list
returned: When state=present returned: When state=present
sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': false}] sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ',
'read_only': false}]
key: key:
description: Metadata about the key just created. Only present on state=present description: Metadata about the key just created. Only present on state=present.
type: dict type: dict
returned: success returned: success
sample: {'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': false} sample: {'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ',
''' 'read_only': false}
"""
EXAMPLES = ''' EXAMPLES = r"""
- name: Read SSH public key to authorize - name: Read SSH public key to authorize
ansible.builtin.shell: cat /home/foo/.ssh/id_rsa.pub ansible.builtin.shell: cat /home/foo/.ssh/id_rsa.pub
register: ssh_pub_key register: ssh_pub_key
@ -89,7 +91,7 @@ EXAMPLES = '''
name: Access Key for Some Machine name: Access Key for Some Machine
token: '{{ github_access_token }}' token: '{{ github_access_token }}'
pubkey: "{{ lookup('ansible.builtin.file', '/home/foo/.ssh/id_rsa.pub') }}" pubkey: "{{ lookup('ansible.builtin.file', '/home/foo/.ssh/id_rsa.pub') }}"
''' """
import datetime import datetime
import json import json

View File

@ -9,78 +9,77 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: github_release module: github_release
short_description: Interact with GitHub Releases short_description: Interact with GitHub Releases
description: description:
- Fetch metadata about GitHub Releases - Fetch metadata about GitHub Releases.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
token: token:
description: description:
- GitHub Personal Access Token for authenticating. Mutually exclusive with O(password). - GitHub Personal Access Token for authenticating. Mutually exclusive with O(password).
type: str type: str
user: user:
description: description:
- The GitHub account that owns the repository - The GitHub account that owns the repository.
type: str type: str
required: true required: true
password: password:
description: description:
- The GitHub account password for the user. Mutually exclusive with O(token). - The GitHub account password for the user. Mutually exclusive with O(token).
type: str type: str
repo: repo:
description: description:
- Repository name - Repository name.
type: str type: str
required: true required: true
action: action:
description: description:
- Action to perform - Action to perform.
type: str type: str
required: true required: true
choices: [ 'latest_release', 'create_release' ] choices: ['latest_release', 'create_release']
tag: tag:
description: description:
- Tag name when creating a release. Required when using O(action=create_release). - Tag name when creating a release. Required when using O(action=create_release).
type: str type: str
target: target:
description: description:
- Target of release when creating a release - Target of release when creating a release.
type: str type: str
name: name:
description: description:
- Name of release when creating a release - Name of release when creating a release.
type: str type: str
body: body:
description: description:
- Description of the release when creating a release - Description of the release when creating a release.
type: str type: str
draft: draft:
description: description:
- Sets if the release is a draft or not. (boolean) - Sets if the release is a draft or not. (boolean).
type: bool type: bool
default: false default: false
prerelease: prerelease:
description: description:
- Sets if the release is a prerelease or not. (boolean) - Sets if the release is a prerelease or not. (boolean).
type: bool type: bool
default: false default: false
author: author:
- "Adrian Moisey (@adrianmoisey)" - "Adrian Moisey (@adrianmoisey)"
requirements: requirements:
- "github3.py >= 1.0.0a3" - "github3.py >= 1.0.0a3"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get latest release of a public repository - name: Get latest release of a public repository
community.general.github_release: community.general.github_release:
user: ansible user: ansible
@ -111,16 +110,15 @@ EXAMPLES = '''
target: master target: master
name: My Release name: My Release
body: Some description body: Some description
"""
''' RETURN = r"""
RETURN = '''
tag: tag:
description: Version of the created/latest release. description: Version of the created/latest release.
type: str type: str
returned: success returned: success
sample: 1.1.0 sample: 1.1.0
''' """
import traceback import traceback

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: github_repo module: github_repo
short_description: Manage your repositories on Github short_description: Manage your repositories on Github
version_added: 2.2.0 version_added: 2.2.0
@ -26,81 +25,82 @@ attributes:
options: options:
username: username:
description: description:
- Username used for authentication. - Username used for authentication.
- This is only needed when not using O(access_token). - This is only needed when not using O(access_token).
type: str type: str
required: false required: false
password: password:
description: description:
- Password used for authentication. - Password used for authentication.
- This is only needed when not using O(access_token). - This is only needed when not using O(access_token).
type: str type: str
required: false required: false
access_token: access_token:
description: description:
- Token parameter for authentication. - Token parameter for authentication.
- This is only needed when not using O(username) and O(password). - This is only needed when not using O(username) and O(password).
type: str type: str
required: false required: false
name: name:
description: description:
- Repository name. - Repository name.
type: str type: str
required: true required: true
description: description:
description: description:
- Description for the repository. - Description for the repository.
- Defaults to empty if O(force_defaults=true), which is the default in this module. - Defaults to empty if O(force_defaults=true), which is the default in this module.
- Defaults to empty if O(force_defaults=false) when creating a new repository. - Defaults to empty if O(force_defaults=false) when creating a new repository.
- This is only used when O(state) is V(present). - This is only used when O(state) is V(present).
type: str type: str
required: false required: false
private: private:
description: description:
- Whether the repository should be private or not. - Whether the repository should be private or not.
- Defaults to V(false) if O(force_defaults=true), which is the default in this module. - Defaults to V(false) if O(force_defaults=true), which is the default in this module.
- Defaults to V(false) if O(force_defaults=false) when creating a new repository. - Defaults to V(false) if O(force_defaults=false) when creating a new repository.
- This is only used when O(state=present). - This is only used when O(state=present).
type: bool type: bool
required: false required: false
state: state:
description: description:
- Whether the repository should exist or not. - Whether the repository should exist or not.
type: str type: str
default: present default: present
choices: [ absent, present ] choices: [absent, present]
required: false required: false
organization: organization:
description: description:
- Organization for the repository. - Organization for the repository.
- When O(state=present), the repository will be created in the current user profile. - When O(state=present), the repository will be created in the current user profile.
type: str type: str
required: false required: false
api_url: api_url:
description: description:
- URL to the GitHub API if not using github.com but you own instance. - URL to the GitHub API if not using github.com but you own instance.
type: str type: str
default: 'https://api.github.com' default: 'https://api.github.com'
version_added: "3.5.0" version_added: "3.5.0"
force_defaults: force_defaults:
description: description:
- Overwrite current O(description) and O(private) attributes with defaults if set to V(true), which currently is the default. - Overwrite current O(description) and O(private) attributes with defaults if set to V(true), which currently is the
- The default for this option will be deprecated in a future version of this collection, and eventually change to V(false). default.
- The default for this option will be deprecated in a future version of this collection, and eventually change to V(false).
type: bool type: bool
default: true default: true
required: false required: false
version_added: 4.1.0 version_added: 4.1.0
requirements: requirements:
- PyGithub>=1.54 - PyGithub>=1.54
notes: notes:
- For Python 3, PyGithub>=1.54 should be used. - For Python 3, PyGithub>=1.54 should be used.
- "For Python 3.5, PyGithub==1.54 should be used. More information: U(https://pygithub.readthedocs.io/en/latest/changes.html#version-1-54-november-30-2020)." - 'For Python 3.5, PyGithub==1.54 should be used. More information: U(https://pygithub.readthedocs.io/en/latest/changes.html#version-1-54-november-30-2020).'
- "For Python 2.7, PyGithub==1.45 should be used. More information: U(https://pygithub.readthedocs.io/en/latest/changes.html#version-1-45-december-29-2019)." - 'For Python 2.7, PyGithub==1.45 should be used. More information: U(https://pygithub.readthedocs.io/en/latest/changes.html#version-1-45-december-29-2019).'
author: author:
- Álvaro Torres Cogollo (@atorrescogollo) - Álvaro Torres Cogollo (@atorrescogollo)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a Github repository - name: Create a Github repository
community.general.github_repo: community.general.github_repo:
access_token: mytoken access_token: mytoken
@ -120,14 +120,14 @@ EXAMPLES = '''
name: myrepo name: myrepo
state: absent state: absent
register: result register: result
''' """
RETURN = ''' RETURN = r"""
repo: repo:
description: Repository information as JSON. See U(https://docs.github.com/en/rest/reference/repos#get-a-repository). description: Repository information as JSON. See U(https://docs.github.com/en/rest/reference/repos#get-a-repository).
returned: success and O(state=present) returned: success and O(state=present)
type: dict type: dict
''' """
import traceback import traceback
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib

View File

@ -8,12 +8,11 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: github_webhook module: github_webhook
short_description: Manage GitHub webhooks short_description: Manage GitHub webhooks
description: description:
- "Create and delete GitHub webhooks" - Create and delete GitHub webhooks.
requirements: requirements:
- "PyGithub >= 1.3.5" - "PyGithub >= 1.3.5"
extends_documentation_fragment: extends_documentation_fragment:
@ -26,22 +25,22 @@ attributes:
options: options:
repository: repository:
description: description:
- Full name of the repository to configure a hook for - Full name of the repository to configure a hook for.
type: str type: str
required: true required: true
aliases: aliases:
- repo - repo
url: url:
description: description:
- URL to which payloads will be delivered - URL to which payloads will be delivered.
type: str type: str
required: true required: true
content_type: content_type:
description: description:
- The media type used to serialize the payloads - The media type used to serialize the payloads.
type: str type: str
required: false required: false
choices: [ form, json ] choices: [form, json]
default: form default: form
secret: secret:
description: description:
@ -50,61 +49,57 @@ options:
required: false required: false
insecure_ssl: insecure_ssl:
description: description:
- > - Flag to indicate that GitHub should skip SSL verification when calling the hook.
Flag to indicate that GitHub should skip SSL verification when calling
the hook.
required: false required: false
type: bool type: bool
default: false default: false
events: events:
description: description:
- > - A list of GitHub events the hook is triggered for. Events are listed at U(https://developer.github.com/v3/activity/events/types/).
A list of GitHub events the hook is triggered for. Events are listed at Required unless O(state=absent).
U(https://developer.github.com/v3/activity/events/types/). Required
unless O(state=absent)
required: false required: false
type: list type: list
elements: str elements: str
active: active:
description: description:
- Whether or not the hook is active - Whether or not the hook is active.
required: false required: false
type: bool type: bool
default: true default: true
state: state:
description: description:
- Whether the hook should be present or absent - Whether the hook should be present or absent.
type: str type: str
required: false required: false
choices: [ absent, present ] choices: [absent, present]
default: present default: present
user: user:
description: description:
- User to authenticate to GitHub as - User to authenticate to GitHub as.
type: str type: str
required: true required: true
password: password:
description: description:
- Password to authenticate to GitHub with - Password to authenticate to GitHub with.
type: str type: str
required: false required: false
token: token:
description: description:
- Token to authenticate to GitHub with - Token to authenticate to GitHub with.
type: str type: str
required: false required: false
github_url: github_url:
description: description:
- Base URL of the GitHub API - Base URL of the GitHub API.
type: str type: str
required: false required: false
default: https://api.github.com default: https://api.github.com
author: author:
- "Chris St. Pierre (@stpierre)" - "Chris St. Pierre (@stpierre)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a new webhook that triggers on push (password auth) - name: Create a new webhook that triggers on push (password auth)
community.general.github_webhook: community.general.github_webhook:
repository: ansible/ansible repository: ansible/ansible
@ -135,16 +130,15 @@ EXAMPLES = '''
state: absent state: absent
user: "{{ github_user }}" user: "{{ github_user }}"
password: "{{ github_password }}" password: "{{ github_password }}"
''' """
RETURN = ''' RETURN = r"""
---
hook_id: hook_id:
description: The GitHub ID of the hook created/updated description: The GitHub ID of the hook created/updated.
returned: when state is 'present' returned: when state is 'present'
type: int type: int
sample: 6206 sample: 6206
''' """
import traceback import traceback

View File

@ -8,12 +8,11 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: github_webhook_info module: github_webhook_info
short_description: Query information about GitHub webhooks short_description: Query information about GitHub webhooks
description: description:
- "Query information about GitHub webhooks" - Query information about GitHub webhooks.
requirements: requirements:
- "PyGithub >= 1.3.5" - "PyGithub >= 1.3.5"
extends_documentation_fragment: extends_documentation_fragment:
@ -22,38 +21,38 @@ extends_documentation_fragment:
options: options:
repository: repository:
description: description:
- Full name of the repository to configure a hook for - Full name of the repository to configure a hook for.
type: str type: str
required: true required: true
aliases: aliases:
- repo - repo
user: user:
description: description:
- User to authenticate to GitHub as - User to authenticate to GitHub as.
type: str type: str
required: true required: true
password: password:
description: description:
- Password to authenticate to GitHub with - Password to authenticate to GitHub with.
type: str type: str
required: false required: false
token: token:
description: description:
- Token to authenticate to GitHub with - Token to authenticate to GitHub with.
type: str type: str
required: false required: false
github_url: github_url:
description: description:
- Base URL of the github api - Base URL of the GitHub API.
type: str type: str
required: false required: false
default: https://api.github.com default: https://api.github.com
author: author:
- "Chris St. Pierre (@stpierre)" - "Chris St. Pierre (@stpierre)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: List hooks for a repository (password auth) - name: List hooks for a repository (password auth)
community.general.github_webhook_info: community.general.github_webhook_info:
repository: ansible/ansible repository: ansible/ansible
@ -68,12 +67,11 @@ EXAMPLES = '''
token: "{{ github_user_api_token }}" token: "{{ github_user_api_token }}"
github_url: https://github.example.com/api/v3/ github_url: https://github.example.com/api/v3/
register: myrepo_webhooks register: myrepo_webhooks
''' """
RETURN = ''' RETURN = r"""
---
hooks: hooks:
description: A list of hooks that exist for the repo description: A list of hooks that exist for the repo.
returned: always returned: always
type: list type: list
elements: dict elements: dict
@ -88,7 +86,7 @@ hooks:
"id": 6206, "id": 6206,
"last_response": {"status": "active", "message": "OK", "code": 200} "last_response": {"status": "active", "message": "OK", "code": 200}
} }
''' """
import traceback import traceback

View File

@ -7,7 +7,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_branch module: gitlab_branch
short_description: Create or delete a branch short_description: Create or delete a branch
version_added: 4.2.0 version_added: 4.2.0
@ -50,10 +50,10 @@ options:
- Reference branch to create from. - Reference branch to create from.
- This must be specified if O(state=present). - This must be specified if O(state=present).
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create branch branch2 from main - name: Create branch branch2 from main
community.general.gitlab_branch: community.general.gitlab_branch:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -70,11 +70,10 @@ EXAMPLES = '''
project: "group1/project1" project: "group1/project1"
branch: branch2 branch: branch2
state: absent state: absent
"""
''' RETURN = r"""
"""
RETURN = '''
'''
import traceback import traceback

View File

@ -11,11 +11,11 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_deploy_key module: gitlab_deploy_key
short_description: Manages GitLab project deploy keys short_description: Manages GitLab project deploy keys
description: description:
- Adds, updates and removes project deploy keys - Adds, updates and removes project deploy keys.
author: author:
- Marcus Watkins (@marwatk) - Marcus Watkins (@marwatk)
- Guillaume Martinez (@Lunik) - Guillaume Martinez (@Lunik)
@ -45,7 +45,7 @@ options:
type: str type: str
key: key:
description: description:
- Deploy key - Deploy key.
required: true required: true
type: str type: str
can_push: can_push:
@ -55,14 +55,14 @@ options:
default: false default: false
state: state:
description: description:
- When V(present) the deploy key added to the project if it doesn't exist. - When V(present) the deploy key added to the project if it does not exist.
- When V(absent) it will be removed from the project if it exists. - When V(absent) it will be removed from the project if it exists.
default: present default: present
type: str type: str
choices: [ "present", "absent" ] choices: ["present", "absent"]
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: "Adding a project deploy key" - name: "Adding a project deploy key"
community.general.gitlab_deploy_key: community.general.gitlab_deploy_key:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -88,32 +88,31 @@ EXAMPLES = '''
project: "my_group/my_project" project: "my_group/my_project"
state: absent state: absent
key: "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9w..." key: "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9w..."
"""
''' RETURN = r"""
RETURN = '''
msg: msg:
description: Success or failure message description: Success or failure message.
returned: always returned: always
type: str type: str
sample: "Success" sample: "Success"
result: result:
description: json parsed response from the server description: JSON-parsed response from the server.
returned: always returned: always
type: dict type: dict
error: error:
description: the error message returned by the GitLab API description: The error message returned by the GitLab API.
returned: failed returned: failed
type: str type: str
sample: "400: key is already in use" sample: "400: key is already in use"
deploy_key: deploy_key:
description: API object description: API object.
returned: always returned: always
type: dict type: dict
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,8 +9,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: gitlab_group module: gitlab_group
short_description: Creates/updates/deletes GitLab Groups short_description: Creates/updates/deletes GitLab Groups
description: description:
@ -97,12 +96,12 @@ options:
type: str type: str
parent: parent:
description: description:
- Allow to create subgroups - Allow to create subgroups.
- Id or Full path of parent group in the form of group/name - Id or Full path of parent group in the form of group/name.
type: str type: str
path: path:
description: description:
- The path of the group you want to create, this will be api_url/group_path - The path of the group you want to create, this will be api_url/group_path.
- If not supplied, the group_name will be used. - If not supplied, the group_name will be used.
type: str type: str
prevent_forking_outside_group: prevent_forking_outside_group:
@ -146,7 +145,7 @@ options:
version_added: 3.7.0 version_added: 3.7.0
state: state:
description: description:
- create or delete group. - Create or delete group.
- Possible values are present and absent. - Possible values are present and absent.
default: present default: present
type: str type: str
@ -164,7 +163,7 @@ options:
version_added: 9.5.0 version_added: 9.5.0
visibility: visibility:
description: description:
- Default visibility of the group - Default visibility of the group.
choices: ["private", "internal", "public"] choices: ["private", "internal", "public"]
default: private default: private
type: str type: str
@ -176,9 +175,9 @@ options:
choices: ["enabled", "private", "disabled"] choices: ["enabled", "private", "disabled"]
type: str type: str
version_added: 9.5.0 version_added: 9.5.0
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: "Delete GitLab Group" - name: "Delete GitLab Group"
community.general.gitlab_group: community.general.gitlab_group:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -221,31 +220,31 @@ EXAMPLES = '''
project_creation_level: noone project_creation_level: noone
auto_devops_enabled: false auto_devops_enabled: false
subgroup_creation_level: maintainer subgroup_creation_level: maintainer
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: Success or failure message description: Success or failure message.
returned: always returned: always
type: str type: str
sample: "Success" sample: "Success"
result: result:
description: json parsed response from the server description: JSON-parsed response from the server.
returned: always returned: always
type: dict type: dict
error: error:
description: the error message returned by the GitLab API description: The error message returned by the GitLab API.
returned: failed returned: failed
type: str type: str
sample: "400: path is already in use" sample: "400: path is already in use"
group: group:
description: API object description: API object.
returned: always returned: always
type: dict type: dict
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -12,7 +12,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
module: gitlab_group_access_token module: gitlab_group_access_token
short_description: Manages GitLab group access tokens short_description: Manages GitLab group access tokens
version_added: 8.4.0 version_added: 8.4.0
@ -27,11 +27,10 @@ extends_documentation_fragment:
- community.general.gitlab - community.general.gitlab
- community.general.attributes - community.general.attributes
notes: notes:
- Access tokens can not be changed. If a parameter needs to be changed, an acceess token has to be recreated. - Access tokens can not be changed. If a parameter needs to be changed, an acceess token has to be recreated. Whether tokens
Whether tokens will be recreated is controlled by the O(recreate) option, which defaults to V(never). will be recreated is controlled by the O(recreate) option, which defaults to V(never).
- Token string is contained in the result only when access token is created or recreated. It can not be fetched afterwards. - Token string is contained in the result only when access token is created or recreated. It can not be fetched afterwards.
- Token matching is done by comparing O(name) option. - Token matching is done by comparing O(name) option.
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -56,7 +55,8 @@ options:
type: list type: list
elements: str elements: str
aliases: ["scope"] aliases: ["scope"]
choices: ["api", "read_api", "read_registry", "write_registry", "read_repository", "write_repository", "create_runner", "ai_features", "k8s_proxy"] choices: ["api", "read_api", "read_registry", "write_registry", "read_repository", "write_repository", "create_runner",
"ai_features", "k8s_proxy"]
access_level: access_level:
description: description:
- Access level of the access token. - Access level of the access token.
@ -84,10 +84,10 @@ options:
- When V(absent) it will be removed from the group if it exists. - When V(absent) it will be removed from the group if it exists.
default: present default: present
type: str type: str
choices: [ "present", "absent" ] choices: ["present", "absent"]
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: "Creating a group access token" - name: "Creating a group access token"
community.general.gitlab_group_access_token: community.general.gitlab_group_access_token:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -131,16 +131,16 @@ EXAMPLES = r'''
- write_repository - write_repository
recreate: state_change recreate: state_change
state: present state: present
''' """
RETURN = r''' RETURN = r"""
access_token: access_token:
description: description:
- API object. - API object.
- Only contains the value of the token if the token was created or recreated. - Only contains the value of the token if the token was created or recreated.
returned: success and O(state=present) returned: success and O(state=present)
type: dict type: dict
''' """
from datetime import datetime from datetime import datetime

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: gitlab_group_members module: gitlab_group_members
short_description: Manage group members on GitLab Server short_description: Manage group members on GitLab Server
description: description:
@ -81,16 +80,16 @@ options:
type: str type: str
purge_users: purge_users:
description: description:
- Adds/remove users of the given access_level to match the given O(gitlab_user)/O(gitlab_users_access) list. - Adds/remove users of the given access_level to match the given O(gitlab_user)/O(gitlab_users_access) list. If omitted
If omitted do not purge orphaned members. do not purge orphaned members.
- Is only used when O(state=present). - Is only used when O(state=present).
type: list type: list
elements: str elements: str
choices: ['guest', 'reporter', 'developer', 'maintainer', 'owner'] choices: ['guest', 'reporter', 'developer', 'maintainer', 'owner']
version_added: 3.6.0 version_added: 3.6.0
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Add a user to a GitLab Group - name: Add a user to a GitLab Group
community.general.gitlab_group_members: community.general.gitlab_group_members:
api_url: 'https://gitlab.example.com' api_url: 'https://gitlab.example.com'
@ -152,9 +151,9 @@ EXAMPLES = r'''
- name: user2 - name: user2
access_level: maintainer access_level: maintainer
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,15 +9,15 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
module: gitlab_group_variable module: gitlab_group_variable
short_description: Creates, updates, or deletes GitLab groups variables short_description: Creates, updates, or deletes GitLab groups variables
version_added: 1.2.0 version_added: 1.2.0
description: description:
- Creates a group variable if it does not exist. - Creates a group variable if it does not exist.
- When a group variable does exist, its value will be updated when the values are different. - When a group variable does exist, its value will be updated when the values are different.
- Variables which are untouched in the playbook, but are not untouched in the GitLab group, - Variables which are untouched in the playbook, but are not untouched in the GitLab group, they stay untouched (O(purge=false))
they stay untouched (O(purge=false)) or will be deleted (O(purge=true)). or will be deleted (O(purge=true)).
author: author:
- Florent Madiot (@scodeman) - Florent Madiot (@scodeman)
requirements: requirements:
@ -53,8 +53,8 @@ options:
vars: vars:
description: description:
- When the list element is a simple key-value pair, masked, raw and protected will be set to false. - When the list element is a simple key-value pair, masked, raw and protected will be set to false.
- When the list element is a dict with the keys C(value), C(masked), C(raw) and C(protected), the user can - When the list element is a dict with the keys C(value), C(masked), C(raw) and C(protected), the user can have full
have full control about whether a value should be masked, raw, protected or both. control about whether a value should be masked, raw, protected or both.
- Support for group variables requires GitLab >= 9.5. - Support for group variables requires GitLab >= 9.5.
- Support for environment_scope requires GitLab Premium >= 13.11. - Support for environment_scope requires GitLab Premium >= 13.11.
- Support for protected values requires GitLab >= 9.3. - Support for protected values requires GitLab >= 9.3.
@ -62,8 +62,8 @@ options:
- Support for raw values requires GitLab >= 15.7. - Support for raw values requires GitLab >= 15.7.
- A C(value) must be a string or a number. - A C(value) must be a string or a number.
- Field C(variable_type) must be a string with either V(env_var), which is the default, or V(file). - Field C(variable_type) must be a string with either V(env_var), which is the default, or V(file).
- When a value is masked, it must be in Base64 and have a length of at least 8 characters. - When a value is masked, it must be in Base64 and have a length of at least 8 characters. See GitLab documentation
See GitLab documentation on acceptable values for a masked variable (U(https://docs.gitlab.com/ce/ci/variables/#masked-variables)). on acceptable values for a masked variable (U(https://docs.gitlab.com/ce/ci/variables/#masked-variables)).
default: {} default: {}
type: dict type: dict
variables: variables:
@ -106,17 +106,17 @@ options:
description: description:
- Whether a variable is an environment variable (V(env_var)) or a file (V(file)). - Whether a variable is an environment variable (V(env_var)) or a file (V(file)).
type: str type: str
choices: [ "env_var", "file" ] choices: ["env_var", "file"]
default: env_var default: env_var
environment_scope: environment_scope:
description: description:
- The scope for the variable. - The scope for the variable.
type: str type: str
default: '*' default: '*'
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Set or update some CI/CD variables - name: Set or update some CI/CD variables
community.general.gitlab_group_variable: community.general.gitlab_group_variable:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -173,9 +173,9 @@ EXAMPLES = r'''
state: absent state: absent
vars: vars:
ACCESS_KEY_ID: abc123 ACCESS_KEY_ID: abc123
''' """
RETURN = r''' RETURN = r"""
group_variable: group_variable:
description: Four lists of the variablenames which were added, updated, removed or exist. description: Four lists of the variablenames which were added, updated, removed or exist.
returned: always returned: always
@ -201,7 +201,7 @@ group_variable:
returned: always returned: always
type: list type: list
sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -11,12 +11,11 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: gitlab_hook module: gitlab_hook
short_description: Manages GitLab project hooks short_description: Manages GitLab project hooks
description: description:
- Adds, updates and removes project hook - Adds, updates and removes project hook.
author: author:
- Marcus Watkins (@marwatk) - Marcus Watkins (@marwatk)
- Guillaume Martinez (@Lunik) - Guillaume Martinez (@Lunik)
@ -46,11 +45,11 @@ options:
type: str type: str
state: state:
description: description:
- When V(present) the hook will be updated to match the input or created if it doesn't exist. - When V(present) the hook will be updated to match the input or created if it does not exist.
- When V(absent) hook will be deleted if it exists. - When V(absent) hook will be deleted if it exists.
default: present default: present
type: str type: str
choices: [ "present", "absent" ] choices: ["present", "absent"]
push_events: push_events:
description: description:
- Trigger hook on push events. - Trigger hook on push events.
@ -58,7 +57,7 @@ options:
default: true default: true
push_events_branch_filter: push_events_branch_filter:
description: description:
- Branch name of wildcard to trigger hook on push events - Branch name of wildcard to trigger hook on push events.
type: str type: str
version_added: '0.2.0' version_added: '0.2.0'
default: '' default: ''
@ -107,7 +106,7 @@ options:
- Whether GitLab will do SSL verification when triggering the hook. - Whether GitLab will do SSL verification when triggering the hook.
type: bool type: bool
default: false default: false
aliases: [ enable_ssl_verification ] aliases: [enable_ssl_verification]
token: token:
description: description:
- Secret token to validate hook messages at the receiver. - Secret token to validate hook messages at the receiver.
@ -115,9 +114,9 @@ options:
- Will show up in the X-GitLab-Token HTTP request header. - Will show up in the X-GitLab-Token HTTP request header.
required: false required: false
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: "Adding a project hook" - name: "Adding a project hook"
community.general.gitlab_hook: community.general.gitlab_hook:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -144,31 +143,31 @@ EXAMPLES = '''
project: 10 project: 10
hook_url: "https://my-ci-server.example.com/gitlab-hook" hook_url: "https://my-ci-server.example.com/gitlab-hook"
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: Success or failure message description: Success or failure message.
returned: always returned: always
type: str type: str
sample: "Success" sample: "Success"
result: result:
description: json parsed response from the server description: Json parsed response from the server.
returned: always returned: always
type: dict type: dict
error: error:
description: the error message returned by the GitLab API description: The error message returned by the GitLab API.
returned: failed returned: failed
type: str type: str
sample: "400: path is already in use" sample: "400: path is already in use"
hook: hook:
description: API object description: API object.
returned: always returned: always
type: dict type: dict
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -10,7 +10,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
module: gitlab_instance_variable module: gitlab_instance_variable
short_description: Creates, updates, or deletes GitLab instance variables short_description: Creates, updates, or deletes GitLab instance variables
version_added: 7.1.0 version_added: 7.1.0
@ -18,8 +18,8 @@ description:
- Creates a instance variable if it does not exist. - Creates a instance variable if it does not exist.
- When a instance variable does exist, its value will be updated if the values are different. - When a instance variable does exist, its value will be updated if the values are different.
- Support for instance variables requires GitLab >= 13.0. - Support for instance variables requires GitLab >= 13.0.
- Variables which are not mentioned in the modules options, but are present on the GitLab instance, - Variables which are not mentioned in the modules options, but are present on the GitLab instance, will either stay (O(purge=false))
will either stay (O(purge=false)) or will be deleted (O(purge=true)). or will be deleted (O(purge=true)).
author: author:
- Benedikt Braunger (@benibr) - Benedikt Braunger (@benibr)
requirements: requirements:
@ -78,12 +78,12 @@ options:
description: description:
- Whether a variable is an environment variable (V(env_var)) or a file (V(file)). - Whether a variable is an environment variable (V(env_var)) or a file (V(file)).
type: str type: str
choices: [ "env_var", "file" ] choices: ["env_var", "file"]
default: env_var default: env_var
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Set or update some CI/CD variables - name: Set or update some CI/CD variables
community.general.gitlab_instance_variable: community.general.gitlab_instance_variable:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -105,9 +105,9 @@ EXAMPLES = r'''
state: absent state: absent
variables: variables:
- name: ACCESS_KEY_ID - name: ACCESS_KEY_ID
''' """
RETURN = r''' RETURN = r"""
instance_variable: instance_variable:
description: Four lists of the variablenames which were added, updated, removed or exist. description: Four lists of the variablenames which were added, updated, removed or exist.
returned: always returned: always
@ -133,7 +133,7 @@ instance_variable:
returned: always returned: always
type: list type: list
sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -12,7 +12,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_issue module: gitlab_issue
short_description: Create, update, or delete GitLab issues short_description: Create, update, or delete GitLab issues
version_added: '8.1.0' version_added: '8.1.0'
@ -97,10 +97,10 @@ options:
- A title for the issue. The title is used as a unique identifier to ensure idempotency. - A title for the issue. The title is used as a unique identifier to ensure idempotency.
type: str type: str
required: true required: true
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create Issue - name: Create Issue
community.general.gitlab_issue: community.general.gitlab_issue:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -109,10 +109,10 @@ EXAMPLES = '''
title: "Ansible demo Issue" title: "Ansible demo Issue"
description: "Demo Issue description" description: "Demo Issue description"
labels: labels:
- Ansible - Ansible
- Demo - Demo
assignee_ids: assignee_ids:
- testassignee - testassignee
state_filter: "opened" state_filter: "opened"
state: present state: present
@ -124,9 +124,9 @@ EXAMPLES = '''
title: "Ansible demo Issue" title: "Ansible demo Issue"
state_filter: "opened" state_filter: "opened"
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: Success or failure message. description: Success or failure message.
returned: always returned: always
@ -137,7 +137,7 @@ issue:
description: API object. description: API object.
returned: success returned: success
type: dict type: dict
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -7,9 +7,9 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_label module: gitlab_label
short_description: Creates/updates/deletes GitLab Labels belonging to project or group. short_description: Creates/updates/deletes GitLab Labels belonging to project or group
version_added: 8.3.0 version_added: 8.3.0
description: description:
- When a label does not exist, it will be created. - When a label does not exist, it will be created.
@ -45,12 +45,12 @@ options:
required: false required: false
project: project:
description: description:
- The path and name of the project. Either this or O(group) is required. - The path and name of the project. Either this or O(group) is required.
required: false required: false
type: str type: str
group: group:
description: description:
- The path of the group. Either this or O(project) is required. - The path of the group. Either this or O(project) is required.
required: false required: false
type: str type: str
labels: labels:
@ -76,21 +76,21 @@ options:
- Integer value to give priority to the label. - Integer value to give priority to the label.
type: int type: int
required: false required: false
default: null default:
description: description:
description: description:
- Label's description. - Label's description.
type: str type: str
default: null default:
new_name: new_name:
description: description:
- Optional field to change label's name. - Optional field to change label's name.
type: str type: str
default: null default:
''' """
EXAMPLES = ''' EXAMPLES = r"""
# same project's task can be executed for group # same project's task can be executed for group
- name: Create one Label - name: Create one Label
community.general.gitlab_label: community.general.gitlab_label:
@ -185,9 +185,9 @@ EXAMPLES = '''
labels: labels:
- name: label-abc123 - name: label-abc123
- name: label-two - name: label-two
''' """
RETURN = ''' RETURN = r"""
labels: labels:
description: Four lists of the labels which were added, updated, removed or exist. description: Four lists of the labels which were added, updated, removed or exist.
returned: success returned: success
@ -217,7 +217,7 @@ labels_obj:
description: API object. description: API object.
returned: success returned: success
type: dict type: dict
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -12,7 +12,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_merge_request module: gitlab_merge_request
short_description: Create, update, or delete GitLab merge requests short_description: Create, update, or delete GitLab merge requests
version_added: 7.1.0 version_added: 7.1.0
@ -21,8 +21,7 @@ description:
- When a single merge request does exist, it will be updated if the provided parameters are different. - When a single merge request does exist, it will be updated if the provided parameters are different.
- When a single merge request does exist and O(state=absent), the merge request will be deleted. - When a single merge request does exist and O(state=absent), the merge request will be deleted.
- When multiple merge requests are detected, the task fails. - When multiple merge requests are detected, the task fails.
- Existing merge requests are matched based on O(title), O(source_branch), O(target_branch), - Existing merge requests are matched based on O(title), O(source_branch), O(target_branch), and O(state_filter) filters.
and O(state_filter) filters.
author: author:
- zvaraondrej (@zvaraondrej) - zvaraondrej (@zvaraondrej)
requirements: requirements:
@ -102,10 +101,10 @@ options:
- Comma separated list of reviewers usernames omitting V(@) character. - Comma separated list of reviewers usernames omitting V(@) character.
- Set to empty string to unassign all reviewers. - Set to empty string to unassign all reviewers.
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create Merge Request from branch1 to branch2 - name: Create Merge Request from branch1 to branch2
community.general.gitlab_merge_request: community.general.gitlab_merge_request:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -117,7 +116,7 @@ EXAMPLES = '''
description: "Demo MR description" description: "Demo MR description"
labels: "Ansible,Demo" labels: "Ansible,Demo"
state_filter: "opened" state_filter: "opened"
remove_source_branch: True remove_source_branch: true
state: present state: present
- name: Delete Merge Request from branch1 to branch2 - name: Delete Merge Request from branch1 to branch2
@ -130,9 +129,9 @@ EXAMPLES = '''
title: "Ansible demo MR" title: "Ansible demo MR"
state_filter: "opened" state_filter: "opened"
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: Success or failure message. description: Success or failure message.
returned: always returned: always
@ -143,7 +142,7 @@ mr:
description: API object. description: API object.
returned: success returned: success
type: dict type: dict
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -7,7 +7,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_milestone module: gitlab_milestone
short_description: Creates/updates/deletes GitLab Milestones belonging to project or group short_description: Creates/updates/deletes GitLab Milestones belonging to project or group
version_added: 8.3.0 version_added: 8.3.0
@ -83,10 +83,10 @@ options:
- Milestone's description. - Milestone's description.
type: str type: str
default: null default: null
''' """
EXAMPLES = ''' EXAMPLES = r"""
# same project's task can be executed for group # same project's task can be executed for group
- name: Create one milestone - name: Create one milestone
community.general.gitlab_milestone: community.general.gitlab_milestone:
@ -169,9 +169,9 @@ EXAMPLES = '''
milestones: milestones:
- title: milestone-abc123 - title: milestone-abc123
- title: milestone-two - title: milestone-two
''' """
RETURN = ''' RETURN = r"""
milestones: milestones:
description: Four lists of the milestones which were added, updated, removed or exist. description: Four lists of the milestones which were added, updated, removed or exist.
returned: success returned: success
@ -201,7 +201,7 @@ milestones_obj:
description: API object. description: API object.
returned: success returned: success
type: dict type: dict
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -9,8 +9,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: gitlab_project module: gitlab_project
short_description: Creates/updates/deletes GitLab Projects short_description: Creates/updates/deletes GitLab Projects
description: description:
@ -179,8 +178,7 @@ options:
default: true default: true
lfs_enabled: lfs_enabled:
description: description:
- Enable Git large file systems to manages large files such - Enable Git large file systems to manages large files such as audio, video, and graphics files.
as audio, video, and graphics files.
type: bool type: bool
required: false required: false
default: false default: false
@ -331,9 +329,9 @@ options:
- If an wiki for this project should be available or not. - If an wiki for this project should be available or not.
type: bool type: bool
default: true default: true
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create GitLab Project - name: Create GitLab Project
community.general.gitlab_project: community.general.gitlab_project:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -378,9 +376,9 @@ EXAMPLES = r'''
api_password: "{{ initial_root_password }}" api_password: "{{ initial_root_password }}"
name: my_second_project name: my_second_project
group: "10481470" group: "10481470"
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: Success or failure message. description: Success or failure message.
returned: always returned: always
@ -388,12 +386,12 @@ msg:
sample: "Success" sample: "Success"
result: result:
description: json parsed response from the server. description: JSON-parsed response from the server.
returned: always returned: always
type: dict type: dict
error: error:
description: the error message returned by the GitLab API. description: The error message returned by the GitLab API.
returned: failed returned: failed
type: str type: str
sample: "400: path is already in use" sample: "400: path is already in use"
@ -402,7 +400,7 @@ project:
description: API object. description: API object.
returned: always returned: always
type: dict type: dict
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -12,7 +12,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
module: gitlab_project_access_token module: gitlab_project_access_token
short_description: Manages GitLab project access tokens short_description: Manages GitLab project access tokens
version_added: 8.4.0 version_added: 8.4.0
@ -27,11 +27,10 @@ extends_documentation_fragment:
- community.general.gitlab - community.general.gitlab
- community.general.attributes - community.general.attributes
notes: notes:
- Access tokens can not be changed. If a parameter needs to be changed, an acceess token has to be recreated. - Access tokens can not be changed. If a parameter needs to be changed, an acceess token has to be recreated. Whether tokens
Whether tokens will be recreated is controlled by the O(recreate) option, which defaults to V(never). will be recreated is controlled by the O(recreate) option, which defaults to V(never).
- Token string is contained in the result only when access token is created or recreated. It can not be fetched afterwards. - Token string is contained in the result only when access token is created or recreated. It can not be fetched afterwards.
- Token matching is done by comparing O(name) option. - Token matching is done by comparing O(name) option.
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -56,7 +55,8 @@ options:
type: list type: list
elements: str elements: str
aliases: ["scope"] aliases: ["scope"]
choices: ["api", "read_api", "read_registry", "write_registry", "read_repository", "write_repository", "create_runner", "ai_features", "k8s_proxy"] choices: ["api", "read_api", "read_registry", "write_registry", "read_repository", "write_repository", "create_runner",
"ai_features", "k8s_proxy"]
access_level: access_level:
description: description:
- Access level of the access token. - Access level of the access token.
@ -84,10 +84,10 @@ options:
- When V(absent) it will be removed from the project if it exists. - When V(absent) it will be removed from the project if it exists.
default: present default: present
type: str type: str
choices: [ "present", "absent" ] choices: ["present", "absent"]
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: "Creating a project access token" - name: "Creating a project access token"
community.general.gitlab_project_access_token: community.general.gitlab_project_access_token:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -131,16 +131,16 @@ EXAMPLES = r'''
- write_repository - write_repository
recreate: state_change recreate: state_change
state: present state: present
''' """
RETURN = r''' RETURN = r"""
access_token: access_token:
description: description:
- API object. - API object.
- Only contains the value of the token if the token was created or recreated. - Only contains the value of the token if the token was created or recreated.
returned: success and O(state=present) returned: success and O(state=present)
type: dict type: dict
''' """
from datetime import datetime from datetime import datetime

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: gitlab_project_badge module: gitlab_project_badge
short_description: Manage project badges on GitLab Server short_description: Manage project badges on GitLab Server
version_added: 6.1.0 version_added: 6.1.0
@ -57,9 +56,9 @@ options:
- A badge is identified by this URL. - A badge is identified by this URL.
required: true required: true
type: str type: str
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Add a badge to a GitLab Project - name: Add a badge to a GitLab Project
community.general.gitlab_project_badge: community.general.gitlab_project_badge:
api_url: 'https://example.gitlab.com' api_url: 'https://example.gitlab.com'
@ -77,9 +76,9 @@ EXAMPLES = r'''
state: absent state: absent
link_url: 'https://example.gitlab.com/%{project_path}' link_url: 'https://example.gitlab.com/%{project_path}'
image_url: 'https://example.gitlab.com/%{project_path}/badges/%{default_branch}/pipeline.svg' image_url: 'https://example.gitlab.com/%{project_path}/badges/%{default_branch}/pipeline.svg'
''' """
RETURN = ''' RETURN = r"""
badge: badge:
description: The badge information. description: The badge information.
returned: when O(state=present) returned: when O(state=present)
@ -91,7 +90,7 @@ badge:
rendered_link_url: 'http://example.com/ci_status.svg?project=example-org/example-project&ref=master' rendered_link_url: 'http://example.com/ci_status.svg?project=example-org/example-project&ref=master'
rendered_image_url: 'https://shields.io/my/badge' rendered_image_url: 'https://shields.io/my/badge'
kind: project kind: project
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,8 +9,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: gitlab_project_members module: gitlab_project_members
short_description: Manage project members on GitLab Server short_description: Manage project members on GitLab Server
version_added: 2.2.0 version_added: 2.2.0
@ -82,16 +81,16 @@ options:
type: str type: str
purge_users: purge_users:
description: description:
- Adds/remove users of the given access_level to match the given O(gitlab_user)/O(gitlab_users_access) list. - Adds/remove users of the given access_level to match the given O(gitlab_user)/O(gitlab_users_access) list. If omitted
If omitted do not purge orphaned members. do not purge orphaned members.
- Is only used when O(state=present). - Is only used when O(state=present).
type: list type: list
elements: str elements: str
choices: ['guest', 'reporter', 'developer', 'maintainer'] choices: ['guest', 'reporter', 'developer', 'maintainer']
version_added: 3.7.0 version_added: 3.7.0
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Add a user to a GitLab Project - name: Add a user to a GitLab Project
community.general.gitlab_project_members: community.general.gitlab_project_members:
api_url: 'https://gitlab.example.com' api_url: 'https://gitlab.example.com'
@ -154,9 +153,9 @@ EXAMPLES = r'''
- name: user2 - name: user2
access_level: maintainer access_level: maintainer
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -7,14 +7,14 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_project_variable module: gitlab_project_variable
short_description: Creates/updates/deletes GitLab Projects Variables short_description: Creates/updates/deletes GitLab Projects Variables
description: description:
- When a project variable does not exist, it will be created. - When a project variable does not exist, it will be created.
- When a project variable does exist, its value will be updated when the values are different. - When a project variable does exist, its value will be updated when the values are different.
- Variables which are untouched in the playbook, but are not untouched in the GitLab project, - Variables which are untouched in the playbook, but are not untouched in the GitLab project, they stay untouched (O(purge=false))
they stay untouched (O(purge=false)) or will be deleted (O(purge=true)). or will be deleted (O(purge=true)).
author: author:
- "Markus Bergholz (@markuman)" - "Markus Bergholz (@markuman)"
requirements: requirements:
@ -51,8 +51,8 @@ options:
vars: vars:
description: description:
- When the list element is a simple key-value pair, masked, raw and protected will be set to false. - When the list element is a simple key-value pair, masked, raw and protected will be set to false.
- When the list element is a dict with the keys C(value), C(masked), C(raw) and C(protected), the user can - When the list element is a dict with the keys C(value), C(masked), C(raw) and C(protected), the user can have full
have full control about whether a value should be masked, raw, protected or both. control about whether a value should be masked, raw, protected or both.
- Support for protected values requires GitLab >= 9.3. - Support for protected values requires GitLab >= 9.3.
- Support for masked values requires GitLab >= 11.10. - Support for masked values requires GitLab >= 11.10.
- Support for raw values requires GitLab >= 15.7. - Support for raw values requires GitLab >= 15.7.
@ -61,8 +61,8 @@ options:
- A C(value) must be a string or a number. - A C(value) must be a string or a number.
- Field C(variable_type) must be a string with either V(env_var), which is the default, or V(file). - Field C(variable_type) must be a string with either V(env_var), which is the default, or V(file).
- Field C(environment_scope) must be a string defined by scope environment. - Field C(environment_scope) must be a string defined by scope environment.
- When a value is masked, it must be in Base64 and have a length of at least 8 characters. - When a value is masked, it must be in Base64 and have a length of at least 8 characters. See GitLab documentation
See GitLab documentation on acceptable values for a masked variable (https://docs.gitlab.com/ce/ci/variables/#masked-variables). on acceptable values for a masked variable (https://docs.gitlab.com/ce/ci/variables/#masked-variables).
default: {} default: {}
type: dict type: dict
variables: variables:
@ -116,10 +116,10 @@ options:
- Support for O(variables[].environment_scope) requires GitLab Premium >= 13.11. - Support for O(variables[].environment_scope) requires GitLab Premium >= 13.11.
type: str type: str
default: '*' default: '*'
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Set or update some CI/CD variables - name: Set or update some CI/CD variables
community.general.gitlab_project_variable: community.general.gitlab_project_variable:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -190,9 +190,9 @@ EXAMPLES = '''
state: absent state: absent
vars: vars:
ACCESS_KEY_ID: abc123 ACCESS_KEY_ID: abc123
''' """
RETURN = ''' RETURN = r"""
project_variable: project_variable:
description: Four lists of the variablenames which were added, updated, removed or exist. description: Four lists of the variablenames which were added, updated, removed or exist.
returned: always returned: always
@ -218,7 +218,7 @@ project_variable:
returned: always returned: always
type: list type: list
sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -7,7 +7,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: gitlab_protected_branch module: gitlab_protected_branch
short_description: Manage protection of existing branches short_description: Manage protection of existing branches
version_added: 3.4.0 version_added: 3.4.0
@ -58,10 +58,10 @@ options:
default: maintainer default: maintainer
type: str type: str
choices: ["maintainer", "developer", "nobody"] choices: ["maintainer", "developer", "nobody"]
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create protected branch on main - name: Create protected branch on main
community.general.gitlab_protected_branch: community.general.gitlab_protected_branch:
api_url: https://gitlab.com api_url: https://gitlab.com
@ -70,11 +70,10 @@ EXAMPLES = '''
name: main name: main
merge_access_levels: maintainer merge_access_levels: maintainer
push_access_level: nobody push_access_level: nobody
"""
''' RETURN = r"""
"""
RETURN = '''
'''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -10,33 +10,31 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: gitlab_runner module: gitlab_runner
short_description: Create, modify and delete GitLab Runners short_description: Create, modify and delete GitLab Runners
description: description:
- Register, update and delete runners on GitLab Server side with the GitLab API. - Register, update and delete runners on GitLab Server side with the GitLab API.
- All operations are performed using the GitLab API v4. - All operations are performed using the GitLab API v4.
- For details, consult the full API documentation at U(https://docs.gitlab.com/ee/api/runners.html) - For details, consult the full API documentation at U(https://docs.gitlab.com/ee/api/runners.html) and
and U(https://docs.gitlab.com/ee/api/users.html#create-a-runner-linked-to-a-user). U(https://docs.gitlab.com/ee/api/users.html#create-a-runner-linked-to-a-user).
- A valid private API token is required for all operations. You can create as many tokens as you like using the GitLab web interface at - A valid private API token is required for all operations. You can create as many tokens as you like using the GitLab web
U(https://$GITLAB_URL/profile/personal_access_tokens). interface at U(https://$GITLAB_URL/profile/personal_access_tokens).
- A valid registration token is required for registering a new runner. - A valid registration token is required for registering a new runner. To create shared runners, you need to ask your administrator
To create shared runners, you need to ask your administrator to give you this token. to give you this token. It can be found at U(https://$GITLAB_URL/admin/runners/).
It can be found at U(https://$GITLAB_URL/admin/runners/). - This module does not handle the C(gitlab-runner) process part, but only manages the runner on GitLab Server side through
- This module does not handle the C(gitlab-runner) process part, but only manages the runner on GitLab Server side through its API. its API. Once the module has created the runner, you may use the generated token to run C(gitlab-runner register) command.
Once the module has created the runner, you may use the generated token to run C(gitlab-runner register) command
notes: notes:
- To create a new runner at least the O(api_token), O(description) and O(api_url) options are required. - To create a new runner at least the O(api_token), O(description) and O(api_url) options are required.
- Runners need to have unique descriptions, since this attribute is used as key for idempotency - Runners need to have unique descriptions, since this attribute is used as key for idempotency.
author: author:
- Samy Coenen (@SamyCoenen) - Samy Coenen (@SamyCoenen)
- Guillaume Martinez (@Lunik) - Guillaume Martinez (@Lunik)
requirements: requirements:
- python-gitlab >= 1.5.0 for legacy runner registration workflow - python-gitlab >= 1.5.0 for legacy runner registration workflow (runner registration token -
(runner registration token - U(https://docs.gitlab.com/runner/register/#register-with-a-runner-registration-token-deprecated)) U(https://docs.gitlab.com/runner/register/#register-with-a-runner-registration-token-deprecated))
- python-gitlab >= 4.0.0 for new runner registration workflow - python-gitlab >= 4.0.0 for new runner registration workflow (runner authentication token -
(runner authentication token - U(https://docs.gitlab.com/runner/register/#register-with-a-runner-authentication-token)) U(https://docs.gitlab.com/runner/register/#register-with-a-runner-authentication-token))
extends_documentation_fragment: extends_documentation_fragment:
- community.general.auth_basic - community.general.auth_basic
- community.general.gitlab - community.general.gitlab
@ -73,7 +71,8 @@ options:
- name - name
state: state:
description: description:
- Make sure that the runner with the same name exists with the same configuration or delete the runner with the same name. - Make sure that the runner with the same name exists with the same configuration or delete the runner with the same
name.
required: false required: false
default: present default: present
choices: ["present", "absent"] choices: ["present", "absent"]
@ -118,12 +117,12 @@ options:
access_level: access_level:
description: description:
- Determines if a runner can pick up jobs only from protected branches. - Determines if a runner can pick up jobs only from protected branches.
- If O(access_level_on_creation) is not explicitly set to V(true), this option is ignored on registration and - If O(access_level_on_creation) is not explicitly set to V(true), this option is ignored on registration and is only
is only applied on updates. applied on updates.
- If set to V(not_protected), runner can pick up jobs from both protected and unprotected branches. - If set to V(not_protected), runner can pick up jobs from both protected and unprotected branches.
- If set to V(ref_protected), runner can pick up jobs only from protected branches. - If set to V(ref_protected), runner can pick up jobs only from protected branches.
- Before community.general 8.0.0 the default was V(ref_protected). This was changed to no default in community.general 8.0.0. - Before community.general 8.0.0 the default was V(ref_protected). This was changed to no default in community.general
If this option is not specified explicitly, GitLab will use V(not_protected) on creation, and the value set 8.0.0. If this option is not specified explicitly, GitLab will use V(not_protected) on creation, and the value set
will not be changed on any updates. will not be changed on any updates.
required: false required: false
choices: ["not_protected", "ref_protected"] choices: ["not_protected", "ref_protected"]
@ -156,9 +155,9 @@ options:
default: [] default: []
type: list type: list
elements: str elements: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create an instance-level runner - name: Create an instance-level runner
community.general.gitlab_runner: community.general.gitlab_runner:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -234,31 +233,31 @@ EXAMPLES = '''
state: present state: present
project: mygroup/mysubgroup/myproject project: mygroup/mysubgroup/myproject
register: runner # Register module output to run C(gitlab-runner register) command in another task register: runner # Register module output to run C(gitlab-runner register) command in another task
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: Success or failure message description: Success or failure message.
returned: always returned: always
type: str type: str
sample: "Success" sample: "Success"
result: result:
description: json parsed response from the server description: JSON-parsed response from the server.
returned: always returned: always
type: dict type: dict
error: error:
description: the error message returned by the GitLab API description: The error message returned by the GitLab API.
returned: failed returned: failed
type: str type: str
sample: "400: path is already in use" sample: "400: path is already in use"
runner: runner:
description: API object description: API object.
returned: always returned: always
type: dict type: dict
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -10,8 +10,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: gitlab_user module: gitlab_user
short_description: Creates/updates/deletes/blocks/unblocks GitLab Users short_description: Creates/updates/deletes/blocks/unblocks GitLab Users
description: description:
@ -88,13 +87,8 @@ options:
type: str type: str
access_level: access_level:
description: description:
- The access level to the group. One of the following can be used. - The access level to the group.
- guest - The value V(master) is an alias for V(maintainer).
- reporter
- developer
- master (alias for maintainer)
- maintainer
- owner
default: guest default: guest
type: str type: str
choices: ["guest", "reporter", "developer", "master", "maintainer", "owner"] choices: ["guest", "reporter", "developer", "master", "maintainer", "owner"]
@ -128,7 +122,7 @@ options:
suboptions: suboptions:
provider: provider:
description: description:
- The name of the external identity provider - The name of the external identity provider.
type: str type: str
extern_uid: extern_uid:
description: description:
@ -143,9 +137,9 @@ options:
type: bool type: bool
default: false default: false
version_added: 3.3.0 version_added: 3.3.0
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: "Delete GitLab User" - name: "Delete GitLab User"
community.general.gitlab_user: community.general.gitlab_user:
api_url: https://gitlab.example.com/ api_url: https://gitlab.example.com/
@ -179,8 +173,8 @@ EXAMPLES = '''
password: mysecretpassword password: mysecretpassword
email: me@example.com email: me@example.com
identities: identities:
- provider: Keycloak - provider: Keycloak
extern_uid: f278f95c-12c7-4d51-996f-758cc2eb11bc extern_uid: f278f95c-12c7-4d51-996f-758cc2eb11bc
state: present state: present
group: super_group/mon_group group: super_group/mon_group
access_level: owner access_level: owner
@ -198,31 +192,31 @@ EXAMPLES = '''
api_token: "{{ access_token }}" api_token: "{{ access_token }}"
username: myusername username: myusername
state: unblocked state: unblocked
''' """
RETURN = ''' RETURN = r"""
msg: msg:
description: Success or failure message description: Success or failure message.
returned: always returned: always
type: str type: str
sample: "Success" sample: "Success"
result: result:
description: json parsed response from the server description: JSON-parsed response from the server.
returned: always returned: always
type: dict type: dict
error: error:
description: the error message returned by the GitLab API description: The error message returned by the GitLab API.
returned: failed returned: failed
type: str type: str
sample: "400: path is already in use" sample: "400: path is already in use"
user: user:
description: API object description: API object.
returned: always returned: always
type: dict type: dict
''' """
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec

View File

@ -9,13 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: grove module: grove
short_description: Sends a notification to a grove.io channel short_description: Sends a notification to a grove.io channel
description: description:
- The C(grove) module sends a message for a service to a Grove.io - The C(grove) module sends a message for a service to a Grove.io channel.
channel.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -32,7 +30,7 @@ options:
service: service:
type: str type: str
description: description:
- Name of the service (displayed as the "user" in the message) - Name of the service (displayed as the "user" in the message).
required: false required: false
default: ansible default: ansible
message_content: message_content:
@ -44,29 +42,29 @@ options:
url: url:
type: str type: str
description: description:
- Service URL for the web client - Service URL for the web client.
required: false required: false
icon_url: icon_url:
type: str type: str
description: description:
- Icon for the service - Icon for the service.
required: false required: false
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates will not be validated. This should only be used - If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using
on personally controlled sites using self-signed certificates. self-signed certificates.
default: true default: true
type: bool type: bool
author: "Jonas Pfenniger (@zimbatm)" author: "Jonas Pfenniger (@zimbatm)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Sends a notification to a grove.io channel - name: Sends a notification to a grove.io channel
community.general.grove: community.general.grove:
channel_token: 6Ph62VBBJOccmtTPZbubiPzdrhipZXtg channel_token: 6Ph62VBBJOccmtTPZbubiPzdrhipZXtg
service: my-app service: my-app
message: 'deployed {{ target }}' message: 'deployed {{ target }}'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.parse import urlencode from ansible.module_utils.six.moves.urllib.parse import urlencode

View File

@ -9,21 +9,18 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: gunicorn module: gunicorn
short_description: Run gunicorn with various settings short_description: Run gunicorn with various settings
description: description:
- Starts gunicorn with the parameters specified. Common settings for gunicorn - Starts gunicorn with the parameters specified. Common settings for gunicorn configuration are supported. For additional
configuration are supported. For additional configuration use a config file configuration use a config file See U(https://gunicorn-docs.readthedocs.io/en/latest/settings.html) for more options.
See U(https://gunicorn-docs.readthedocs.io/en/latest/settings.html) for more It's recommended to always use the chdir option to avoid problems with the location of the app.
options. It's recommended to always use the chdir option to avoid problems
with the location of the app.
requirements: [gunicorn] requirements: [gunicorn]
author: author:
- "Alejandro Gomez (@agmezr)" - "Alejandro Gomez (@agmezr)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -40,37 +37,36 @@ options:
type: path type: path
aliases: ['virtualenv'] aliases: ['virtualenv']
description: description:
- 'Path to the virtualenv directory.' - Path to the virtualenv directory.
config: config:
type: path type: path
description: description:
- 'Path to the gunicorn configuration file.' - Path to the gunicorn configuration file.
aliases: ['conf'] aliases: ['conf']
chdir: chdir:
type: path type: path
description: description:
- 'Chdir to specified directory before apps loading.' - Chdir to specified directory before apps loading.
pid: pid:
type: path type: path
description: description:
- 'A filename to use for the PID file. If not set and not found on the configuration file a tmp - A filename to use for the PID file. If not set and not found on the configuration file a tmp pid file will be created
pid file will be created to check a successful run of gunicorn.' to check a successful run of gunicorn.
worker: worker:
type: str type: str
choices: ['sync', 'eventlet', 'gevent', 'tornado ', 'gthread', 'gaiohttp'] choices: ['sync', 'eventlet', 'gevent', 'tornado ', 'gthread', 'gaiohttp']
description: description:
- 'The type of workers to use. The default class (sync) should handle most "normal" types of workloads.' - The type of workers to use. The default class (sync) should handle most "normal" types of workloads.
user: user:
type: str type: str
description: description:
- 'Switch worker processes to run as this user.' - Switch worker processes to run as this user.
notes: notes:
- If not specified on config file, a temporary error log will be created on /tmp dir. - If not specified on config file, a temporary error log will be created on /tmp dir. Please make sure you have write access
Please make sure you have write access in /tmp dir. Not needed but will help you to in /tmp dir. Not needed but will help you to identify any problem with configuration.
identify any problem with configuration. """
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Simple gunicorn run example - name: Simple gunicorn run example
community.general.gunicorn: community.general.gunicorn:
app: 'wsgi' app: 'wsgi'
@ -96,15 +92,15 @@ EXAMPLES = '''
venv: '/workspace/example/venv' venv: '/workspace/example/venv'
pid: '/workspace/example/gunicorn.pid' pid: '/workspace/example/gunicorn.pid'
user: 'ansible' user: 'ansible'
''' """
RETURN = ''' RETURN = r"""
gunicorn: gunicorn:
description: process id of gunicorn description: Process id of gunicorn.
returned: changed returned: changed
type: str type: str
sample: "1234" sample: "1234"
''' """
import os import os
import time import time