-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into create_volume
- Loading branch information
Showing
23 changed files
with
317 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/7129-adding_set_secure_boot_command_to_redfish_config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- redfish_config - adding ``SetSecureBoot`` command (https://github.com/ansible-collections/community.general/pull/7129). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- random_string - added new ``ignore_similar_chars`` and ``similar_chars`` option to ignore certain chars (https://github.com/ansible-collections/community.general/pull/7242). |
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/7251-gitlab-variables-deleteing-all-variables.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bugfixes: | ||
- gitlab_project_variable - deleted all variables when used with ``purge=true`` due to missing ``raw`` property in KNOWN attributes (https://github.com/ansible-collections/community.general/issues/7250). | ||
- gitlab_group_variable - deleted all variables when used with ``purge=true`` due to missing ``raw`` property in KNOWN attributes (https://github.com/ansible-collections/community.general/issues/7250). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2022, Alexei Znamensky <[email protected]> | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt | ||
|
||
|
||
def gio_mime_runner(module, **kwargs): | ||
return CmdRunner( | ||
module, | ||
command=['gio', 'mime'], | ||
arg_formats=dict( | ||
mime_type=cmd_runner_fmt.as_list(), | ||
handler=cmd_runner_fmt.as_list(), | ||
), | ||
**kwargs | ||
) | ||
|
||
|
||
def gio_mime_get(runner, mime_type): | ||
def process(rc, out, err): | ||
if err.startswith("No default applications for"): | ||
return None | ||
out = out.splitlines()[0] | ||
return out.split()[-1] | ||
|
||
with runner("mime_type", output_process=process) as ctx: | ||
return ctx.run(mime_type=mime_type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2022, Alexei Znamensky <[email protected]> | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
DOCUMENTATION = ''' | ||
module: gio_mime | ||
author: | ||
- "Alexei Znamensky (@russoz)" | ||
short_description: Set default handler for MIME type, for applications using Gnome GIO | ||
version_added: 7.5.0 | ||
description: | ||
- This module allows configuring the default handler for a specific MIME type, to be used by applications built with th Gnome GIO API. | ||
extends_documentation_fragment: | ||
- community.general.attributes | ||
attributes: | ||
check_mode: | ||
support: full | ||
diff_mode: | ||
support: full | ||
options: | ||
mime_type: | ||
description: | ||
- MIME type for which a default handler will be set. | ||
type: str | ||
required: true | ||
handler: | ||
description: | ||
- Default handler will be set for the MIME type. | ||
type: str | ||
required: true | ||
notes: | ||
- This module is a thin wrapper around the C(gio mime) command (and subcommand). | ||
- See man gio(1) for more details. | ||
seealso: | ||
- name: GIO Documentation | ||
description: Reference documentation for the GIO API.. | ||
link: https://docs.gtk.org/gio/ | ||
''' | ||
|
||
EXAMPLES = """ | ||
- name: Set chrome as the default handler for https | ||
community.general.gio_mime: | ||
mime_type: x-scheme-handler/https | ||
handler: google-chrome.desktop | ||
register: result | ||
""" | ||
|
||
RETURN = ''' | ||
handler: | ||
description: | ||
- The handler set as default. | ||
returned: success | ||
type: str | ||
sample: google-chrome.desktop | ||
stdout: | ||
description: | ||
- The output of the C(gio) command. | ||
returned: success | ||
type: str | ||
sample: Set google-chrome.desktop as the default for x-scheme-handler/https | ||
stderr: | ||
description: | ||
- The error output of the C(gio) command. | ||
returned: failure | ||
type: str | ||
sample: 'gio: Failed to load info for handler "never-existed.desktop"' | ||
''' | ||
|
||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper | ||
from ansible_collections.community.general.plugins.module_utils.gio_mime import gio_mime_runner, gio_mime_get | ||
|
||
|
||
class GioMime(ModuleHelper): | ||
output_params = ['handler'] | ||
module = dict( | ||
argument_spec=dict( | ||
mime_type=dict(type='str', required=True), | ||
handler=dict(type='str', required=True), | ||
), | ||
supports_check_mode=True, | ||
) | ||
|
||
def __init_module__(self): | ||
self.runner = gio_mime_runner(self.module, check_rc=True) | ||
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True) | ||
|
||
def __run__(self): | ||
check_mode_return = (0, 'Module executed in check mode', '') | ||
if self.vars.has_changed("handler"): | ||
with self.runner.context(args_order=["mime_type", "handler"], check_mode_skip=True, check_mode_return=check_mode_return) as ctx: | ||
rc, out, err = ctx.run() | ||
self.vars.stdout = out | ||
self.vars.stderr = err | ||
if self.verbosity >= 4: | ||
self.vars.run_info = ctx.run_info | ||
|
||
|
||
def main(): | ||
GioMime.execute() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.