mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-30 18:36:28 +00:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8919a545d3 | ||
|
|
59b6126320 | ||
|
|
3778ec8000 | ||
|
|
440ee9c3fe | ||
|
|
39a49e4d98 | ||
|
|
51d8c4b5fd | ||
|
|
f1fbdd4a6c | ||
|
|
5f44c4ed50 | ||
|
|
e530d2906a | ||
|
|
18c53b8bd1 | ||
|
|
bff9afc1f1 | ||
|
|
374ba70c37 | ||
|
|
9da26ea3eb | ||
|
|
c6689b6245 | ||
|
|
8860faaa1c | ||
|
|
824cb0e0a4 | ||
|
|
78625d1cd2 | ||
|
|
a15ec28169 | ||
|
|
12637fbd23 | ||
|
|
21aa086ca6 | ||
|
|
8590184232 | ||
|
|
19257bac40 | ||
|
|
79120c0f96 | ||
|
|
efe3462856 | ||
|
|
0cff5dec9f | ||
|
|
0280b1ca5d | ||
|
|
ab95360b97 | ||
|
|
ae7656b8da | ||
|
|
216e9e28c3 | ||
|
|
7309650d26 | ||
|
|
ee2963d1ee | ||
|
|
469ba26c8f | ||
|
|
5cb24c2599 | ||
|
|
4621fce535 | ||
|
|
f16dbd6b56 | ||
|
|
377a599372 | ||
|
|
a2c7f9f89a | ||
|
|
3033dfa27c | ||
|
|
721d2bd35d | ||
|
|
42e2b5147f | ||
|
|
3d42ad4c6c | ||
|
|
fb00ba1b0a | ||
|
|
cdfc73b059 | ||
|
|
5b06814575 | ||
|
|
69fc892002 | ||
|
|
8ae47d3a8d | ||
|
|
17d2a089a0 | ||
|
|
e4261abab0 | ||
|
|
cf94d4b01e | ||
|
|
8930d03c7c | ||
|
|
e741e22ec4 | ||
|
|
1e9217197f | ||
|
|
8da2ff61d5 | ||
|
|
9c57bb4f60 | ||
|
|
f32bcd34ef | ||
|
|
cc7ba7938a | ||
|
|
c0684e8a72 | ||
|
|
f648dca84a | ||
|
|
084ecd96e1 | ||
|
|
9cdeb5a9b9 | ||
|
|
dbcd0dc497 | ||
|
|
0e73d6a593 | ||
|
|
c9df20808d | ||
|
|
649b32759b | ||
|
|
9d7855b844 | ||
|
|
4480036401 | ||
|
|
5ae8d2ccec | ||
|
|
1f9d6787fb | ||
|
|
95175e056f | ||
|
|
44960de208 | ||
|
|
7c46b7edbc | ||
|
|
2fa8179df2 | ||
|
|
8a7f360558 | ||
|
|
15d4fff749 | ||
|
|
6d582acb26 | ||
|
|
4044998ff5 | ||
|
|
b35f138976 | ||
|
|
8fd40ed9e4 | ||
|
|
02de34c46b | ||
|
|
0813907a89 | ||
|
|
04fb53e8a3 | ||
|
|
f1d9a2b134 | ||
|
|
619ea5b7b3 | ||
|
|
4b9ece4fbd | ||
|
|
31f0087da9 | ||
|
|
50ae8fd7ae | ||
|
|
b72e38c909 | ||
|
|
42997e2d28 | ||
|
|
6df72406c5 | ||
|
|
93d23cfef6 | ||
|
|
ac6c6df2c7 | ||
|
|
1d28e48d85 | ||
|
|
cc93dab0fd | ||
|
|
cddb570e0e | ||
|
|
c573891160 | ||
|
|
6481c4edfa | ||
|
|
768f16e9c4 | ||
|
|
d487734fea | ||
|
|
5be39ee0c3 | ||
|
|
9db4aad986 | ||
|
|
b593c673b1 |
@@ -11,8 +11,7 @@ Keep in mind that Azure Pipelines does not enforce unique job display names (onl
|
||||
It is up to pipeline authors to avoid name collisions when deviating from the recommended format.
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import re
|
||||
@@ -24,12 +23,12 @@ def main():
|
||||
"""Main program entry point."""
|
||||
source_directory = sys.argv[1]
|
||||
|
||||
if '/ansible_collections/' in os.getcwd():
|
||||
if "/ansible_collections/" in os.getcwd():
|
||||
output_path = "tests/output"
|
||||
else:
|
||||
output_path = "test/results"
|
||||
|
||||
destination_directory = os.path.join(output_path, 'coverage')
|
||||
destination_directory = os.path.join(output_path, "coverage")
|
||||
|
||||
if not os.path.exists(destination_directory):
|
||||
os.makedirs(destination_directory)
|
||||
@@ -38,27 +37,27 @@ def main():
|
||||
count = 0
|
||||
|
||||
for name in os.listdir(source_directory):
|
||||
match = re.search('^Coverage (?P<attempt>[0-9]+) (?P<label>.+)$', name)
|
||||
label = match.group('label')
|
||||
attempt = int(match.group('attempt'))
|
||||
match = re.search("^Coverage (?P<attempt>[0-9]+) (?P<label>.+)$", name)
|
||||
label = match.group("label")
|
||||
attempt = int(match.group("attempt"))
|
||||
jobs[label] = max(attempt, jobs.get(label, 0))
|
||||
|
||||
for label, attempt in jobs.items():
|
||||
name = 'Coverage {attempt} {label}'.format(label=label, attempt=attempt)
|
||||
name = "Coverage {attempt} {label}".format(label=label, attempt=attempt)
|
||||
source = os.path.join(source_directory, name)
|
||||
source_files = os.listdir(source)
|
||||
|
||||
for source_file in source_files:
|
||||
source_path = os.path.join(source, source_file)
|
||||
destination_path = os.path.join(destination_directory, source_file + '.' + label)
|
||||
destination_path = os.path.join(destination_directory, source_file + "." + label)
|
||||
print('"%s" -> "%s"' % (source_path, destination_path))
|
||||
shutil.copyfile(source_path, destination_path)
|
||||
count += 1
|
||||
|
||||
print('Coverage file count: %d' % count)
|
||||
print('##vso[task.setVariable variable=coverageFileCount]%d' % count)
|
||||
print('##vso[task.setVariable variable=outputPath]%s' % output_path)
|
||||
print("Coverage file count: %d" % count)
|
||||
print("##vso[task.setVariable variable=coverageFileCount]%d" % count)
|
||||
print("##vso[task.setVariable variable=outputPath]%s" % output_path)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -34,8 +34,8 @@ class Args:
|
||||
|
||||
def parse_args() -> Args:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-n', '--dry-run', action='store_true')
|
||||
parser.add_argument('path', type=pathlib.Path)
|
||||
parser.add_argument("-n", "--dry-run", action="store_true")
|
||||
parser.add_argument("path", type=pathlib.Path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -48,12 +48,14 @@ def parse_args() -> Args:
|
||||
|
||||
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
|
||||
processed = []
|
||||
for file in directory.joinpath('reports').glob('coverage*.xml'):
|
||||
name = file.stem.replace('coverage=', '')
|
||||
for file in directory.joinpath("reports").glob("coverage*.xml"):
|
||||
name = file.stem.replace("coverage=", "")
|
||||
|
||||
# Get flags from name
|
||||
flags = name.replace('-powershell', '').split('=') # Drop '-powershell' suffix
|
||||
flags = [flag if not flag.startswith('stub') else flag.split('-')[0] for flag in flags] # Remove "-01" from stub files
|
||||
flags = name.replace("-powershell", "").split("=") # Drop '-powershell' suffix
|
||||
flags = [
|
||||
flag if not flag.startswith("stub") else flag.split("-")[0] for flag in flags
|
||||
] # Remove "-01" from stub files
|
||||
|
||||
processed.append(CoverageFile(name, file, flags))
|
||||
|
||||
@@ -64,14 +66,16 @@ def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], d
|
||||
for file in files:
|
||||
cmd = [
|
||||
str(codecov_bin),
|
||||
'--name', file.name,
|
||||
'--file', str(file.path),
|
||||
"--name",
|
||||
file.name,
|
||||
"--file",
|
||||
str(file.path),
|
||||
]
|
||||
for flag in file.flags:
|
||||
cmd.extend(['--flags', flag])
|
||||
cmd.extend(["--flags", flag])
|
||||
|
||||
if dry_run:
|
||||
print(f'DRY-RUN: Would run command: {cmd}')
|
||||
print(f"DRY-RUN: Would run command: {cmd}")
|
||||
continue
|
||||
|
||||
subprocess.run(cmd, check=True)
|
||||
@@ -79,11 +83,11 @@ def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], d
|
||||
|
||||
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None:
|
||||
if dry_run:
|
||||
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
|
||||
print(f"DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}")
|
||||
return
|
||||
|
||||
with urllib.request.urlopen(url) as resp:
|
||||
with dest.open('w+b') as f:
|
||||
with dest.open("w+b") as f:
|
||||
# Read data in chunks rather than all at once
|
||||
shutil.copyfileobj(resp, f, 64 * 1024)
|
||||
|
||||
@@ -92,14 +96,14 @@ def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = Fals
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
url = 'https://ansible-ci-files.s3.amazonaws.com/codecov/linux/codecov'
|
||||
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
|
||||
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
|
||||
url = "https://ansible-ci-files.s3.amazonaws.com/codecov/linux/codecov"
|
||||
with tempfile.TemporaryDirectory(prefix="codecov-") as tmpdir:
|
||||
codecov_bin = pathlib.Path(tmpdir) / "codecov"
|
||||
download_file(url, codecov_bin, 0o755, args.dry_run)
|
||||
|
||||
files = process_files(args.path)
|
||||
upload_files(codecov_bin, files, args.dry_run)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import time
|
||||
@@ -16,14 +15,14 @@ def main():
|
||||
"""Main program entry point."""
|
||||
start = time.time()
|
||||
|
||||
sys.stdin.reconfigure(errors='surrogateescape')
|
||||
sys.stdout.reconfigure(errors='surrogateescape')
|
||||
sys.stdin.reconfigure(errors="surrogateescape")
|
||||
sys.stdout.reconfigure(errors="surrogateescape")
|
||||
|
||||
for line in sys.stdin:
|
||||
seconds = time.time() - start
|
||||
sys.stdout.write('%02d:%02d %s' % (seconds // 60, seconds % 60, line))
|
||||
sys.stdout.write("%02d:%02d %s" % (seconds // 60, seconds % 60, line))
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
34
.devcontainer/devcontainer.json
Normal file
34
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "community.general devcontainer",
|
||||
"image": "mcr.microsoft.com/devcontainers/python:3.14-bookworm",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"python.pythonPath": "/usr/local/bin/python",
|
||||
"editor.defaultFormatter": "charliermarsh.ruff",
|
||||
"editor.formatOnSave": true,
|
||||
"files.autoSave": "afterDelay",
|
||||
"files.eol": "\n",
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true,
|
||||
"files.trimTrailingWhitespace": true
|
||||
},
|
||||
"extensions": [
|
||||
"charliermarsh.ruff",
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"redhat.ansible",
|
||||
"redhat.vscode-yaml",
|
||||
"trond-snekvik.simple-rst",
|
||||
]
|
||||
}
|
||||
},
|
||||
"remoteUser": "vscode",
|
||||
"postCreateCommand": ".devcontainer/setup.sh",
|
||||
"workspaceFolder": "/workspace/ansible_collections/community/general",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/ansible_collections/community/general,type=bind"
|
||||
}
|
||||
3
.devcontainer/devcontainer.json.license
Normal file
3
.devcontainer/devcontainer.json.license
Normal file
@@ -0,0 +1,3 @@
|
||||
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
|
||||
SPDX-FileCopyrightText: 2025 Alexei Znamensky <russoz@gmail.com>
|
||||
10
.devcontainer/requirements-dev.txt
Normal file
10
.devcontainer/requirements-dev.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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
|
||||
# SPDX-FileCopyrightText: 2025 Alexei Znamensky <russoz@gmail.com>
|
||||
|
||||
nox
|
||||
ruff
|
||||
antsibull-nox
|
||||
pre-commit
|
||||
ansible-core
|
||||
andebox
|
||||
16
.devcontainer/setup.sh
Executable file
16
.devcontainer/setup.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) Ansible Project
|
||||
# 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
|
||||
|
||||
sudo chown -R vscode:vscode /workspace/
|
||||
|
||||
pip install -U pip
|
||||
pip install -r .devcontainer/requirements-dev.txt
|
||||
pip install -r tests/unit/requirements.txt
|
||||
|
||||
export ANSIBLE_COLLECTIONS_PATH=/workspace:${ANSIBLE_COLLECTIONS_PATH}
|
||||
ansible-galaxy collection install -v -r tests/unit/requirements.yml
|
||||
ansible-galaxy collection install -v -r tests/integration/requirements.yml
|
||||
|
||||
pre-commit install
|
||||
@@ -10,3 +10,4 @@ eaa5e07b2866e05b6c7b5628ca92e9cb1142d008
|
||||
|
||||
# Code reformatting
|
||||
340ff8586d4f1cb6a0f3c934eb42589bcc29c0ea
|
||||
e530d2906a1f61df89861286ac57c951a247f32c
|
||||
|
||||
16
.github/BOTMETA.yml
vendored
16
.github/BOTMETA.yml
vendored
@@ -368,6 +368,8 @@ files:
|
||||
$module_utils/jenkins.py:
|
||||
labels: jenkins
|
||||
maintainers: russoz
|
||||
$module_utils/_lxc.py:
|
||||
maintainers: russoz
|
||||
$module_utils/manageiq.py:
|
||||
labels: manageiq
|
||||
maintainers: $team_manageiq
|
||||
@@ -592,6 +594,8 @@ files:
|
||||
$modules/filesystem.py:
|
||||
labels: filesystem
|
||||
maintainers: pilou- abulimov quidame
|
||||
$modules/file_remove.py:
|
||||
maintainers: shahargolshani
|
||||
$modules/flatpak.py:
|
||||
maintainers: $team_flatpak
|
||||
$modules/flatpak_remote.py:
|
||||
@@ -743,6 +747,8 @@ files:
|
||||
maintainers: obourdon hryamzik
|
||||
$modules/ip_netns.py:
|
||||
maintainers: bregman-arie
|
||||
$modules/ip2location_info.py:
|
||||
maintainers: ip2location
|
||||
$modules/ipa_:
|
||||
maintainers: $team_ipa
|
||||
ignore: fxfitz
|
||||
@@ -929,6 +935,10 @@ files:
|
||||
maintainers: conloos
|
||||
$modules/lxd_project.py:
|
||||
maintainers: we10710aa
|
||||
$modules/lxd_storage_pool_info.py:
|
||||
maintainers: smcavoy
|
||||
$modules/lxd_storage_volume_info.py:
|
||||
maintainers: smcavoy
|
||||
$modules/macports.py:
|
||||
ignore: ryansb
|
||||
keywords: brew cask darwin homebrew macosx macports osx
|
||||
@@ -1494,7 +1504,9 @@ files:
|
||||
maintainers: vbotka
|
||||
$tests/fqdn_valid.py:
|
||||
maintainers: vbotka
|
||||
#########################
|
||||
$modules/sssd_info.py:
|
||||
maintainers: a-gabidullin
|
||||
#########################
|
||||
docs/docsite/rst/filter_guide.rst: {}
|
||||
docs/docsite/rst/filter_guide_abstract_informations.rst: {}
|
||||
docs/docsite/rst/filter_guide_abstract_informations_counting_elements_in_sequence.rst:
|
||||
@@ -1563,7 +1575,7 @@ files:
|
||||
maintainers: russoz
|
||||
docs/docsite/rst/test_guide.rst:
|
||||
maintainers: felixfontein
|
||||
#########################
|
||||
#########################
|
||||
tests/:
|
||||
labels: tests
|
||||
tests/integration:
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -146,7 +146,7 @@ body:
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: |
|
||||
Read the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
|
||||
Read the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
|
||||
options:
|
||||
- label: I agree to follow the Ansible Code of Conduct
|
||||
required: true
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -7,7 +7,7 @@
|
||||
blank_issues_enabled: false # default: true
|
||||
contact_links:
|
||||
- name: Security bug report
|
||||
url: https://docs.ansible.com/ansible-core/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
|
||||
url: https://docs.ansible.com/projects/ansible-core/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
|
||||
about: |
|
||||
Please learn how to report security vulnerabilities here.
|
||||
|
||||
@@ -16,12 +16,12 @@ contact_links:
|
||||
a prompt response.
|
||||
|
||||
For more information, see
|
||||
https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html
|
||||
https://docs.ansible.com/projects/ansible/latest/community/reporting_bugs_and_features.html
|
||||
- name: Ansible Code of Conduct
|
||||
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
|
||||
url: https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
|
||||
about: Be nice to other members of the community.
|
||||
- name: Talks to the community
|
||||
url: https://docs.ansible.com/ansible/latest/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information
|
||||
url: https://docs.ansible.com/projects/ansible/latest/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information
|
||||
about: Please ask and answer usage questions here
|
||||
- name: Working groups
|
||||
url: https://github.com/ansible/community/wiki
|
||||
|
||||
@@ -122,7 +122,7 @@ body:
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: |
|
||||
Read the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
|
||||
Read the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
|
||||
options:
|
||||
- label: I agree to follow the Ansible Code of Conduct
|
||||
required: true
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -66,7 +66,7 @@ body:
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: |
|
||||
Read the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
|
||||
Read the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
|
||||
options:
|
||||
- label: I agree to follow the Ansible Code of Conduct
|
||||
required: true
|
||||
|
||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -4,7 +4,7 @@
|
||||
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
|
||||
|
||||
<!--- Please do not forget to include a changelog fragment:
|
||||
https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-changelog-fragments
|
||||
https://docs.ansible.com/projects/ansible/devel/community/collection_development_process.html#creating-changelog-fragments
|
||||
No need to include one for docs-only or test-only PR, and for new plugin/module PRs.
|
||||
Read about more details in CONTRIBUTING.md.
|
||||
-->
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
name: "Validate generated Ansible output"
|
||||
steps:
|
||||
- name: Check out collection
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run nox
|
||||
|
||||
2
.github/workflows/nox.yml
vendored
2
.github/workflows/nox.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
name: "Run extra sanity tests"
|
||||
steps:
|
||||
- name: Check out collection
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run nox
|
||||
|
||||
13
.pre-commit-config.yaml
Normal file
13
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# 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
|
||||
# SPDX-FileCopyrightText: 2025 Alexei Znamensky <russoz@gmail.com>
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: v0.14.10
|
||||
hooks:
|
||||
# Run the linter.
|
||||
- id: ruff-check
|
||||
# Run the formatter.
|
||||
- id: ruff-format
|
||||
469
CHANGELOG.md
469
CHANGELOG.md
File diff suppressed because one or more lines are too long
429
CHANGELOG.rst
429
CHANGELOG.rst
@@ -6,6 +6,435 @@ Community General Release Notes
|
||||
|
||||
This changelog describes changes after version 11.0.0.
|
||||
|
||||
v12.2.0
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Feature and bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- btrfs module utils - make execution of external commands safer by passing arguments as list (https://github.com/ansible-collections/community.general/pull/11240).
|
||||
- deps module utils - change the internal representaion of dependency state (https://github.com/ansible-collections/community.general/pull/11242).
|
||||
- keycloak_userprofile - add support for ``selector`` option (https://github.com/ansible-collections/community.general/pull/11309).
|
||||
- keycloak_userprofile - add support for additional user profile attribute-validations available in Keycloak (https://github.com/ansible-collections/community.general/issues/9048, https://github.com/ansible-collections/community.general/pull/11285).
|
||||
- lxc_container - refactor function ``create_script``, using ``subprocess.Popen()``, to a new module_utils ``_lxc`` (https://github.com/ansible-collections/community.general/pull/11204).
|
||||
- lxc_container - use ``tempfile.TemporaryDirectory()`` instead of ``mkdtemp()`` (https://github.com/ansible-collections/community.general/pull/11323).
|
||||
- monit - add ``monit_version`` return value also when the module has succeeded (https://github.com/ansible-collections/community.general/pull/11255).
|
||||
- monit - use ``Enum`` to represent the possible states (https://github.com/ansible-collections/community.general/pull/11245).
|
||||
- nmcli module - add ``vxlan_parent`` option required for multicast ``vxlan_remote`` addresses; add ``vxlan`` to list of bridgeable devices (https://github.com/ansible-collections/community.general/pull/11182).
|
||||
- scaleway inventory plugin - added support for ``SCW_PROFILE`` environment variable for the ``scw_profile`` option (https://github.com/ansible-collections/community.general/issues/11310, https://github.com/ansible-collections/community.general/pull/11311).
|
||||
- scaleway module utils - added ``scw_profile`` parameter with ``SCW_PROFILE`` environment variable support (https://github.com/ansible-collections/community.general/issues/11313, https://github.com/ansible-collections/community.general/pull/11314).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- All module utils, plugin utils, and doc fragments will be made **private** in community.general 13.0.0. This means that they will no longer be part of the public API of the collection, and can have breaking changes even in bugfix releases. If you depend on importing code from the module or plugin utils, or use one of the doc fragments, please `comment in the issue to discuss this <https://github.com/ansible-collections/community.general/issues/11312>`__. Note that this does not affect any use of community.general in task files, roles, or playbooks (https://github.com/ansible-collections/community.general/issues/11312, https://github.com/ansible-collections/community.general/pull/11320).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- apk - fix ``packages`` return value for apk-tools >= 3 (Alpine 3.23) (https://github.com/ansible-collections/community.general/issues/11264).
|
||||
- iptables_state - refactor code to avoid writing unnecessary temporary files (https://github.com/ansible-collections/community.general/pull/11258).
|
||||
- keycloak_realm - fixed crash in ``sanitize_cr()`` when ``realmrep`` was ``None`` (https://github.com/ansible-collections/community.general/pull/11260).
|
||||
- keycloak_user_rolemapping module - fixed crash when assigning roles to users without an existing role (https://github.com/ansible-collections/community.general/issues/10960, https://github.com/ansible-collections/community.general/pull/11256).
|
||||
- listen_ports_facts - fix handling of empty PID lists when ``command=ss`` (https://github.com/ansible-collections/community.general/pull/11332).
|
||||
- monit - add delay of 0.5 seconds after state change and check for status (https://github.com/ansible-collections/community.general/pull/11255).
|
||||
- monit - internal state was not reflecting when operation is "pending" in ``monit`` (https://github.com/ansible-collections/community.general/pull/11245).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.ip2location_info - Retrieve IP geolocation information of a host's IP address.
|
||||
- community.general.sssd_info - Check SSSD domain status using D-Bus.
|
||||
|
||||
v12.1.0
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- The last code included in the collection that was licensed under the PSF 2.0 license was removed form the collection. This means that now all code is either GPLv3+ licensed, MIT licensed, or BSD-2-clause licensed (https://github.com/ansible-collections/community.general/pull/11232).
|
||||
- _mount module utils - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- _stormssh module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- a_module test plugin - add proper parameter checking and type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- aerospike_migrations - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- aix_filesystem - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- ali_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- ansible_type plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- ansible_type test plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- apk - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- apt_rpm - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- apt_rpm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- atomic_container - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- atomic_container modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- atomic_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- atomic_image - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- atomic_image modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- awall - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- beadm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- bigpanda - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- binary_file lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- bitbucket module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- bitbucket_access_key modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- bitbucket_pipeline_key_pair modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- bitbucket_pipeline_known_host modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- bitbucket_pipeline_variable modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- chef_databag lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- chroot connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- circonus_annotation - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- cloudflare_dns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- cmd_runner module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- cobbler inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- cobbler_sync - remove conditional code handling SSL for unsupported versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
|
||||
- cobbler_sync - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
|
||||
- cobbler_system - remove conditional code handling SSL for unsupported versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
|
||||
- cobbler_system - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
|
||||
- collection_version lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- composer - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- consul_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- counter filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- credstash lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- cronvar - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- crypttab - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- csv module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- csv module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- cyberarkpassword lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- database module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- database module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- datadog_event - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- datadog_monitor - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- dconf - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- dependent lookup plugin - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
|
||||
- dependent lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- deps module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- dig lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- dimensiondata_network - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- dimensiondata_network modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- dnf_config_manager - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- dnstxt lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- dsv lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- elastic callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- etcd3 lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- exceptions module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- flatpak - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- flatpak_remote - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- fqdn_valid test plugin - add proper parameter checking, and add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- from_csv filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- from_ini filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- gandi_livedns_api module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- github_app_access_token lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- gitlab_group_access_token - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- gitlab_group_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- gitlab_project_access_token - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- gitlab_project_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- gitlab_runner - allow maximum timeout to be disabled by passing ``0`` to ``maximum_timeout`` (https://github.com/ansible-collections/community.general/pull/11174).
|
||||
- gitlab_runners inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- haproxy - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- hashids filter - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- hashids filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- hg - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- hg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- hpilo_info - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- hpilo_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- htpasswd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- hwc_ecs_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- hwc_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- hwc_utils module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- hwc_vpc_port - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- ibm_sa_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- icinga2 inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- icinga2_host - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- identity.keycloak.keycloak module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- imc_rest modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- incus connection plugin - add support for Windows virtual machines (https://github.com/ansible-collections/community.general/pull/11199).
|
||||
- influxdb_query - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- influxdb_user - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- influxdb_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- influxdb_write - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- iocage inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
|
||||
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ipa module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- ipa module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- ipa_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_dnsrecord - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_dnszone - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_hbacrule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_hostgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_otpconfig - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_otptoken - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ipa_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_service - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_subca - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- ipa_sudocmd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_sudocmdgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_sudorule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_vault - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- iptables_state action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- iso_customize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- jail connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- jc filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- jenkins_job - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- jenkins_job_info - remove conditional code handling SSL for unsupported versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
|
||||
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- jenkins_plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- jenkins_plugin modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- jenkins_script - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- jira - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- json_query filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- keycloak module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- keycloak module_utils - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- keycloak_authentication - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_client_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_component - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_realm - add ``webAuthnPolicyPasswordlessPasskeysEnabled`` parameter (https://github.com/ansible-collections/community.general/pull/11197).
|
||||
- keycloak_realm_key - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_realm_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_user_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_userprofile - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keys_filter plugin_utils plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- keys_filter.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- known_hosts module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- layman - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- ldap module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- ldap_attrs - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- ldap_entry - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- ldap_inc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- linode inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- listen_ports_facts - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- listen_ports_facts - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- lmdb_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- locale_gen - extend the search for available locales to include ``/usr/local/share/i18n/SUPPORTED`` in Debian and Ubuntu systems (https://github.com/ansible-collections/community.general/issues/10964, https://github.com/ansible-collections/community.general/pull/11046).
|
||||
- logentries - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- lxc connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- lxd connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- lxd inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- lxd module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- lxd module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- lxd_container - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- macports - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- mail - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- maven_artifact - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- merge_variables - extend type detection failure message to allow users for easier failure debugging (https://github.com/ansible-collections/community.general/pull/11107).
|
||||
- merge_variables lookup plugin - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- modprobe - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- net_tools.pritunl.api module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- nmap inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- nmcli - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- nmcli - fix comparison of type (https://github.com/ansible-collections/community.general/pull/11121).
|
||||
- nmcli modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- nomad_job_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- nomad_token - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- nosh - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- ocapi_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ocapi_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- oci_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- oci_utils module utils - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
|
||||
- oneandone_firewall_policy - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_load_balancer - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_monitoring_policy - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_private_network - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_server - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11231).
|
||||
- oneandone_server modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- onepassword lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- onepassword_info - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11193).
|
||||
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- oneview module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- online inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- opennebula inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- opentelemetry callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- osx_defaults - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- packet_device - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11231).
|
||||
- packet_device modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- packet_ip_subnet - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- packet_project - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- packet_sshkey - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- pamd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- parted - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- passwordstore lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- pear - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- pids - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pids - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- portage - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- pritunl_org - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pritunl_org_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pritunl_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pritunl_user_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pushbullet modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- read_csv - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- redfish_utils module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- redfish_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- redhat_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- redhat_subscription - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- redis cache plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- redis lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- revbitspss lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- rhevm - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- riak - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- rundeck module utils - improve handling the return value ``exception``. It now contains the full stack trace of the exception, while the message is included in ``msg`` (https://github.com/ansible-collections/community.general/pull/11149).
|
||||
- scaleway inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- scaleway_user_data modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- selinux_permissive - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- sensu_check - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- sensu_silence - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- sensu_silence modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- shelvefile lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- shutdown action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- shutdown action plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- slack - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- slackpkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- snap - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
|
||||
- snmp_facts - simplify and improve code using standard Ansible validations (https://github.com/ansible-collections/community.general/pull/11148).
|
||||
- solaris_zone - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11192).
|
||||
- solaris_zone - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- spectrum_model_attrs - convert ``%`` templating to f-string (https://github.com/ansible-collections/community.general/pull/11229).
|
||||
- statusio_maintenance - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- sudoers - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- svc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- svr4pkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- swupd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- to_ini filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- tss lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- univention_umc module utils - update code to Python 3 (https://github.com/ansible-collections/community.general/pull/11122).
|
||||
- unsafe.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- urpmi - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- utm_aaa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_aaa_group_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_ca_host_key_cert - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_ca_host_key_cert_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_dns_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_network_interface_address - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_network_interface_address_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_auth_profile - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_exception - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_frontend - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_frontend_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_location - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_location_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- utm_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- vertica_configuration - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_configuration - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_role - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_schema - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_schema - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_schema - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- vertica_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_user - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_user - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- virtualbox inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- vmadm - in case of failure, the module no longer returns the stderr output as ``exception``, but instead as ``stderr``. Other information (``stdout``, ``rc``) is now also returned (https://github.com/ansible-collections/community.general/pull/11149).
|
||||
- vmadm - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- wakeonlan - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- wsl connection plugin - adjust variable name for integration tests (https://github.com/ansible-collections/community.general/pull/11190).
|
||||
- wsl connection plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- wsl connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- xbps - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- xbps - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- xcc_redfish_command - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- xenserver module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- xenserver module utils - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- xenserver_guest modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- xml - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- xml - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- yum_versionlock - remove redundant conversion to unicode in command output (https://github.com/ansible-collections/community.general/pull/11093).
|
||||
- zfs - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- zone connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- cloud module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- database module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- dconf - deprecate fallback mechanism when ``gi.repository`` is not available; fallback will be removed in community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11088).
|
||||
- known_hosts module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- layman - ClearLinux was made EOL in July 2025.; the module will be removed from community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11087).
|
||||
- layman - Gentoo deprecated ``layman`` in mid-2023; the module will be removed from community.general 14.0.0 (https://github.com/ansible-collections/community.general/pull/11070).
|
||||
- pushbullet - module relies on Python package supporting Python 3.2 only; the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11224).
|
||||
- saslprep module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- spotinst_aws_elastigroup - module relies on Python package supporting Python 2.7 only; the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11069).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- _filelock module utils - add type hints. Fix bug if ``set_lock()`` is called with ``lock_timeout=None`` (https://github.com/ansible-collections/community.general/pull/11222).
|
||||
- aix_filesystem - remove compatibility code for ancient Python versions (https://github.com/ansible-collections/community.general/pull/11232).
|
||||
- ansible_type plugin utils - avoid potential concatenation of non-strings when ``alias`` has non-string values (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- ansible_type test plugin - fix parameter checking (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- cobbler_system - compare the version as a float which is the type returned by the Cobbler API (https://github.com/ansible-collections/community.general/issues/11044).
|
||||
- datetime module utils - fix bug in ``fromtimestamp()`` that caused the function to crash. This function is not used in community.general (https://github.com/ansible-collections/community.general/pull/11206).
|
||||
- gitlab module utils - add type hints. Pass API version to python-gitlab as string and not as integer (https://github.com/ansible-collections/community.general/pull/11222).
|
||||
- homebrew_service - slightly refactor code (https://github.com/ansible-collections/community.general/pull/11168).
|
||||
- ipinfoio_facts - fix handling of HTTP errors consulting the service (https://github.com/ansible-collections/community.general/pull/11145).
|
||||
- keys_filter.py plugin utils - fixed requirements check so that other sequences than lists and strings are checked, and corrected broken formatting during error reporting (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- mas - parse CLI output correctly when listing installed apps with mas 3.0.0+ (https://github.com/ansible-collections/community.general/pull/11179).
|
||||
- pam_limits - remove ``%`` templating no longer used in f-string (https://github.com/ansible-collections/community.general/pull/11229).
|
||||
- xcc_redfish_command - fix templating of dictionary keys as list (https://github.com/ansible-collections/community.general/pull/11144).
|
||||
- zfs - mark change correctly when updating properties whose current value differs, even if they already have a non-default value (https://github.com/ansible-collections/community.general/issues/11019, https://github.com/ansible-collections/community.general/pull/11172).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.file_remove - Remove files matching a pattern from a directory.
|
||||
- community.general.lxd_storage_pool_info - Retrieve information about LXD storage pools.
|
||||
- community.general.lxd_storage_volume_info - Retrieve information about LXD storage volumes.
|
||||
|
||||
v12.0.1
|
||||
=======
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Contributing
|
||||
|
||||
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
|
||||
We follow [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
|
||||
|
||||
If you are a committer, also refer to the [collection's committer guidelines](https://github.com/ansible-collections/community.general/blob/main/commit-rights.md).
|
||||
|
||||
@@ -20,27 +20,32 @@ so you can cooperate to create a better solution together.
|
||||
* If you are interested in starting with an easy issue, look for [issues with an `easyfix` label](https://github.com/ansible-collections/community.general/labels/easyfix).
|
||||
* Often issues that are waiting for contributors to pick up have [the `waiting_on_contributor` label](https://github.com/ansible-collections/community.general/labels/waiting_on_contributor).
|
||||
|
||||
## Open pull requests
|
||||
## Review pull requests
|
||||
|
||||
Look through currently [open pull requests](https://github.com/ansible-collections/community.general/pulls).
|
||||
|
||||
You can help by reviewing them. Reviews help move pull requests to merge state. Some good pull requests cannot be merged only due to a lack of reviews. And it is always worth saying that good reviews are often more valuable than pull requests themselves.
|
||||
Note that reviewing does not only mean code review, but also offering comments on new interfaces added to existing plugins/modules, interfaces of new plugins/modules, improving language (not everyone is a native english speaker), or testing bugfixes and new features!
|
||||
Note that reviewing does not only mean code review, but also offering comments on new interfaces added to existing plugins/modules, interfaces of new plugins/modules, improving language (not everyone is a native English speaker), or testing bugfixes and new features!
|
||||
|
||||
Also, consider taking up a valuable, reviewed, but abandoned pull request which you could politely ask the original authors to complete yourself.
|
||||
|
||||
## Open pull requests
|
||||
|
||||
Please read our ['Contributing to collections'](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_collections_contributing.html#contributing-to-a-collection-community-general) guide.
|
||||
|
||||
* Try committing your changes with an informative but short commit message.
|
||||
* Do not squash your commits and force-push to your branch if not needed. Reviews of your pull request are much easier with individual commits to comprehend the pull request history. All commits of your pull request branch will be squashed into one commit by GitHub upon merge.
|
||||
* Do not add merge commits to your PR. The bot will complain and you will have to rebase ([instructions for rebasing](https://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html)) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running `git config pull.rebase true` inside the repository checkout.
|
||||
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).
|
||||
* Do not add merge commits to your PR. The bot will complain and you will have to rebase ([instructions for rebasing](https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_rebasing.html)) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running `git config pull.rebase true` inside the repository checkout.
|
||||
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/projects/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).
|
||||
* You must not include a fragment for new modules or new plugins. Also you shouldn't include one for docs-only changes. (If you're not sure, simply don't include one, we'll tell you whether one is needed or not :) )
|
||||
* Please always include a link to the pull request itself, and if the PR is about an issue, also a link to the issue. Also make sure the fragment ends with a period, and begins with a lower-case letter after `-`. (Again, if you don't do this, we'll add suggestions to fix it, so don't worry too much :) )
|
||||
* Note that we format the code with `ruff format`. If your change does not match the formatters expectations, CI will fail and your PR will not get merged. See below for how to format code with antsibull-nox.
|
||||
|
||||
You can also read [our Quick-start development guide](https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst).
|
||||
You can also read the Ansible community's [Quick-start development guide](https://docs.ansible.com/projects/ansible/devel/community/create_pr_quick_start.html).
|
||||
|
||||
## Test pull requests
|
||||
|
||||
If you want to test a PR locally, refer to [our testing guide](https://github.com/ansible/community-docs/blob/main/test_pr_locally_guide.rst) for instructions on how do it quickly.
|
||||
If you want to test a PR locally, refer to [our testing guide](https://docs.ansible.com/projects/ansible/devel/community/collection_contributors/collection_test_pr_locally.html) for instructions on how do it quickly.
|
||||
|
||||
If you find any inconsistencies or places in this document which can be improved, feel free to raise an issue or pull request to fix it.
|
||||
|
||||
@@ -101,7 +106,7 @@ If you replace `-Re` with `-e`, then the virtual environments will be re-created
|
||||
Instead of using antsibull-nox, you can also run sanity and unit tests with ansible-test directly.
|
||||
This also allows you to run integration tests.
|
||||
|
||||
You have to check out the repository into a specific path structure to be able to run `ansible-test`. The path to the git checkout must end with `.../ansible_collections/community/general`. Please see [our testing guide](https://github.com/ansible/community-docs/blob/main/test_pr_locally_guide.rst) for instructions on how to check out the repository into a correct path structure. The short version of these instructions is:
|
||||
You have to check out the repository into a specific path structure to be able to run `ansible-test`. The path to the git checkout must end with `.../ansible_collections/community/general`. Please see [our testing guide](https://docs.ansible.com/projects/ansible/devel/community/collection_contributors/collection_test_pr_locally.html) for instructions on how to check out the repository into a correct path structure. The short version of these instructions is:
|
||||
|
||||
```.bash
|
||||
mkdir -p ~/dev/ansible_collections/community
|
||||
@@ -128,6 +133,7 @@ ansible-test sanity --docker -v plugins/modules/system/pids.py tests/integration
|
||||
Note that for running unit tests, you need to install required collections in the same folder structure that `community.general` is checked out in.
|
||||
Right now, you need to install [`community.internal_test_tools`](https://github.com/ansible-collections/community.internal_test_tools).
|
||||
If you want to use the latest version from GitHub, you can run:
|
||||
|
||||
```
|
||||
git clone https://github.com/ansible-collections/community.internal_test_tools.git ~/dev/ansible_collections/community/internal_test_tools
|
||||
```
|
||||
@@ -150,6 +156,7 @@ ansible-test units --docker -v --python 3.8 tests/unit/plugins/modules/net_tools
|
||||
Note that for running integration tests, you need to install required collections in the same folder structure that `community.general` is checked out in.
|
||||
Right now, depending on the test, you need to install [`ansible.posix`](https://github.com/ansible-collections/ansible.posix), [`community.crypto`](https://github.com/ansible-collections/community.crypto), and [`community.docker`](https://github.com/ansible-collections/community.docker):
|
||||
If you want to use the latest versions from GitHub, you can run:
|
||||
|
||||
```
|
||||
mkdir -p ~/dev/ansible_collections/ansible
|
||||
git clone https://github.com/ansible-collections/ansible.posix.git ~/dev/ansible_collections/ansible/posix
|
||||
@@ -162,11 +169,13 @@ The following commands show how to run integration tests:
|
||||
#### In Docker
|
||||
|
||||
Integration tests on Docker have the following parameters:
|
||||
|
||||
- `image_name` (required): The name of the Docker image. To get the list of supported Docker images, run
|
||||
`ansible-test integration --help` and look for _target docker images_.
|
||||
- `test_name` (optional): The name of the integration test.
|
||||
For modules, this equals the short name of the module; for example, `pacman` in case of `community.general.pacman`.
|
||||
For plugins, the plugin type is added before the plugin's short name, for example `callback_yaml` for the `community.general.yaml` callback.
|
||||
|
||||
```.bash
|
||||
# Test all plugins/modules on fedora40
|
||||
ansible-test integration -v --docker fedora40
|
||||
@@ -187,6 +196,31 @@ ansible-test integration -v lookup_flattened
|
||||
|
||||
If you are unsure about the integration test target name for a module or plugin, you can take a look in `tests/integration/targets/`. Tests for plugins have the plugin type prepended.
|
||||
|
||||
## Devcontainer
|
||||
|
||||
Since community.general 12.2.0, the project repository supports [devcontainers](https://containers.dev/). In short, it is a standard mechanism to
|
||||
create a container that is then used during the development cycle. Many tools are pre-installed in the container and will be already available
|
||||
to you as a developer. A number of different IDEs support that configuration, the most prominent ones being VSCode and PyCharm.
|
||||
|
||||
See the files under [.devcontainer](.devcontainer) for details on what is deployed inside that container.
|
||||
|
||||
Beware of:
|
||||
|
||||
- By default, the devcontainer installs the latest version of `ansible-core`.
|
||||
When testing your changes locally, keep in mind that the collection must support older versions of
|
||||
`ansible-core` and, depending on what is being tested, results may vary.
|
||||
- Integration tests executed directly inside the devcontainer without isolation (see above) may fail if
|
||||
they expected to be run in full fledged VMs. On the other hand, the devcontainer setup allows running
|
||||
containers inside the container (the `docker-in-docker` feature).
|
||||
- The devcontainer is built with a directory structure such that
|
||||
`.../ansible_collections/community/general` contains the project repository, so `ansible-test` and
|
||||
other standard tools should work without any additional setup
|
||||
- By default, the devcontainer installs `pre-commit` and configures it to perform `ruff check` and
|
||||
`ruff format` on the Python files, prior to commiting. That configuration is going to be used by
|
||||
`git` even outside the devcontainer. To prevent errors, you have to either install `pre-commit` in
|
||||
your computer, outside the devcontainer, or run `pre-commit uninstall` from within the devcontainer
|
||||
before quitting it.
|
||||
|
||||
## Creating new modules or plugins
|
||||
|
||||
Creating new modules and plugins requires a bit more work than other Pull Requests.
|
||||
@@ -196,14 +230,14 @@ Creating new modules and plugins requires a bit more work than other Pull Reques
|
||||
|
||||
2. Please do not add more than one plugin/module in one PR, especially if it is the first plugin/module you are contributing.
|
||||
That makes it easier for reviewers, and increases the chance that your PR will get merged. If you plan to contribute a group
|
||||
of plugins/modules (say, more than a module and a corresponding ``_info`` module), please mention that in the first PR. In
|
||||
of plugins/modules (say, more than a module and a corresponding `_info` module), please mention that in the first PR. In
|
||||
such cases, you also have to think whether it is better to publish the group of plugins/modules in a new collection.
|
||||
|
||||
3. When creating a new module or plugin, please make sure that you follow various guidelines:
|
||||
|
||||
- Follow [development conventions](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html);
|
||||
- Follow [documentation standards](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html) and
|
||||
the [Ansible style guide](https://docs.ansible.com/ansible/devel/dev_guide/style_guide/index.html#style-guide);
|
||||
- Follow [development conventions](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_modules_best_practices.html);
|
||||
- Follow [documentation standards](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_modules_documenting.html) and
|
||||
the [Ansible style guide](https://docs.ansible.com/projects/ansible/devel/dev_guide/style_guide/index.html#style-guide);
|
||||
- Make sure your modules and plugins are [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0-standalone.html) licensed
|
||||
(new module_utils can also be [BSD-2-clause](https://opensource.org/licenses/BSD-2-Clause) licensed);
|
||||
- Make sure that new plugins and modules have tests (unit tests, integration tests, or both); it is preferable to have some tests
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
||||
--------------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
||||
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
||||
otherwise using this software ("Python") in source or binary form and
|
||||
its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, PSF hereby
|
||||
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
|
||||
analyze, test, perform and/or display publicly, prepare derivative works,
|
||||
distribute, and otherwise use Python alone or in any derivative version,
|
||||
provided, however, that PSF's License Agreement and PSF's notice of copyright,
|
||||
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
|
||||
All Rights Reserved" are retained in Python alone or in any derivative version
|
||||
prepared by Licensee.
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python.
|
||||
|
||||
4. PSF is making Python available to Licensee on an "AS IS"
|
||||
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. Nothing in this License Agreement shall be deemed to create any
|
||||
relationship of agency, partnership, or joint venture between PSF and
|
||||
Licensee. This License Agreement does not grant permission to use PSF
|
||||
trademarks or trade name in a trademark sense to endorse or promote
|
||||
products or services of Licensee, or any third party.
|
||||
|
||||
8. By copying, installing or otherwise using Python, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
30
README.md
30
README.md
@@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Community General Collection
|
||||
|
||||
[](https://docs.ansible.com/ansible/devel/collections/community/general/)
|
||||
[](https://docs.ansible.com/projects/ansible/devel/collections/community/general/)
|
||||
[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
@@ -15,15 +15,15 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
This repository contains the `community.general` Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections.
|
||||
|
||||
You can find [documentation for this collection on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
|
||||
You can find [documentation for this collection on the Ansible docs site](https://docs.ansible.com/projects/ansible/latest/collections/community/general/).
|
||||
|
||||
Please note that this collection does **not** support Windows targets. Only connection plugins included in this collection might support Windows targets, and will explicitly mention that in their documentation if they do so.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
|
||||
We follow [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
|
||||
|
||||
If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
|
||||
If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
|
||||
|
||||
## Communication
|
||||
|
||||
@@ -33,9 +33,9 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https:
|
||||
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
|
||||
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
|
||||
|
||||
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
|
||||
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/projects/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
|
||||
|
||||
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
|
||||
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/projects/ansible/devel/community/communication.html).
|
||||
|
||||
## Tested with Ansible
|
||||
|
||||
@@ -47,7 +47,7 @@ Some modules and plugins require external libraries. Please check the requiremen
|
||||
|
||||
## Included content
|
||||
|
||||
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/ui/repo/published/community/general/) or the [documentation on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
|
||||
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/ui/repo/published/community/general/) or the [documentation on the Ansible docs site](https://docs.ansible.com/projects/ansible/latest/collections/community/general/).
|
||||
|
||||
## Using this collection
|
||||
|
||||
@@ -76,7 +76,7 @@ You can also install a specific version of the collection, for example, if you n
|
||||
ansible-galaxy collection install community.general:==X.Y.Z
|
||||
```
|
||||
|
||||
See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.
|
||||
See [Ansible Using collections](https://docs.ansible.com/projects/ansible/latest/user_guide/collections_using.html) for more details.
|
||||
|
||||
## Contributing to this collection
|
||||
|
||||
@@ -90,13 +90,13 @@ You don't know how to start? Refer to our [contribution guide](https://github.co
|
||||
|
||||
The current maintainers are listed in the [commit-rights.md](https://github.com/ansible-collections/community.general/blob/stable-12/commit-rights.md#people) file. If you have questions or need help, feel free to mention them in the proposals.
|
||||
|
||||
You can find more information in the [developer guide for collections](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
|
||||
You can find more information in the [developer guide for collections](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/projects/ansible/latest/community/index.html).
|
||||
|
||||
Also for some notes specific to this collection see [our CONTRIBUTING documentation](https://github.com/ansible-collections/community.general/blob/stable-12/CONTRIBUTING.md).
|
||||
|
||||
### Running tests
|
||||
|
||||
See [here](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#testing-collections).
|
||||
See [here](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_collections.html#testing-collections).
|
||||
|
||||
## Collection maintenance
|
||||
|
||||
@@ -110,7 +110,7 @@ It is necessary for maintainers of this collection to be subscribed to:
|
||||
* The collection itself (the `Watch` button → `All Activity` in the upper right corner of the repository's homepage).
|
||||
* The "Changes Impacting Collection Contributors and Maintainers" [issue](https://github.com/ansible-collections/overview/issues/45).
|
||||
|
||||
They also should be subscribed to Ansible's [The Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn).
|
||||
They also should be subscribed to Ansible's [The Bullhorn newsletter](https://docs.ansible.com/projects/ansible/devel/community/communication.html#the-bullhorn).
|
||||
|
||||
## Publishing New Version
|
||||
|
||||
@@ -129,9 +129,9 @@ See [this issue](https://github.com/ansible-collections/community.general/issues
|
||||
## More information
|
||||
|
||||
- [Ansible Collection overview](https://github.com/ansible-collections/overview)
|
||||
- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
|
||||
- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
|
||||
- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
|
||||
- [Ansible User guide](https://docs.ansible.com/projects/ansible/latest/user_guide/index.html)
|
||||
- [Ansible Developer guide](https://docs.ansible.com/projects/ansible/latest/dev_guide/index.html)
|
||||
- [Ansible Community code of conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html)
|
||||
|
||||
## Licensing
|
||||
|
||||
@@ -139,6 +139,6 @@ This collection is primarily licensed and distributed as a whole under the GNU G
|
||||
|
||||
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/stable-12/COPYING) for the full text.
|
||||
|
||||
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/PSF-2.0.txt).
|
||||
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/BSD-2-Clause.txt) and the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/MIT.txt).
|
||||
|
||||
All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/).
|
||||
|
||||
@@ -1001,3 +1001,629 @@ releases:
|
||||
- 12.0.1.yml
|
||||
- filesystem-xfs-resize-slack.yml
|
||||
release_date: '2025-11-10'
|
||||
12.1.0:
|
||||
changes:
|
||||
bugfixes:
|
||||
- _filelock module utils - add type hints. Fix bug if ``set_lock()`` is called
|
||||
with ``lock_timeout=None`` (https://github.com/ansible-collections/community.general/pull/11222).
|
||||
- aix_filesystem - remove compatibility code for ancient Python versions (https://github.com/ansible-collections/community.general/pull/11232).
|
||||
- ansible_type plugin utils - avoid potential concatenation of non-strings
|
||||
when ``alias`` has non-string values (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- ansible_type test plugin - fix parameter checking (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- cobbler_system - compare the version as a float which is the type returned
|
||||
by the Cobbler API (https://github.com/ansible-collections/community.general/issues/11044).
|
||||
- datetime module utils - fix bug in ``fromtimestamp()`` that caused the function
|
||||
to crash. This function is not used in community.general (https://github.com/ansible-collections/community.general/pull/11206).
|
||||
- gitlab module utils - add type hints. Pass API version to python-gitlab
|
||||
as string and not as integer (https://github.com/ansible-collections/community.general/pull/11222).
|
||||
- homebrew_service - slightly refactor code (https://github.com/ansible-collections/community.general/pull/11168).
|
||||
- ipinfoio_facts - fix handling of HTTP errors consulting the service (https://github.com/ansible-collections/community.general/pull/11145).
|
||||
- keys_filter.py plugin utils - fixed requirements check so that other sequences
|
||||
than lists and strings are checked, and corrected broken formatting during
|
||||
error reporting (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- mas - parse CLI output correctly when listing installed apps with mas 3.0.0+
|
||||
(https://github.com/ansible-collections/community.general/pull/11179).
|
||||
- pam_limits - remove ``%`` templating no longer used in f-string (https://github.com/ansible-collections/community.general/pull/11229).
|
||||
- xcc_redfish_command - fix templating of dictionary keys as list (https://github.com/ansible-collections/community.general/pull/11144).
|
||||
- zfs - mark change correctly when updating properties whose current value
|
||||
differs, even if they already have a non-default value (https://github.com/ansible-collections/community.general/issues/11019,
|
||||
https://github.com/ansible-collections/community.general/pull/11172).
|
||||
deprecated_features:
|
||||
- cloud module utils - this module utils is not used by community.general
|
||||
and will thus be removed from community.general 13.0.0. If you are using
|
||||
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- database module utils - this module utils is not used by community.general
|
||||
and will thus be removed from community.general 13.0.0. If you are using
|
||||
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- dconf - deprecate fallback mechanism when ``gi.repository`` is not available;
|
||||
fallback will be removed in community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11088).
|
||||
- known_hosts module utils - this module utils is not used by community.general
|
||||
and will thus be removed from community.general 13.0.0. If you are using
|
||||
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- layman - ClearLinux was made EOL in July 2025.; the module will be removed
|
||||
from community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11087).
|
||||
- layman - Gentoo deprecated ``layman`` in mid-2023; the module will be removed
|
||||
from community.general 14.0.0 (https://github.com/ansible-collections/community.general/pull/11070).
|
||||
- pushbullet - module relies on Python package supporting Python 3.2 only;
|
||||
the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11224).
|
||||
- saslprep module utils - this module utils is not used by community.general
|
||||
and will thus be removed from community.general 13.0.0. If you are using
|
||||
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
|
||||
- spotinst_aws_elastigroup - module relies on Python package supporting Python
|
||||
2.7 only; the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11069).
|
||||
minor_changes:
|
||||
- The last code included in the collection that was licensed under the PSF
|
||||
2.0 license was removed form the collection. This means that now all code
|
||||
is either GPLv3+ licensed, MIT licensed, or BSD-2-clause licensed (https://github.com/ansible-collections/community.general/pull/11232).
|
||||
- _mount module utils - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- _stormssh module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- a_module test plugin - add proper parameter checking and type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- aerospike_migrations - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- aix_filesystem - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- ali_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- ansible_type plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- ansible_type test plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- apk - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- apt_rpm - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- apt_rpm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- atomic_container - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- atomic_container modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- atomic_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- atomic_image - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- atomic_image modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- awall - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- beadm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- bigpanda - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- binary_file lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- bitbucket module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- bitbucket_access_key modules - replace ``%`` templating with f-strings or
|
||||
``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- bitbucket_pipeline_key_pair modules - replace ``%`` templating with f-strings
|
||||
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- bitbucket_pipeline_known_host modules - replace ``%`` templating with f-strings
|
||||
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- bitbucket_pipeline_variable modules - replace ``%`` templating with f-strings
|
||||
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- chef_databag lookup plugin - use ``raise ... from ...`` when passing on
|
||||
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- chroot connection plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- circonus_annotation - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- cloudflare_dns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- cmd_runner module utils - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- cobbler inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- cobbler_sync - remove conditional code handling SSL for unsupported versions
|
||||
of Python (https://github.com/ansible-collections/community.general/pull/11078).
|
||||
- cobbler_sync - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
|
||||
- cobbler_system - remove conditional code handling SSL for unsupported versions
|
||||
of Python (https://github.com/ansible-collections/community.general/pull/11078).
|
||||
- cobbler_system - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
|
||||
- collection_version lookup plugin - use ``raise ... from ...`` when passing
|
||||
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- composer - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- consul_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- counter filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- credstash lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- cronvar - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- crypttab - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- csv module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- csv module utils - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- cyberarkpassword lookup plugin - use ``raise ... from ...`` when passing
|
||||
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- database module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- database module utils - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- datadog_event - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- datadog_monitor - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- dconf - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- dependent lookup plugin - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
|
||||
- dependent lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- deps module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- dig lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- dimensiondata_network - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- dimensiondata_network modules - replace ``%`` templating with f-strings
|
||||
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- dnf_config_manager - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- dnstxt lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- dsv lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- elastic callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- etcd3 lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- exceptions module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- flatpak - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- flatpak_remote - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- fqdn_valid test plugin - add proper parameter checking, and add type hints
|
||||
(https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- from_csv filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- from_ini filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- gandi_livedns_api module utils - remove redundant conversions to unicode
|
||||
(https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- github_app_access_token lookup plugin - use ``raise ... from ...`` when
|
||||
passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- gitlab_group_access_token - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- gitlab_group_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- gitlab_project_access_token - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- gitlab_project_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- gitlab_runner - allow maximum timeout to be disabled by passing ``0`` to
|
||||
``maximum_timeout`` (https://github.com/ansible-collections/community.general/pull/11174).
|
||||
- gitlab_runners inventory plugin - use ``raise ... from ...`` when passing
|
||||
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- haproxy - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- hashids filter - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- hashids filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- hg - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- hg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- hpilo_info - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- hpilo_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- htpasswd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- hwc_ecs_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- hwc_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- hwc_utils module utils - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- hwc_vpc_port - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- ibm_sa_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- icinga2 inventory plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- icinga2_host - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- identity.keycloak.keycloak module utils - use ``raise ... from ...`` when
|
||||
passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- imc_rest modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- incus connection plugin - add support for Windows virtual machines (https://github.com/ansible-collections/community.general/pull/11199).
|
||||
- influxdb_query - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- influxdb_user - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- influxdb_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- influxdb_write - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- iocage inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
|
||||
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ipa module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- ipa module utils - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- ipa_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_dnsrecord - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_dnszone - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_hbacrule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_hostgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_otpconfig - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_otptoken - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ipa_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_service - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_subca - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- ipa_sudocmd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_sudocmdgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_sudorule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- ipa_vault - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- iptables_state action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- iso_customize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- jail connection plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- jc filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- jenkins_job - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- jenkins_job_info - remove conditional code handling SSL for unsupported
|
||||
versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
|
||||
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- jenkins_plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- jenkins_plugin modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- jenkins_script - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- jira - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- json_query filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- keycloak module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- keycloak module_utils - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- keycloak_authentication - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_client_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_component - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_realm - add ``webAuthnPolicyPasswordlessPasskeysEnabled`` parameter
|
||||
(https://github.com/ansible-collections/community.general/pull/11197).
|
||||
- keycloak_realm_key - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_realm_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_user_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keycloak_userprofile - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- keys_filter plugin_utils plugin - use ``raise ... from ...`` when passing
|
||||
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- keys_filter.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- known_hosts module utils - improve code by using native Python construct
|
||||
(https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- layman - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- ldap module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- ldap_attrs - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- ldap_entry - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- ldap_inc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
|
||||
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- linode inventory plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- listen_ports_facts - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- listen_ports_facts - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- lmdb_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- locale_gen - extend the search for available locales to include ``/usr/local/share/i18n/SUPPORTED``
|
||||
in Debian and Ubuntu systems (https://github.com/ansible-collections/community.general/issues/10964,
|
||||
https://github.com/ansible-collections/community.general/pull/11046).
|
||||
- logentries - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- lxc connection plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- lxd connection plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- lxd inventory plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- lxd module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- lxd module utils - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- lxd_container - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- macports - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- mail - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- maven_artifact - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- merge_variables - extend type detection failure message to allow users for
|
||||
easier failure debugging (https://github.com/ansible-collections/community.general/pull/11107).
|
||||
- merge_variables lookup plugin - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- modprobe - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- net_tools.pritunl.api module utils - use ``raise ... from ...`` when passing
|
||||
on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- nmap inventory plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- nmcli - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- nmcli - fix comparison of type (https://github.com/ansible-collections/community.general/pull/11121).
|
||||
- nmcli modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- nomad_job_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- nomad_token - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- nosh - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- ocapi_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- ocapi_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- oci_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- oci_utils module utils - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
|
||||
- oneandone_firewall_policy - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_load_balancer - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_monitoring_policy - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_private_network - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- oneandone_server - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11231).
|
||||
- oneandone_server modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- onepassword lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- onepassword_info - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11193).
|
||||
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- oneview module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- online inventory plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- opennebula inventory plugin - use ``raise ... from ...`` when passing on
|
||||
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- opentelemetry callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- osx_defaults - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- packet_device - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11231).
|
||||
- packet_device modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- packet_ip_subnet - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- packet_project - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- packet_sshkey - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- pamd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- parted - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- passwordstore lookup plugin - use ``raise ... from ...`` when passing on
|
||||
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- pear - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- pids - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pids - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- portage - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- pritunl_org - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pritunl_org_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pritunl_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pritunl_user_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- pushbullet modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- read_csv - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- redfish_utils module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- redfish_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- redhat_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- redhat_subscription - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- redis cache plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- redis lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- revbitspss lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- rhevm - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- riak - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- rundeck module utils - improve handling the return value ``exception``.
|
||||
It now contains the full stack trace of the exception, while the message
|
||||
is included in ``msg`` (https://github.com/ansible-collections/community.general/pull/11149).
|
||||
- scaleway inventory plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- scaleway_user_data modules - replace ``%`` templating with f-strings or
|
||||
``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- selinux_permissive - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- sensu_check - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- sensu_silence - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- sensu_silence modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- shelvefile lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- shutdown action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- shutdown action plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- slack - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- slackpkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- snap - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
|
||||
- snmp_facts - simplify and improve code using standard Ansible validations
|
||||
(https://github.com/ansible-collections/community.general/pull/11148).
|
||||
- solaris_zone - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11192).
|
||||
- solaris_zone - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- spectrum_model_attrs - convert ``%`` templating to f-string (https://github.com/ansible-collections/community.general/pull/11229).
|
||||
- statusio_maintenance - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- sudoers - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- svc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- svr4pkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- swupd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- to_ini filter plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- tss lookup plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- univention_umc module utils - update code to Python 3 (https://github.com/ansible-collections/community.general/pull/11122).
|
||||
- unsafe.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
|
||||
- urpmi - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- utm_aaa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_aaa_group_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_ca_host_key_cert - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_ca_host_key_cert_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_dns_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_network_interface_address - remove redundant conversions to unicode
|
||||
(https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_network_interface_address_info - remove redundant conversions to unicode
|
||||
(https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_auth_profile - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_exception - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_frontend - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_frontend_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_location - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_proxy_location_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- utm_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- utm_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
|
||||
- vertica_configuration - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_configuration - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_role - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_schema - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_schema - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_schema - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- vertica_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- vertica_user - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- vertica_user - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
|
||||
- virtualbox inventory plugin - use ``raise ... from ...`` when passing on
|
||||
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- vmadm - in case of failure, the module no longer returns the stderr output
|
||||
as ``exception``, but instead as ``stderr``. Other information (``stdout``,
|
||||
``rc``) is now also returned (https://github.com/ansible-collections/community.general/pull/11149).
|
||||
- vmadm - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
|
||||
- wakeonlan - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
|
||||
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- wsl connection plugin - adjust variable name for integration tests (https://github.com/ansible-collections/community.general/pull/11190).
|
||||
- wsl connection plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- wsl connection plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
- xbps - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- xbps - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- xcc_redfish_command - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
|
||||
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
|
||||
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
|
||||
- xenserver module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
|
||||
- xenserver module utils - simplify return of boolean values in functions
|
||||
(https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- xenserver_guest modules - replace ``%`` templating with f-strings or ``format()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11223).
|
||||
- xml - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
|
||||
- xml - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- yum_versionlock - remove redundant conversion to unicode in command output
|
||||
(https://github.com/ansible-collections/community.general/pull/11093).
|
||||
- zfs - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
|
||||
- zone connection plugin - use ``raise ... from ...`` when passing on exceptions
|
||||
(https://github.com/ansible-collections/community.general/pull/11095).
|
||||
release_summary: Regular bugfix and feature release.
|
||||
fragments:
|
||||
- 11045-check-cobbler-version.yml
|
||||
- 11046-locale-gen-usrlocal.yml
|
||||
- 11069-deprecate-spotinst.yml
|
||||
- 11070-deprecate-layman.yml
|
||||
- 11078-py2-ssl.yml
|
||||
- 11087-deprecate-swupd.yml
|
||||
- 11088-deprecate-dconf-fallback.yml
|
||||
- 11093-yum-versionlock-to-native.yml
|
||||
- 11095-raise-from.yml
|
||||
- 11097-raise-from.yml
|
||||
- 11098-tonative-1.yml
|
||||
- 11102-tonative-2.yml
|
||||
- 11104-tonative-3.yml
|
||||
- 11105-tonative-4.yml
|
||||
- 11106-tonative-5.yml
|
||||
- 11107-extend-merge-variables-failure-message.yml
|
||||
- 11110-tonative-6.yml
|
||||
- 11112-tonative-7.yml
|
||||
- 11115-ruff-cases-1.yml
|
||||
- 11119-ruff-cases-2.yml
|
||||
- 11121-ruff-cases-3.yml
|
||||
- 11122-yield-from-ignore.yml
|
||||
- 11143-tonative-8.yml
|
||||
- 11144-xcc-redfish-command-listkeys.yml
|
||||
- 11145-ruff-cases-4.yml
|
||||
- 11148-snmp-facts-improve.yml
|
||||
- 11149-rv-exception.yml
|
||||
- 11167-typing.yml
|
||||
- 11168-homebrew_service.yml
|
||||
- 11172-zfs-changed-extra-props.yml
|
||||
- 11174-gitlab-runner-timeout.yml
|
||||
- 11179-mas-list-parsing.yml
|
||||
- 11189-ruff-cases-6.yml
|
||||
- 11190-ruff-cases-7.yml
|
||||
- 11192-solaris-zone-os-system.yml
|
||||
- 11193-onepassword-info-popen.yml
|
||||
- 11197-keycloak-realm-webauthnpolicypasswordlesspasskeysenabled.yml
|
||||
- 11199-incus-windows.yml
|
||||
- 11205-module_utils.yml
|
||||
- 11206-datetime.yml
|
||||
- 11215-ruff-cases-8.yml
|
||||
- 11222-typing.yml
|
||||
- 11223-ruff-cases-9.yml
|
||||
- 11224-deprecate-pushbullet.yml
|
||||
- 11229-fstr-mishaps.yml
|
||||
- 11231-perc-format.yml
|
||||
- 11232-mount.yml
|
||||
- 12.1.0.yml
|
||||
modules:
|
||||
- description: Remove files matching a pattern from a directory.
|
||||
name: file_remove
|
||||
namespace: ''
|
||||
- description: Retrieve information about LXD storage pools.
|
||||
name: lxd_storage_pool_info
|
||||
namespace: ''
|
||||
- description: Retrieve information about LXD storage volumes.
|
||||
name: lxd_storage_volume_info
|
||||
namespace: ''
|
||||
release_date: '2025-12-01'
|
||||
12.2.0:
|
||||
changes:
|
||||
bugfixes:
|
||||
- apk - fix ``packages`` return value for apk-tools >= 3 (Alpine 3.23) (https://github.com/ansible-collections/community.general/issues/11264).
|
||||
- iptables_state - refactor code to avoid writing unnecessary temporary files
|
||||
(https://github.com/ansible-collections/community.general/pull/11258).
|
||||
- keycloak_realm - fixed crash in ``sanitize_cr()`` when ``realmrep`` was
|
||||
``None`` (https://github.com/ansible-collections/community.general/pull/11260).
|
||||
- keycloak_user_rolemapping module - fixed crash when assigning roles to users
|
||||
without an existing role (https://github.com/ansible-collections/community.general/issues/10960,
|
||||
https://github.com/ansible-collections/community.general/pull/11256).
|
||||
- listen_ports_facts - fix handling of empty PID lists when ``command=ss``
|
||||
(https://github.com/ansible-collections/community.general/pull/11332).
|
||||
- monit - add delay of 0.5 seconds after state change and check for status
|
||||
(https://github.com/ansible-collections/community.general/pull/11255).
|
||||
- monit - internal state was not reflecting when operation is "pending" in
|
||||
``monit`` (https://github.com/ansible-collections/community.general/pull/11245).
|
||||
deprecated_features:
|
||||
- All module utils, plugin utils, and doc fragments will be made **private**
|
||||
in community.general 13.0.0. This means that they will no longer be part
|
||||
of the public API of the collection, and can have breaking changes even
|
||||
in bugfix releases. If you depend on importing code from the module or plugin
|
||||
utils, or use one of the doc fragments, please `comment in the issue to
|
||||
discuss this <https://github.com/ansible-collections/community.general/issues/11312>`__.
|
||||
Note that this does not affect any use of community.general in task files,
|
||||
roles, or playbooks (https://github.com/ansible-collections/community.general/issues/11312,
|
||||
https://github.com/ansible-collections/community.general/pull/11320).
|
||||
minor_changes:
|
||||
- btrfs module utils - make execution of external commands safer by passing
|
||||
arguments as list (https://github.com/ansible-collections/community.general/pull/11240).
|
||||
- deps module utils - change the internal representaion of dependency state
|
||||
(https://github.com/ansible-collections/community.general/pull/11242).
|
||||
- keycloak_userprofile - add support for ``selector`` option (https://github.com/ansible-collections/community.general/pull/11309).
|
||||
- keycloak_userprofile - add support for additional user profile attribute-validations
|
||||
available in Keycloak (https://github.com/ansible-collections/community.general/issues/9048,
|
||||
https://github.com/ansible-collections/community.general/pull/11285).
|
||||
- lxc_container - refactor function ``create_script``, using ``subprocess.Popen()``,
|
||||
to a new module_utils ``_lxc`` (https://github.com/ansible-collections/community.general/pull/11204).
|
||||
- lxc_container - use ``tempfile.TemporaryDirectory()`` instead of ``mkdtemp()``
|
||||
(https://github.com/ansible-collections/community.general/pull/11323).
|
||||
- monit - add ``monit_version`` return value also when the module has succeeded
|
||||
(https://github.com/ansible-collections/community.general/pull/11255).
|
||||
- monit - use ``Enum`` to represent the possible states (https://github.com/ansible-collections/community.general/pull/11245).
|
||||
- nmcli module - add ``vxlan_parent`` option required for multicast ``vxlan_remote``
|
||||
addresses; add ``vxlan`` to list of bridgeable devices (https://github.com/ansible-collections/community.general/pull/11182).
|
||||
- scaleway inventory plugin - added support for ``SCW_PROFILE`` environment
|
||||
variable for the ``scw_profile`` option (https://github.com/ansible-collections/community.general/issues/11310,
|
||||
https://github.com/ansible-collections/community.general/pull/11311).
|
||||
- scaleway module utils - added ``scw_profile`` parameter with ``SCW_PROFILE``
|
||||
environment variable support (https://github.com/ansible-collections/community.general/issues/11313,
|
||||
https://github.com/ansible-collections/community.general/pull/11314).
|
||||
release_summary: Feature and bugfix release.
|
||||
fragments:
|
||||
- 11182-vxlan-parent-bridging.yml
|
||||
- 11204-lxc-container-popen.yml
|
||||
- 11240-btrfs-run-command.yml
|
||||
- 11242-deps-enum.yml
|
||||
- 11245-monit-enum.yml
|
||||
- 11255-monit-integrationtests.yml
|
||||
- 11256-fix-keycloak-roles-mapping.yml
|
||||
- 11258-iptables_state.yml
|
||||
- 11260-keycloak-realm-crash-when-no-realms.yml
|
||||
- 11265-fix-apk-3.yml
|
||||
- 11285-extended-keycloak-user-profile-validations.yml
|
||||
- 11309-keycloak-userprofile-selector-option.yml
|
||||
- 11311-scaleway-scw-profile-var.yml
|
||||
- 11314-scaleway-scw-profile-var-modules.yml
|
||||
- 11323-lxc-container-tempdir.yml
|
||||
- 12.2.0.yml
|
||||
- listen-ports-facts-return-no-facts.yml
|
||||
- private.yml
|
||||
modules:
|
||||
- description: Retrieve IP geolocation information of a host's IP address.
|
||||
name: ip2location_info
|
||||
namespace: ''
|
||||
- description: Check SSSD domain status using D-Bus.
|
||||
name: sssd_info
|
||||
namespace: ''
|
||||
release_date: '2025-12-29'
|
||||
|
||||
@@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
Committers Guidelines for community.general
|
||||
===========================================
|
||||
|
||||
This document is based on the [Ansible committer guidelines](https://github.com/ansible/ansible/blob/b57444af14062ec96e0af75fdfc2098c74fe2d9a/docs/docsite/rst/community/committer_guidelines.rst) ([latest version](https://docs.ansible.com/ansible/devel/community/committer_guidelines.html)).
|
||||
This document is based on the [Ansible committer guidelines](https://github.com/ansible/ansible/blob/b57444af14062ec96e0af75fdfc2098c74fe2d9a/docs/docsite/rst/community/committer_guidelines.rst) ([latest version](https://docs.ansible.com/projects/ansible/devel/community/committer_guidelines.html)).
|
||||
|
||||
These are the guidelines for people with commit privileges on the Ansible Community General Collection GitHub repository. Please read the guidelines before you commit.
|
||||
|
||||
@@ -45,7 +45,7 @@ Individuals with direct commit access to this collection repository are entruste
|
||||
- Do not commit directly.
|
||||
- Do not merge your own PRs. Someone else should have a chance to review and approve the PR merge. You have a small amount of leeway here for very minor changes.
|
||||
- Do not forget about non-standard / alternate environments. Consider the alternatives. Yes, people have bad/unusual/strange environments (like binaries from multiple init systems installed), but they are the ones who need us the most.
|
||||
- Do not drag your community team members down. Discuss the technical merits of any pull requests you review. Avoid negativity and personal comments. For more guidance on being a good community member, read the [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
|
||||
- Do not drag your community team members down. Discuss the technical merits of any pull requests you review. Avoid negativity and personal comments. For more guidance on being a good community member, read the [Ansible Community Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html).
|
||||
- Do not forget about the maintenance burden. High-maintenance features may not be worth adding.
|
||||
- Do not break playbooks. Always keep backwards compatibility in mind.
|
||||
- Do not forget to keep it simple. Complexity breeds all kinds of problems.
|
||||
|
||||
@@ -10,7 +10,7 @@ from ruamel.yaml import YAML
|
||||
|
||||
|
||||
def main() -> None:
|
||||
yaml = YAML(typ='rt')
|
||||
yaml = YAML(typ="rt")
|
||||
yaml.indent(mapping=2, sequence=4, offset=2)
|
||||
|
||||
# Load
|
||||
@@ -19,7 +19,7 @@ def main() -> None:
|
||||
# Dump
|
||||
sio = StringIO()
|
||||
yaml.dump(data, sio)
|
||||
print(sio.getvalue().rstrip('\n'))
|
||||
print(sio.getvalue().rstrip("\n"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -21,7 +21,7 @@ That is where ``ModuleHelper`` comes to assistance: a lot of that boilerplate co
|
||||
Quickstart
|
||||
""""""""""
|
||||
|
||||
See the `example from Ansible documentation <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
|
||||
See the `example from Ansible documentation <https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
|
||||
written with ``ModuleHelper``.
|
||||
But bear in mind that it does not showcase all of MH's features:
|
||||
|
||||
@@ -550,9 +550,9 @@ The other option is to use the parameter ``value``, in which case the method wil
|
||||
References
|
||||
^^^^^^^^^^
|
||||
|
||||
- `Ansible Developer Guide <https://docs.ansible.com/ansible/latest/dev_guide/index.html>`_
|
||||
- `Creating a module <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
|
||||
- `Returning ansible facts <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#ansible-facts>`_
|
||||
- `Ansible Developer Guide <https://docs.ansible.com/projects/ansible/latest/dev_guide/index.html>`_
|
||||
- `Creating a module <https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
|
||||
- `Returning ansible facts <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#ansible-facts>`_
|
||||
- :ref:`ansible_collections.community.general.docsite.guide_vardict`
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace: community
|
||||
name: general
|
||||
version: 12.0.1
|
||||
version: 12.2.0
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
@@ -16,6 +16,6 @@ license_file: COPYING
|
||||
tags:
|
||||
- community
|
||||
repository: https://github.com/ansible-collections/community.general
|
||||
documentation: https://docs.ansible.com/ansible/latest/collections/community/general/
|
||||
documentation: https://docs.ansible.com/projects/ansible/latest/collections/community/general/
|
||||
homepage: https://github.com/ansible-collections/community.general
|
||||
issues: https://github.com/ansible-collections/community.general/issues
|
||||
|
||||
@@ -398,6 +398,10 @@ plugin_routing:
|
||||
redirect: community.kubevirt.kubevirt_template
|
||||
kubevirt_vm:
|
||||
redirect: community.kubevirt.kubevirt_vm
|
||||
layman:
|
||||
deprecation:
|
||||
removal_version: 14.0.0
|
||||
warning_text: Gentoo deprecated C(layman) in mid-2023.
|
||||
ldap_attr:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
@@ -833,6 +837,10 @@ plugin_routing:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use purestorage.flashblade.purefb_info instead.
|
||||
pushbullet:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Module relies on Python package pushbullet.py which is not maintained and supports only up to Python 3.2.
|
||||
python_requirements_facts:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
@@ -1029,12 +1037,20 @@ plugin_routing:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.smartos_image_info instead.
|
||||
spotinst_aws_elastigroup:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Module relies on unsupported Python package. Use the module spot.cloud_modules.aws_elastigroup instead.
|
||||
stackdriver:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on HTTPS APIs that do not exist anymore,
|
||||
and any new development in the direction of providing an alternative should
|
||||
happen in the context of the google.cloud collection.
|
||||
swupd:
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: ClearLinux was made EOL in July 2025. If you think the module is still useful for another distribution, please create an issue in the community.general repository.
|
||||
typetalk:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
@@ -1134,6 +1150,14 @@ plugin_routing:
|
||||
warning_text: This doc fragment was used by rax modules, that relied on the deprecated
|
||||
package pyrax.
|
||||
module_utils:
|
||||
cloud:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
|
||||
database:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
|
||||
dimensiondata:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
@@ -1150,6 +1174,10 @@ plugin_routing:
|
||||
redirect: community.google.gcp
|
||||
hetzner:
|
||||
redirect: community.hrobot.robot
|
||||
known_hosts:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
|
||||
kubevirt:
|
||||
redirect: community.kubevirt.kubevirt
|
||||
net_tools.nios.api:
|
||||
@@ -1181,6 +1209,10 @@ plugin_routing:
|
||||
redirect: dellemc.openmanage.dellemc_idrac
|
||||
remote_management.dellemc.ome:
|
||||
redirect: dellemc.openmanage.ome
|
||||
saslprep:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
|
||||
inventory:
|
||||
docker_machine:
|
||||
redirect: community.docker.docker_machine
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
import typing as t
|
||||
|
||||
from ansible.plugins.action import ActionBase
|
||||
from ansible.errors import AnsibleActionFail, AnsibleConnectionFailure
|
||||
@@ -20,7 +21,7 @@ class ActionModule(ActionBase):
|
||||
DEFAULT_SUDOABLE = True
|
||||
|
||||
@staticmethod
|
||||
def msg_error__async_and_poll_not_zero(task_poll, task_async, max_timeout):
|
||||
def msg_error__async_and_poll_not_zero(task_poll, task_async, max_timeout) -> str:
|
||||
return (
|
||||
"This module doesn't support async>0 and poll>0 when its 'state' param "
|
||||
"is set to 'restored'. To enable its rollback feature (that needs the "
|
||||
@@ -30,7 +31,7 @@ class ActionModule(ActionBase):
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def msg_warning__no_async_is_no_rollback(task_poll, task_async, max_timeout):
|
||||
def msg_warning__no_async_is_no_rollback(task_poll, task_async, max_timeout) -> str:
|
||||
return (
|
||||
"Attempts to restore iptables state without rollback in case of mistake "
|
||||
"may lead the ansible controller to loose access to the hosts and never "
|
||||
@@ -41,7 +42,7 @@ class ActionModule(ActionBase):
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def msg_warning__async_greater_than_timeout(task_poll, task_async, max_timeout):
|
||||
def msg_warning__async_greater_than_timeout(task_poll, task_async, max_timeout) -> str:
|
||||
return (
|
||||
"You attempt to restore iptables state with rollback in case of mistake, "
|
||||
"but with settings that will lead this rollback to happen AFTER that the "
|
||||
@@ -50,7 +51,9 @@ class ActionModule(ActionBase):
|
||||
f"'ansible_timeout' (={max_timeout}) (recommended)."
|
||||
)
|
||||
|
||||
def _async_result(self, async_status_args, task_vars, timeout):
|
||||
def _async_result(
|
||||
self, async_status_args: dict[str, t.Any], task_vars: dict[str, t.Any], timeout: int
|
||||
) -> dict[str, t.Any]:
|
||||
"""
|
||||
Retrieve results of the asynchronous task, and display them in place of
|
||||
the async wrapper results (those with the ansible_job_id key).
|
||||
@@ -81,10 +84,13 @@ class ActionModule(ActionBase):
|
||||
|
||||
return async_result
|
||||
|
||||
def run(self, tmp=None, task_vars=None):
|
||||
def run(self, tmp: str | None = None, task_vars: dict[str, t.Any] | None = None) -> dict[str, t.Any]:
|
||||
self._supports_check_mode = True
|
||||
self._supports_async = True
|
||||
|
||||
if task_vars is None:
|
||||
task_vars = {}
|
||||
|
||||
result = super().run(tmp, task_vars)
|
||||
del tmp # tmp no longer has any effect
|
||||
|
||||
|
||||
@@ -7,19 +7,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
import typing as t
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleConnectionFailure
|
||||
from ansible.module_utils.common.text.converters import to_native, to_text
|
||||
from ansible.module_utils.common.collections import is_string
|
||||
from ansible.plugins.action import ActionBase
|
||||
from ansible.utils.display import Display
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
|
||||
class Distribution(t.TypedDict):
|
||||
name: str
|
||||
version: str
|
||||
family: str
|
||||
|
||||
|
||||
display = Display()
|
||||
|
||||
|
||||
def fmt(mapping, key):
|
||||
return to_native(mapping[key]).strip()
|
||||
|
||||
|
||||
class TimedOutException(Exception):
|
||||
pass
|
||||
|
||||
@@ -60,25 +66,23 @@ class ActionModule(ActionBase):
|
||||
def delay(self):
|
||||
return self._check_delay("delay", self.DEFAULT_PRE_SHUTDOWN_DELAY)
|
||||
|
||||
def _check_delay(self, key, default):
|
||||
def _check_delay(self, key: str, default: int) -> int:
|
||||
"""Ensure that the value is positive or zero"""
|
||||
value = int(self._task.args.get(key, default))
|
||||
if value < 0:
|
||||
value = 0
|
||||
return value
|
||||
|
||||
def _get_value_from_facts(self, variable_name, distribution, default_value):
|
||||
@staticmethod
|
||||
def _get_value_from_facts(data: dict[str, str], distribution: Distribution, default_value: str) -> str:
|
||||
"""Get dist+version specific args first, then distribution, then family, lastly use default"""
|
||||
attr = getattr(self, variable_name)
|
||||
value = attr.get(
|
||||
return data.get(
|
||||
distribution["name"] + distribution["version"],
|
||||
attr.get(distribution["name"], attr.get(distribution["family"], getattr(self, default_value))),
|
||||
data.get(distribution["name"], data.get(distribution["family"], default_value)),
|
||||
)
|
||||
return value
|
||||
|
||||
def get_distribution(self, task_vars):
|
||||
def get_distribution(self, task_vars: dict[str, t.Any]) -> Distribution:
|
||||
# FIXME: only execute the module if we don't already have the facts we need
|
||||
distribution = {}
|
||||
display.debug(f"{self._task.action}: running setup module to get distribution")
|
||||
module_output = self._execute_module(
|
||||
task_vars=task_vars, module_name="ansible.legacy.setup", module_args={"gather_subset": "min"}
|
||||
@@ -86,20 +90,20 @@ class ActionModule(ActionBase):
|
||||
try:
|
||||
if module_output.get("failed", False):
|
||||
raise AnsibleError(
|
||||
f"Failed to determine system distribution. {fmt(module_output, 'module_stdout')}, {fmt(module_output, 'module_stderr')}"
|
||||
f"Failed to determine system distribution. {to_native(module_output['module_stdout'])}, {to_native(module_output['module_stderr'])}"
|
||||
)
|
||||
distribution["name"] = module_output["ansible_facts"]["ansible_distribution"].lower()
|
||||
distribution["version"] = to_text(
|
||||
module_output["ansible_facts"]["ansible_distribution_version"].split(".")[0]
|
||||
)
|
||||
distribution["family"] = to_text(module_output["ansible_facts"]["ansible_os_family"].lower())
|
||||
distribution: Distribution = {
|
||||
"name": module_output["ansible_facts"]["ansible_distribution"].lower(),
|
||||
"version": to_text(module_output["ansible_facts"]["ansible_distribution_version"].split(".")[0]),
|
||||
"family": to_text(module_output["ansible_facts"]["ansible_os_family"].lower()),
|
||||
}
|
||||
display.debug(f"{self._task.action}: distribution: {distribution}")
|
||||
return distribution
|
||||
except KeyError as ke:
|
||||
raise AnsibleError(f'Failed to get distribution information. Missing "{ke.args[0]}" in output.')
|
||||
raise AnsibleError(f'Failed to get distribution information. Missing "{ke.args[0]}" in output.') from ke
|
||||
|
||||
def get_shutdown_command(self, task_vars, distribution):
|
||||
def find_command(command, find_search_paths):
|
||||
def get_shutdown_command(self, task_vars: dict[str, t.Any], distribution: Distribution) -> str:
|
||||
def find_command(command: str, find_search_paths: list[str]) -> list[str]:
|
||||
display.debug(
|
||||
f'{self._task.action}: running find module looking in {find_search_paths} to get path for "{command}"'
|
||||
)
|
||||
@@ -111,7 +115,7 @@ class ActionModule(ActionBase):
|
||||
)
|
||||
return [x["path"] for x in find_result["files"]]
|
||||
|
||||
shutdown_bin = self._get_value_from_facts("SHUTDOWN_COMMANDS", distribution, "DEFAULT_SHUTDOWN_COMMAND")
|
||||
shutdown_bin = self._get_value_from_facts(self.SHUTDOWN_COMMANDS, distribution, self.DEFAULT_SHUTDOWN_COMMAND)
|
||||
default_search_paths = ["/sbin", "/usr/sbin", "/usr/local/sbin"]
|
||||
search_paths = self._task.args.get("search_paths", default_search_paths)
|
||||
|
||||
@@ -124,10 +128,10 @@ class ActionModule(ActionBase):
|
||||
incorrect_type = any(not is_string(x) for x in search_paths)
|
||||
if not isinstance(search_paths, list) or incorrect_type:
|
||||
raise TypeError
|
||||
except TypeError:
|
||||
except TypeError as e:
|
||||
# Error if we didn't get a list
|
||||
err_msg = f"'search_paths' must be a string or flat list of strings, got {search_paths}"
|
||||
raise AnsibleError(err_msg)
|
||||
raise AnsibleError(err_msg) from e
|
||||
|
||||
full_path = find_command(shutdown_bin, search_paths) # find the path to the shutdown command
|
||||
if not full_path: # if we could not find the shutdown command
|
||||
@@ -146,7 +150,7 @@ class ActionModule(ActionBase):
|
||||
return f"{full_path[0]} poweroff" # done, since we cannot use args with systemd shutdown
|
||||
|
||||
# systemd case taken care of, here we add args to the command
|
||||
args = self._get_value_from_facts("SHUTDOWN_COMMAND_ARGS", distribution, "DEFAULT_SHUTDOWN_COMMAND_ARGS")
|
||||
args = self._get_value_from_facts(self.SHUTDOWN_COMMAND_ARGS, distribution, self.DEFAULT_SHUTDOWN_COMMAND_ARGS)
|
||||
# Convert seconds to minutes. If less that 60, set it to 0.
|
||||
delay_sec = self.delay
|
||||
shutdown_message = self._task.args.get("msg", self.DEFAULT_SHUTDOWN_MESSAGE)
|
||||
@@ -154,8 +158,8 @@ class ActionModule(ActionBase):
|
||||
af = args.format(delay_sec=delay_sec, delay_min=delay_sec // 60, message=shutdown_message)
|
||||
return f"{full_path[0]} {af}"
|
||||
|
||||
def perform_shutdown(self, task_vars, distribution):
|
||||
result = {}
|
||||
def perform_shutdown(self, task_vars, distribution) -> dict[str, t.Any]:
|
||||
result: dict[str, t.Any] = {}
|
||||
shutdown_result = {}
|
||||
shutdown_command_exec = self.get_shutdown_command(task_vars, distribution)
|
||||
|
||||
@@ -176,7 +180,7 @@ class ActionModule(ActionBase):
|
||||
result["failed"] = True
|
||||
result["shutdown"] = False
|
||||
result["msg"] = (
|
||||
f"Shutdown command failed. Error was {fmt(shutdown_result, 'stdout')}, {fmt(shutdown_result, 'stderr')}"
|
||||
f"Shutdown command failed. Error was {to_native(shutdown_result['stdout'])}, {to_native(shutdown_result['stderr'])}"
|
||||
)
|
||||
return result
|
||||
|
||||
@@ -184,7 +188,7 @@ class ActionModule(ActionBase):
|
||||
result["shutdown_command"] = shutdown_command_exec
|
||||
return result
|
||||
|
||||
def run(self, tmp=None, task_vars=None):
|
||||
def run(self, tmp: str | None = None, task_vars: dict[str, t.Any] | None = None) -> dict[str, t.Any]:
|
||||
self._supports_check_mode = True
|
||||
self._supports_async = True
|
||||
|
||||
|
||||
8
plugins/cache/redis.py
vendored
8
plugins/cache/redis.py
vendored
@@ -147,8 +147,10 @@ class CacheModule(BaseCacheModule):
|
||||
"""
|
||||
try:
|
||||
from redis.sentinel import Sentinel
|
||||
except ImportError:
|
||||
raise AnsibleError("The 'redis' python module (version 2.9.0 or newer) is required to use redis sentinel.")
|
||||
except ImportError as e:
|
||||
raise AnsibleError(
|
||||
"The 'redis' python module (version 2.9.0 or newer) is required to use redis sentinel."
|
||||
) from e
|
||||
|
||||
if ";" not in uri:
|
||||
raise AnsibleError("_uri does not have sentinel syntax.")
|
||||
@@ -170,7 +172,7 @@ class CacheModule(BaseCacheModule):
|
||||
try:
|
||||
return scon.master_for(self._sentinel_service_name, socket_timeout=0.2)
|
||||
except Exception as exc:
|
||||
raise AnsibleError(f"Could not connect to redis sentinel: {exc}")
|
||||
raise AnsibleError(f"Could not connect to redis sentinel: {exc}") from exc
|
||||
|
||||
def _make_key(self, key):
|
||||
return self._prefix + key
|
||||
|
||||
@@ -37,7 +37,7 @@ notes:
|
||||
seealso:
|
||||
- name: default – default Ansible screen output
|
||||
description: The official documentation on the B(default) callback plugin.
|
||||
link: https://docs.ansible.com/ansible/latest/plugins/callback/default.html
|
||||
link: https://docs.ansible.com/projects/ansible/latest/plugins/callback/default.html
|
||||
requirements:
|
||||
- set as stdout_callback in configuration
|
||||
options:
|
||||
|
||||
@@ -201,7 +201,7 @@ class ElasticSource:
|
||||
|
||||
tasks = []
|
||||
parent_start_time = None
|
||||
for task_uuid, task in tasks_data.items():
|
||||
for task in tasks_data.values():
|
||||
if parent_start_time is None:
|
||||
parent_start_time = task.start
|
||||
tasks.append(task)
|
||||
@@ -224,7 +224,7 @@ class ElasticSource:
|
||||
label(ansible_host_ip=self.ip_address)
|
||||
|
||||
for task_data in tasks:
|
||||
for host_uuid, host_data in task_data.host_data.items():
|
||||
for host_data in task_data.host_data.values():
|
||||
self.create_span_data(apm_cli, task_data, host_data)
|
||||
|
||||
apm_cli.end_transaction(name=__name__, result=status, duration=end_time - parent_start_time)
|
||||
|
||||
@@ -272,7 +272,7 @@ class OpenTelemetrySource:
|
||||
|
||||
tasks = []
|
||||
parent_start_time = None
|
||||
for task_uuid, task in tasks_data.items():
|
||||
for task in tasks_data.values():
|
||||
if parent_start_time is None:
|
||||
parent_start_time = task.start
|
||||
tasks.append(task)
|
||||
@@ -309,7 +309,7 @@ class OpenTelemetrySource:
|
||||
parent.set_attribute("ansible.host.ip", self.ip_address)
|
||||
parent.set_attribute("ansible.host.user", self.user)
|
||||
for task in tasks:
|
||||
for host_uuid, host_data in task.host_data.items():
|
||||
for host_data in task.host_data.values():
|
||||
with tracer.start_as_current_span(task.name, start_time=task.start, end_on_exit=False) as span:
|
||||
self.update_span_data(task, host_data, span, disable_logs, disable_attributes_in_logs)
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class Connection(ConnectionBase):
|
||||
try:
|
||||
self.chroot_cmd = get_bin_path(self.get_option("chroot_exe"))
|
||||
except ValueError as e:
|
||||
raise AnsibleError(str(e))
|
||||
raise AnsibleError(str(e)) from e
|
||||
|
||||
super()._connect()
|
||||
if not self._connected:
|
||||
@@ -191,17 +191,17 @@ class Connection(ConnectionBase):
|
||||
count = ""
|
||||
try:
|
||||
p = self._buffered_exec_command(f"dd of={out_path} bs={BUFSIZE}{count}", stdin=in_file)
|
||||
except OSError:
|
||||
raise AnsibleError("chroot connection requires dd command in the chroot")
|
||||
except OSError as e:
|
||||
raise AnsibleError("chroot connection requires dd command in the chroot") from e
|
||||
try:
|
||||
stdout, stderr = p.communicate()
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
|
||||
if p.returncode != 0:
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")
|
||||
except IOError:
|
||||
raise AnsibleError(f"file or module does not exist at: {in_path}")
|
||||
except IOError as e:
|
||||
raise AnsibleError(f"file or module does not exist at: {in_path}") from e
|
||||
|
||||
def fetch_file(self, in_path, out_path):
|
||||
"""fetch a file from chroot to local"""
|
||||
@@ -211,8 +211,8 @@ class Connection(ConnectionBase):
|
||||
in_path = shlex_quote(self._prefix_login_path(in_path))
|
||||
try:
|
||||
p = self._buffered_exec_command(f"dd if={in_path} bs={BUFSIZE}")
|
||||
except OSError:
|
||||
raise AnsibleError("chroot connection requires dd command in the chroot")
|
||||
except OSError as e:
|
||||
raise AnsibleError("chroot connection requires dd command in the chroot") from e
|
||||
|
||||
with open(to_bytes(out_path, errors="surrogate_or_strict"), "wb+") as out_file:
|
||||
try:
|
||||
@@ -220,9 +220,9 @@ class Connection(ConnectionBase):
|
||||
while chunk:
|
||||
out_file.write(chunk)
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
|
||||
stdout, stderr = p.communicate()
|
||||
if p.returncode != 0:
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")
|
||||
|
||||
@@ -13,6 +13,9 @@ short_description: Run tasks in Incus instances using the Incus CLI
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing Incus instance using Incus CLI.
|
||||
version_added: "8.2.0"
|
||||
notes:
|
||||
- When using this collection for Windows virtual machines, set C(ansible_shell_type) to C(powershell) or C(cmd) as a variable to the host in
|
||||
the inventory.
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
@@ -75,6 +78,7 @@ options:
|
||||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
from subprocess import call, Popen, PIPE
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound
|
||||
@@ -97,6 +101,23 @@ class Connection(ConnectionBase):
|
||||
if not self._incus_cmd:
|
||||
raise AnsibleError("incus command not found in PATH")
|
||||
|
||||
if getattr(self._shell, "_IS_WINDOWS", False):
|
||||
# Initializing regular expression patterns to match on a PowerShell or cmd command line.
|
||||
self.powershell_regex_pattern = re.compile(
|
||||
r"^(?P<executable>(\"?([a-z]:)?[a-z0-9 ()\\.]+)?powershell(\.exe)?\"?|(([a-z]:)?[a-z0-9()\\.]+)?powershell(\.exe)?)\s+.*(?P<command>-c(ommand)?)\s+", # noqa: E501
|
||||
re.IGNORECASE,
|
||||
)
|
||||
self.cmd_regex_pattern = re.compile(
|
||||
r"^(?P<executable>(\"?([a-z]:)?[a-z0-9 ()\\.]+)?cmd(\.exe)?\"?|(([a-z]:)?[a-z0-9()\\.]+)?cmd(\.exe)?)\s+.*(?P<command>/c)\s+",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
# Basic setup for a Windows host.
|
||||
self.has_native_async = True
|
||||
self.always_pipeline_modules = True
|
||||
self.module_implementation_preferences = (".ps1", ".exe", "")
|
||||
self.allow_executable = False
|
||||
|
||||
def _connect(self):
|
||||
"""connect to Incus (nothing to do here)"""
|
||||
super()._connect()
|
||||
@@ -115,19 +136,49 @@ class Connection(ConnectionBase):
|
||||
"--project",
|
||||
self.get_option("project"),
|
||||
"exec",
|
||||
*(["-T"] if getattr(self._shell, "_IS_WINDOWS", False) else []),
|
||||
f"{self.get_option('remote')}:{self._instance()}",
|
||||
"--",
|
||||
]
|
||||
|
||||
if self.get_option("remote_user") != "root":
|
||||
self._display.vvv(
|
||||
f"INFO: Running as non-root user: {self.get_option('remote_user')}, \
|
||||
trying to run 'incus exec' with become method: {self.get_option('incus_become_method')}",
|
||||
host=self._instance(),
|
||||
)
|
||||
exec_cmd.extend([self.get_option("incus_become_method"), self.get_option("remote_user"), "-c"])
|
||||
if getattr(self._shell, "_IS_WINDOWS", False):
|
||||
if (
|
||||
(regex_match := self.powershell_regex_pattern.match(cmd))
|
||||
and (regex_pattern := self.powershell_regex_pattern)
|
||||
) or ((regex_match := self.cmd_regex_pattern.match(cmd)) and (regex_pattern := self.cmd_regex_pattern)):
|
||||
self._display.vvvvvv(
|
||||
f'Found keyword: "{regex_match.group("command")}" based on regex: {regex_pattern.pattern}',
|
||||
host=self._instance(),
|
||||
)
|
||||
|
||||
exec_cmd.extend([self.get_option("executable"), "-c", cmd])
|
||||
# Split the command on the argument -c(ommand) for PowerShell or /c for cmd.
|
||||
before_command_argument, after_command_argument = cmd.split(regex_match.group("command"), 1)
|
||||
|
||||
exec_cmd.extend(
|
||||
[
|
||||
# To avoid splitting on a space contained in the path, set the executable as the first argument.
|
||||
regex_match.group("executable").strip('"'),
|
||||
# Remove the executable path and split the rest by space.
|
||||
*(before_command_argument[len(regex_match.group("executable")) :].lstrip().split(" ")),
|
||||
# Set the command argument depending on cmd or powershell.
|
||||
regex_match.group("command"),
|
||||
# Add the rest of the command at the end.
|
||||
after_command_argument,
|
||||
]
|
||||
)
|
||||
else:
|
||||
# For anything else using -EncodedCommand or else, just split on space.
|
||||
exec_cmd.extend(cmd.split(" "))
|
||||
else:
|
||||
if self.get_option("remote_user") != "root":
|
||||
self._display.vvv(
|
||||
f"INFO: Running as non-root user: {self.get_option('remote_user')}, \
|
||||
trying to run 'incus exec' with become method: {self.get_option('incus_become_method')}",
|
||||
host=self._instance(),
|
||||
)
|
||||
exec_cmd.extend([self.get_option("incus_become_method"), self.get_option("remote_user"), "-c"])
|
||||
|
||||
exec_cmd.extend([self.get_option("executable"), "-c", cmd])
|
||||
|
||||
return exec_cmd
|
||||
|
||||
@@ -200,7 +251,7 @@ class Connection(ConnectionBase):
|
||||
if not os.path.isfile(to_bytes(in_path, errors="surrogate_or_strict")):
|
||||
raise AnsibleFileNotFound(f"input path is not a file: {in_path}")
|
||||
|
||||
if self.get_option("remote_user") != "root":
|
||||
if not getattr(self._shell, "_IS_WINDOWS", False) and self.get_option("remote_user") != "root":
|
||||
uid, gid = self._get_remote_uid_gid()
|
||||
local_cmd = [
|
||||
self._incus_cmd,
|
||||
|
||||
@@ -79,8 +79,8 @@ class Connection(ConnectionBase):
|
||||
def _search_executable(executable):
|
||||
try:
|
||||
return get_bin_path(executable)
|
||||
except ValueError:
|
||||
raise AnsibleError(f"{executable} command not found in PATH")
|
||||
except ValueError as e:
|
||||
raise AnsibleError(f"{executable} command not found in PATH") from e
|
||||
|
||||
def list_jails(self):
|
||||
p = subprocess.Popen(
|
||||
@@ -161,19 +161,19 @@ class Connection(ConnectionBase):
|
||||
count = ""
|
||||
try:
|
||||
p = self._buffered_exec_command(f"dd of={out_path} bs={BUFSIZE}{count}", stdin=in_file)
|
||||
except OSError:
|
||||
raise AnsibleError("jail connection requires dd command in the jail")
|
||||
except OSError as e:
|
||||
raise AnsibleError("jail connection requires dd command in the jail") from e
|
||||
try:
|
||||
stdout, stderr = p.communicate()
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
|
||||
if p.returncode != 0:
|
||||
raise AnsibleError(
|
||||
f"failed to transfer file {in_path} to {out_path}:\n{to_native(stdout)}\n{to_native(stderr)}"
|
||||
)
|
||||
except IOError:
|
||||
raise AnsibleError(f"file or module does not exist at: {in_path}")
|
||||
except IOError as e:
|
||||
raise AnsibleError(f"file or module does not exist at: {in_path}") from e
|
||||
|
||||
def fetch_file(self, in_path, out_path):
|
||||
"""fetch a file from jail to local"""
|
||||
@@ -183,8 +183,8 @@ class Connection(ConnectionBase):
|
||||
in_path = shlex_quote(self._prefix_login_path(in_path))
|
||||
try:
|
||||
p = self._buffered_exec_command(f"dd if={in_path} bs={BUFSIZE}")
|
||||
except OSError:
|
||||
raise AnsibleError("jail connection requires dd command in the jail")
|
||||
except OSError as e:
|
||||
raise AnsibleError("jail connection requires dd command in the jail") from e
|
||||
|
||||
with open(to_bytes(out_path, errors="surrogate_or_strict"), "wb+") as out_file:
|
||||
try:
|
||||
@@ -192,9 +192,9 @@ class Connection(ConnectionBase):
|
||||
while chunk:
|
||||
out_file.write(chunk)
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
|
||||
stdout, stderr = p.communicate()
|
||||
if p.returncode != 0:
|
||||
raise AnsibleError(
|
||||
|
||||
@@ -173,9 +173,9 @@ class Connection(ConnectionBase):
|
||||
raise errors.AnsibleFileNotFound(msg)
|
||||
try:
|
||||
src_file = open(in_path, "rb")
|
||||
except IOError:
|
||||
except IOError as e:
|
||||
traceback.print_exc()
|
||||
raise errors.AnsibleError(f"failed to open input file to {in_path}")
|
||||
raise errors.AnsibleError(f"failed to open input file to {in_path}") from e
|
||||
try:
|
||||
|
||||
def write_file(args):
|
||||
@@ -184,10 +184,10 @@ class Connection(ConnectionBase):
|
||||
|
||||
try:
|
||||
self.container.attach_wait(write_file, None)
|
||||
except IOError:
|
||||
except IOError as e:
|
||||
traceback.print_exc()
|
||||
msg = f"failed to transfer file to {out_path}"
|
||||
raise errors.AnsibleError(msg)
|
||||
raise errors.AnsibleError(msg) from e
|
||||
finally:
|
||||
src_file.close()
|
||||
|
||||
@@ -200,10 +200,10 @@ class Connection(ConnectionBase):
|
||||
|
||||
try:
|
||||
dst_file = open(out_path, "wb")
|
||||
except IOError:
|
||||
except IOError as e:
|
||||
traceback.print_exc()
|
||||
msg = f"failed to open output file {out_path}"
|
||||
raise errors.AnsibleError(msg)
|
||||
raise errors.AnsibleError(msg) from e
|
||||
try:
|
||||
|
||||
def write_file(args):
|
||||
@@ -217,10 +217,10 @@ class Connection(ConnectionBase):
|
||||
|
||||
try:
|
||||
self.container.attach_wait(write_file, None)
|
||||
except IOError:
|
||||
except IOError as e:
|
||||
traceback.print_exc()
|
||||
msg = f"failed to transfer file from {in_path} to {out_path}"
|
||||
raise errors.AnsibleError(msg)
|
||||
raise errors.AnsibleError(msg) from e
|
||||
finally:
|
||||
dst_file.close()
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ class Connection(ConnectionBase):
|
||||
|
||||
try:
|
||||
self._lxc_cmd = get_bin_path("lxc")
|
||||
except ValueError:
|
||||
raise AnsibleError("lxc command not found in PATH")
|
||||
except ValueError as e:
|
||||
raise AnsibleError("lxc command not found in PATH") from e
|
||||
|
||||
def _host(self):
|
||||
"""translate remote_addr to lxd (short) hostname"""
|
||||
|
||||
@@ -478,11 +478,11 @@ class Connection(ConnectionBase):
|
||||
except IOError:
|
||||
pass # file was not found, but not required to function
|
||||
except paramiko.hostkeys.InvalidHostKey as e:
|
||||
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}")
|
||||
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}") from e
|
||||
try:
|
||||
ssh.load_system_host_keys()
|
||||
except paramiko.hostkeys.InvalidHostKey as e:
|
||||
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}")
|
||||
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}") from e
|
||||
|
||||
ssh_connect_kwargs = self._parse_proxy_command(port)
|
||||
ssh.set_missing_host_key_policy(MyAddPolicy(self))
|
||||
@@ -518,29 +518,31 @@ class Connection(ConnectionBase):
|
||||
**ssh_connect_kwargs,
|
||||
)
|
||||
except paramiko.ssh_exception.BadHostKeyException as e:
|
||||
raise AnsibleConnectionFailure(f"host key mismatch for {to_text(e.hostname)}")
|
||||
raise AnsibleConnectionFailure(f"host key mismatch for {to_text(e.hostname)}") from e
|
||||
except paramiko.ssh_exception.AuthenticationException as e:
|
||||
msg = f"Failed to authenticate: {e}"
|
||||
raise AnsibleAuthenticationFailure(msg)
|
||||
raise AnsibleAuthenticationFailure(msg) from e
|
||||
except Exception as e:
|
||||
msg = to_text(e)
|
||||
if "PID check failed" in msg:
|
||||
raise AnsibleError("paramiko version issue, please upgrade paramiko on the machine running ansible")
|
||||
raise AnsibleError(
|
||||
"paramiko version issue, please upgrade paramiko on the machine running ansible"
|
||||
) from e
|
||||
elif "Private key file is encrypted" in msg:
|
||||
msg = (
|
||||
f"ssh {self.get_option('remote_user')}@{self.get_options('remote_addr')}:{port} : "
|
||||
f"{msg}\nTo connect as a different user, use -u <username>."
|
||||
)
|
||||
raise AnsibleConnectionFailure(msg)
|
||||
raise AnsibleConnectionFailure(msg) from e
|
||||
else:
|
||||
raise AnsibleConnectionFailure(msg)
|
||||
raise AnsibleConnectionFailure(msg) from e
|
||||
self.ssh = ssh
|
||||
self._connected = True
|
||||
return self
|
||||
|
||||
def _any_keys_added(self) -> bool:
|
||||
for hostname, keys in self.ssh._host_keys.items(): # type: ignore[attr-defined] # TODO: figure out what _host_keys is!
|
||||
for keytype, key in keys.items():
|
||||
for host_keys in self.ssh._host_keys.values(): # type: ignore[attr-defined] # TODO: figure out what _host_keys is!
|
||||
for key in host_keys.values():
|
||||
added_this_time = getattr(key, "_added_by_ansible_this_time", False)
|
||||
if added_this_time:
|
||||
return True
|
||||
@@ -585,7 +587,7 @@ class Connection(ConnectionBase):
|
||||
args.extend(["--user", wsl_user])
|
||||
args.extend(["--"])
|
||||
args.extend(shlex.split(cmd))
|
||||
if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_Waeri5tepheeSha2fae8"):
|
||||
if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_WAERI5TEPHEESHA2FAE8"):
|
||||
return shlex.join(args)
|
||||
return list2cmdline(args) # see https://github.com/python/cpython/blob/3.11/Lib/subprocess.py#L576
|
||||
|
||||
@@ -609,7 +611,7 @@ class Connection(ConnectionBase):
|
||||
msg = "Failed to open session"
|
||||
if text_e:
|
||||
msg += f": {text_e}"
|
||||
raise AnsibleConnectionFailure(to_native(msg))
|
||||
raise AnsibleConnectionFailure(to_native(msg)) from e
|
||||
|
||||
display.vvv(f"EXEC {cmd}", host=self.get_option("remote_addr"))
|
||||
|
||||
@@ -665,8 +667,8 @@ class Connection(ConnectionBase):
|
||||
elif in_data == b"":
|
||||
chan.shutdown_write()
|
||||
|
||||
except socket.timeout:
|
||||
raise AnsibleError(f"ssh timed out waiting for privilege escalation.\n{to_text(become_output)}")
|
||||
except socket.timeout as e:
|
||||
raise AnsibleError(f"ssh timed out waiting for privilege escalation.\n{to_text(become_output)}") from e
|
||||
|
||||
stdout = b"".join(chan.makefile("rb", bufsize))
|
||||
stderr = b"".join(chan.makefile_stderr("rb", bufsize))
|
||||
@@ -699,7 +701,7 @@ class Connection(ConnectionBase):
|
||||
)
|
||||
raise AnsibleError(f"{to_text(stdout)}\n{to_text(stderr)}")
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"error occurred while putting file from {in_path} to {out_path}!\n{to_text(e)}")
|
||||
raise AnsibleError(f"error occurred while putting file from {in_path} to {out_path}!\n{to_text(e)}") from e
|
||||
|
||||
def fetch_file(self, in_path: str, out_path: str) -> None:
|
||||
"""save a remote file to the specified path"""
|
||||
@@ -718,7 +720,7 @@ class Connection(ConnectionBase):
|
||||
with open(out_path, "wb") as f:
|
||||
f.write(stdout)
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"error occurred while fetching file from {in_path} to {out_path}!\n{to_text(e)}")
|
||||
raise AnsibleError(f"error occurred while fetching file from {in_path} to {out_path}!\n{to_text(e)}") from e
|
||||
|
||||
def reset(self) -> None:
|
||||
"""reset the connection"""
|
||||
@@ -772,16 +774,16 @@ class Connection(ConnectionBase):
|
||||
self._save_ssh_host_keys(tmp_keyfile_name)
|
||||
|
||||
os.rename(tmp_keyfile_name, self.keyfile)
|
||||
except LockTimeout:
|
||||
except LockTimeout as e:
|
||||
raise AnsibleError(
|
||||
f"writing lock file for {self.keyfile} ran in to the timeout of {self.get_option('lock_file_timeout')}s"
|
||||
)
|
||||
) from e
|
||||
except paramiko.hostkeys.InvalidHostKey as e:
|
||||
raise AnsibleConnectionFailure(f"Invalid host key: {e.line}")
|
||||
raise AnsibleConnectionFailure(f"Invalid host key: {e.line}") from e
|
||||
except Exception as e:
|
||||
# unable to save keys, including scenario when key was invalid
|
||||
# and caught earlier
|
||||
raise AnsibleError(f"error occurred while writing SSH host keys!\n{to_text(e)}")
|
||||
raise AnsibleError(f"error occurred while writing SSH host keys!\n{to_text(e)}") from e
|
||||
finally:
|
||||
if tmp_keyfile_name is not None:
|
||||
pathlib.Path(tmp_keyfile_name).unlink(missing_ok=True)
|
||||
|
||||
@@ -66,8 +66,8 @@ class Connection(ConnectionBase):
|
||||
def _search_executable(executable):
|
||||
try:
|
||||
return get_bin_path(executable)
|
||||
except ValueError:
|
||||
raise AnsibleError(f"{executable} command not found in PATH")
|
||||
except ValueError as e:
|
||||
raise AnsibleError(f"{executable} command not found in PATH") from e
|
||||
|
||||
def list_zones(self):
|
||||
process = subprocess.Popen(
|
||||
@@ -160,17 +160,17 @@ class Connection(ConnectionBase):
|
||||
count = ""
|
||||
try:
|
||||
p = self._buffered_exec_command(f"dd of={out_path} bs={BUFSIZE}{count}", stdin=in_file)
|
||||
except OSError:
|
||||
raise AnsibleError("jail connection requires dd command in the jail")
|
||||
except OSError as e:
|
||||
raise AnsibleError("jail connection requires dd command in the jail") from e
|
||||
try:
|
||||
stdout, stderr = p.communicate()
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
|
||||
if p.returncode != 0:
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")
|
||||
except IOError:
|
||||
raise AnsibleError(f"file or module does not exist at: {in_path}")
|
||||
except IOError as e:
|
||||
raise AnsibleError(f"file or module does not exist at: {in_path}") from e
|
||||
|
||||
def fetch_file(self, in_path, out_path):
|
||||
"""fetch a file from zone to local"""
|
||||
@@ -180,8 +180,8 @@ class Connection(ConnectionBase):
|
||||
in_path = shlex_quote(self._prefix_login_path(in_path))
|
||||
try:
|
||||
p = self._buffered_exec_command(f"dd if={in_path} bs={BUFSIZE}")
|
||||
except OSError:
|
||||
raise AnsibleError("zone connection requires dd command in the zone")
|
||||
except OSError as e:
|
||||
raise AnsibleError("zone connection requires dd command in the zone") from e
|
||||
|
||||
with open(out_path, "wb+") as out_file:
|
||||
try:
|
||||
@@ -189,9 +189,9 @@ class Connection(ConnectionBase):
|
||||
while chunk:
|
||||
out_file.write(chunk)
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
|
||||
stdout, stderr = p.communicate()
|
||||
if p.returncode != 0:
|
||||
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")
|
||||
|
||||
@@ -12,8 +12,8 @@ options:
|
||||
api_token:
|
||||
description:
|
||||
- Scaleway OAuth token.
|
||||
- This is required if O(profile) is not specified.
|
||||
type: str
|
||||
required: true
|
||||
aliases: [oauth_token]
|
||||
api_url:
|
||||
description:
|
||||
@@ -27,6 +27,13 @@ options:
|
||||
type: int
|
||||
default: 30
|
||||
aliases: [timeout]
|
||||
profile:
|
||||
description:
|
||||
- The config profile in config file to load the Scaleway OAuth token from, use instead of O(api_token).
|
||||
- It is also possible to set E(SCW_PROFILE) to use a SCW CLI config profile.
|
||||
type: str
|
||||
aliases: [scw_profile]
|
||||
version_added: 12.2.0
|
||||
query_parameters:
|
||||
description:
|
||||
- List of parameters passed to the query string.
|
||||
@@ -37,6 +44,8 @@ options:
|
||||
- Validate SSL certs of the Scaleway API.
|
||||
type: bool
|
||||
default: true
|
||||
requirements:
|
||||
- PyYAML (when O(profile) is used)
|
||||
notes:
|
||||
- Also see the API documentation on U(https://developer.scaleway.com/).
|
||||
- If O(api_token) is not set within the module, the following environment variables can be used in decreasing order of precedence
|
||||
|
||||
@@ -51,7 +51,7 @@ def counter(sequence):
|
||||
except TypeError as e:
|
||||
raise AnsibleFilterError(
|
||||
f"community.general.counter needs a sequence with hashable elements (int, float or str) - {e}"
|
||||
)
|
||||
) from e
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ def from_csv(data, dialect="excel", fieldnames=None, delimiter=None, skipinitial
|
||||
try:
|
||||
dialect = initialize_dialect(dialect, **dialect_params)
|
||||
except (CustomDialectFailureError, DialectNotAvailableError) as e:
|
||||
raise AnsibleFilterError(str(e))
|
||||
raise AnsibleFilterError(str(e)) from e
|
||||
|
||||
reader = read_csv(data, dialect, fieldnames)
|
||||
|
||||
@@ -108,7 +108,7 @@ def from_csv(data, dialect="excel", fieldnames=None, delimiter=None, skipinitial
|
||||
for row in reader:
|
||||
data_list.append(row)
|
||||
except CSVError as e:
|
||||
raise AnsibleFilterError(f"Unable to process file: {e}")
|
||||
raise AnsibleFilterError(f"Unable to process file: {e}") from e
|
||||
|
||||
return data_list
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ def from_ini(obj):
|
||||
try:
|
||||
parser.read_file(StringIO(obj))
|
||||
except Exception as ex:
|
||||
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex)
|
||||
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex) from ex
|
||||
|
||||
return parser.as_dict()
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ from ansible.errors import (
|
||||
AnsibleFilterError,
|
||||
)
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.common.collections import is_sequence
|
||||
|
||||
try:
|
||||
@@ -34,10 +33,8 @@ def initialize_hashids(**kwargs):
|
||||
try:
|
||||
return Hashids(**params)
|
||||
except TypeError as e:
|
||||
raise AnsibleFilterError(
|
||||
"The provided parameters %s are invalid: %s"
|
||||
% (", ".join(["%s=%s" % (k, v) for k, v in params.items()]), to_native(e))
|
||||
)
|
||||
str_params = ", ".join([f"{k}={v}" for k, v in params.items()])
|
||||
raise AnsibleFilterError(f"The provided parameters {str_params} are invalid: {e}") from e
|
||||
|
||||
|
||||
def hashids_encode(nums, salt=None, alphabet=None, min_length=None):
|
||||
@@ -60,7 +57,7 @@ def hashids_encode(nums, salt=None, alphabet=None, min_length=None):
|
||||
try:
|
||||
hashid = hashids.encode(*nums)
|
||||
except TypeError as e:
|
||||
raise AnsibleTypeError(f"Data to encode must by a tuple or list of ints: {e}")
|
||||
raise AnsibleTypeError(f"Data to encode must by a tuple or list of ints: {e}") from e
|
||||
|
||||
return hashid
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ def jc_filter(data, parser, quiet=True, raw=False):
|
||||
return jc_parser.parse(data, quiet=quiet, raw=raw)
|
||||
|
||||
except Exception as e:
|
||||
raise AnsibleFilterError(f"Error in jc filter plugin: {e}")
|
||||
raise AnsibleFilterError(f"Error in jc filter plugin: {e}") from e
|
||||
|
||||
|
||||
class FilterModule:
|
||||
|
||||
@@ -141,10 +141,10 @@ def json_query(data, expr):
|
||||
try:
|
||||
return jmespath.search(expr, data)
|
||||
except jmespath.exceptions.JMESPathError as e:
|
||||
raise AnsibleFilterError(f"JMESPathError in json_query filter plugin:\n{e}")
|
||||
raise AnsibleFilterError(f"JMESPathError in json_query filter plugin:\n{e}") from e
|
||||
except Exception as e:
|
||||
# For older jmespath, we can get ValueError and TypeError without much info.
|
||||
raise AnsibleFilterError(f"Error in jmespath.search in json_query filter plugin:\n{e}")
|
||||
raise AnsibleFilterError(f"Error in jmespath.search in json_query filter plugin:\n{e}") from e
|
||||
|
||||
|
||||
class FilterModule:
|
||||
|
||||
@@ -72,7 +72,7 @@ def to_ini(obj):
|
||||
try:
|
||||
ini_parser.read_dict(obj)
|
||||
except Exception as ex:
|
||||
raise AnsibleFilterError(f"to_ini failed to parse given dict:{ex}", orig_exc=ex)
|
||||
raise AnsibleFilterError(f"to_ini failed to parse given dict:{ex}", orig_exc=ex) from ex
|
||||
|
||||
# catching empty dicts
|
||||
if obj == dict():
|
||||
|
||||
@@ -373,7 +373,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
|
||||
ip_address_first = None
|
||||
ipv6_address = None
|
||||
ipv6_address_first = None
|
||||
for iname, ivalue in interfaces.items():
|
||||
for ivalue in interfaces.values():
|
||||
# Set to first interface or management interface if defined or hostname matches dns_name
|
||||
if ivalue["ip_address"] != "":
|
||||
if ip_address_first is None:
|
||||
|
||||
@@ -124,7 +124,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
# Create groups based on variable values and add the corresponding hosts to it
|
||||
self._add_host_to_keyed_groups(self.get_option("keyed_groups"), host_attrs, host, strict=strict)
|
||||
except Exception as e:
|
||||
raise AnsibleParserError(f"Unable to fetch hosts from GitLab API, this was the original exception: {e}")
|
||||
raise AnsibleParserError(
|
||||
f"Unable to fetch hosts from GitLab API, this was the original exception: {e}"
|
||||
) from e
|
||||
|
||||
def verify_file(self, path):
|
||||
"""Return the possibly of a file being consumable by this plugin."""
|
||||
|
||||
@@ -166,8 +166,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
except Exception:
|
||||
error_body = {"status": None}
|
||||
if e.code == 404 and error_body.get("status") == "No objects found.":
|
||||
raise AnsibleParserError("Host filter returned no data. Please confirm your host_filter value is valid")
|
||||
raise AnsibleParserError(f"Unexpected data returned: {e} -- {error_body}")
|
||||
raise AnsibleParserError(
|
||||
"Host filter returned no data. Please confirm your host_filter value is valid"
|
||||
) from e
|
||||
raise AnsibleParserError(f"Unexpected data returned: {e} -- {error_body}") from e
|
||||
|
||||
response_body = response.read()
|
||||
json_data = json.loads(response_body.decode("utf-8"))
|
||||
|
||||
@@ -292,7 +292,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
self.get_jails(t_stdout, results)
|
||||
|
||||
if get_properties:
|
||||
for hostname, host_vars in results["_meta"]["hostvars"].items():
|
||||
for hostname in results["_meta"]["hostvars"]:
|
||||
cmd_get_properties = cmd.copy()
|
||||
cmd_get_properties.append(self.IOCAGE)
|
||||
cmd_get_properties.append("get")
|
||||
@@ -335,7 +335,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Failed to get pool: {e}") from e
|
||||
|
||||
for hostname, host_vars in results["_meta"]["hostvars"].items():
|
||||
for hostname in results["_meta"]["hostvars"]:
|
||||
iocage_hooks = []
|
||||
for hook in hooks_results:
|
||||
path = f"/{iocage_pool}/iocage/jails/{hostname}/root{hook}"
|
||||
|
||||
@@ -160,7 +160,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
try:
|
||||
self.instances = self.client.linode.instances()
|
||||
except LinodeApiError as exception:
|
||||
raise AnsibleError(f"Linode client raised: {exception}")
|
||||
raise AnsibleError(f"Linode client raised: {exception}") from exception
|
||||
|
||||
def _add_groups(self):
|
||||
"""Add Linode instance groups to the dynamic inventory."""
|
||||
|
||||
@@ -213,7 +213,7 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
with open(path, "r") as json_file:
|
||||
return json.load(json_file)
|
||||
except (IOError, json.decoder.JSONDecodeError) as err:
|
||||
raise AnsibleParserError(f"Could not load the test data from {to_native(path)}: {err}")
|
||||
raise AnsibleParserError(f"Could not load the test data from {to_native(path)}: {err}") from err
|
||||
|
||||
def save_json_data(self, path, file_name=None):
|
||||
"""save data as json
|
||||
@@ -243,7 +243,7 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
with open(os.path.abspath(os.path.join(cwd, *path)), "w") as json_file:
|
||||
json.dump(self.data, json_file)
|
||||
except IOError as err:
|
||||
raise AnsibleParserError(f"Could not save data: {err}")
|
||||
raise AnsibleParserError(f"Could not save data: {err}") from err
|
||||
|
||||
def verify_file(self, path):
|
||||
"""Check the config
|
||||
@@ -602,7 +602,7 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
else:
|
||||
path[instance_name][key] = value
|
||||
except KeyError as err:
|
||||
raise AnsibleParserError(f"Unable to store Information: {err}")
|
||||
raise AnsibleParserError(f"Unable to store Information: {err}") from err
|
||||
|
||||
def extract_information_from_instance_configs(self):
|
||||
"""Process configuration information
|
||||
@@ -853,7 +853,7 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
except ValueError as err:
|
||||
raise AnsibleParserError(
|
||||
f"Error while parsing network range {self.groupby[group_name].get('attribute')}: {err}"
|
||||
)
|
||||
) from err
|
||||
|
||||
for instance_name in self.inventory.hosts:
|
||||
if self.data["inventory"][instance_name].get("network_interfaces") is not None:
|
||||
@@ -1203,6 +1203,6 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
self.trust_password = self.get_option("trust_password")
|
||||
self.url = self.get_option("url")
|
||||
except Exception as err:
|
||||
raise AnsibleParserError(f"All correct options required: {err}")
|
||||
raise AnsibleParserError(f"All correct options required: {err}") from err
|
||||
# Call our internal helper to populate the dynamic inventory
|
||||
self._populate()
|
||||
|
||||
@@ -180,7 +180,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
try:
|
||||
self._nmap = get_bin_path("nmap")
|
||||
except ValueError as e:
|
||||
raise AnsibleParserError(f"nmap inventory plugin requires the nmap cli tool to work: {e}")
|
||||
raise AnsibleParserError(f"nmap inventory plugin requires the nmap cli tool to work: {e}") from e
|
||||
|
||||
super().parse(inventory, loader, path, cache=cache)
|
||||
|
||||
@@ -265,7 +265,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
try:
|
||||
t_stdout = to_text(stdout, errors="surrogate_or_strict")
|
||||
except UnicodeError as e:
|
||||
raise AnsibleParserError(f"Invalid (non unicode) input returned: {e}")
|
||||
raise AnsibleParserError(f"Invalid (non unicode) input returned: {e}") from e
|
||||
|
||||
for line in t_stdout.splitlines():
|
||||
hits = self.find_host.match(line)
|
||||
@@ -310,7 +310,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
results[-1]["ports"] = ports
|
||||
|
||||
except Exception as e:
|
||||
raise AnsibleParserError(f"failed to parse {to_native(path)}: {e} ")
|
||||
raise AnsibleParserError(f"failed to parse {to_native(path)}: {e} ") from e
|
||||
|
||||
if cache_needs_update:
|
||||
self._cache[cache_key] = results
|
||||
|
||||
@@ -141,13 +141,13 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
|
||||
try:
|
||||
raw_data = to_text(response.read(), errors="surrogate_or_strict")
|
||||
except UnicodeError:
|
||||
raise AnsibleError("Incorrect encoding of fetched payload from Online servers")
|
||||
except UnicodeError as e:
|
||||
raise AnsibleError("Incorrect encoding of fetched payload from Online servers") from e
|
||||
|
||||
try:
|
||||
return json.loads(raw_data)
|
||||
except ValueError:
|
||||
raise AnsibleError("Incorrect JSON payload")
|
||||
except ValueError as e:
|
||||
raise AnsibleError("Incorrect JSON payload") from e
|
||||
|
||||
@staticmethod
|
||||
def extract_rpn_lookup_cache(rpn_list):
|
||||
|
||||
@@ -122,10 +122,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
with open(authfile, "r") as fp:
|
||||
authstring = fp.read().rstrip()
|
||||
username, password = authstring.split(":")
|
||||
except (OSError, IOError):
|
||||
raise AnsibleError(f"Could not find or read ONE_AUTH file at '{authfile}'")
|
||||
except Exception:
|
||||
raise AnsibleError(f"Error occurs when reading ONE_AUTH file at '{authfile}'")
|
||||
except (OSError, IOError) as e:
|
||||
raise AnsibleError(f"Could not find or read ONE_AUTH file at '{authfile}'") from e
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error occurs when reading ONE_AUTH file at '{authfile}'") from e
|
||||
|
||||
auth_params = namedtuple("auth", ("url", "username", "password"))
|
||||
|
||||
@@ -167,7 +167,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
try:
|
||||
vm_pool = one_client.vmpool.infoextended(-2, -1, -1, 3)
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Something happened during XML-RPC call: {e}")
|
||||
raise AnsibleError(f"Something happened during XML-RPC call: {e}") from e
|
||||
|
||||
return vm_pool
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ options:
|
||||
not defined.
|
||||
type: string
|
||||
version_added: 4.4.0
|
||||
env:
|
||||
- name: SCW_PROFILE
|
||||
version_added: 12.2.0
|
||||
oauth_token:
|
||||
description:
|
||||
- Scaleway OAuth token.
|
||||
@@ -143,16 +146,16 @@ def _fetch_information(token, url):
|
||||
try:
|
||||
response = open_url(paginated_url, headers={"X-Auth-Token": token, "Content-type": "application/json"})
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error while fetching {url}: {e}")
|
||||
raise AnsibleError(f"Error while fetching {url}: {e}") from e
|
||||
try:
|
||||
raw_json = json.loads(to_text(response.read()))
|
||||
except ValueError:
|
||||
raise AnsibleError("Incorrect JSON payload")
|
||||
except ValueError as e:
|
||||
raise AnsibleError("Incorrect JSON payload") from e
|
||||
|
||||
try:
|
||||
results.extend(raw_json["servers"])
|
||||
except KeyError:
|
||||
raise AnsibleError("Incorrect format from the Scaleway API response")
|
||||
except KeyError as e:
|
||||
raise AnsibleError("Incorrect format from the Scaleway API response") from e
|
||||
|
||||
link = response.headers["Link"]
|
||||
if not link:
|
||||
|
||||
@@ -312,7 +312,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
try:
|
||||
self._vbox_path = get_bin_path(self.VBOX)
|
||||
except ValueError as e:
|
||||
raise AnsibleParserError(e)
|
||||
raise AnsibleParserError(e) from e
|
||||
|
||||
super().parse(inventory, loader, path)
|
||||
|
||||
@@ -354,7 +354,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
try:
|
||||
p = Popen(cmd, stdout=PIPE)
|
||||
except Exception as e:
|
||||
raise AnsibleParserError(str(e))
|
||||
raise AnsibleParserError(str(e)) from e
|
||||
|
||||
source_data = p.stdout.read().splitlines()
|
||||
|
||||
|
||||
@@ -107,6 +107,6 @@ class LookupModule(LookupBase):
|
||||
with open(path, "rb") as f:
|
||||
result.append(base64.b64encode(f.read()).decode("utf-8"))
|
||||
except Exception as exc:
|
||||
raise AnsibleLookupError(f"Error while reading {path}: {exc}")
|
||||
raise AnsibleLookupError(f"Error while reading {path}: {exc}") from exc
|
||||
|
||||
return result
|
||||
|
||||
@@ -77,8 +77,8 @@ class LookupModule(LookupBase):
|
||||
continue
|
||||
parsed = str(arg_raw)
|
||||
setattr(self, arg, parsed)
|
||||
except ValueError:
|
||||
raise AnsibleError(f"can't parse arg {arg}={arg_raw} as string")
|
||||
except ValueError as e:
|
||||
raise AnsibleError(f"can't parse arg {arg}={arg_raw} as string") from e
|
||||
if args:
|
||||
raise AnsibleError(f"unrecognized arguments to with_sequence: {list(args.keys())!r}")
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
data = load_collection_meta(collection_pkg, no_version=no_version)
|
||||
except Exception as exc:
|
||||
raise AnsibleLookupError(f"Error while loading metadata for {term}: {exc}")
|
||||
raise AnsibleLookupError(f"Error while loading metadata for {term}: {exc}") from exc
|
||||
|
||||
result.append(data.get("version", no_version))
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ class LookupModule(LookupBase):
|
||||
else:
|
||||
values.append(to_text(results[1]["Value"]))
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error locating '{term}' in kv store. Error was {e}")
|
||||
raise AnsibleError(f"Error locating '{term}' in kv store. Error was {e}") from e
|
||||
|
||||
return values
|
||||
|
||||
@@ -194,6 +194,6 @@ class LookupModule(LookupBase):
|
||||
raise AnsibleAssertionError(f"{name} not a valid consul lookup parameter")
|
||||
paramvals[name] = value
|
||||
except (ValueError, AssertionError) as e:
|
||||
raise AnsibleError(e)
|
||||
raise AnsibleError(e) from e
|
||||
|
||||
return paramvals
|
||||
|
||||
@@ -145,9 +145,9 @@ class LookupModule(LookupBase):
|
||||
for term in terms:
|
||||
try:
|
||||
ret.append(credstash.getSecret(term, version, region, table, context=context, **kwargs_pass))
|
||||
except credstash.ItemNotFound:
|
||||
raise AnsibleError(f"Key {term} not found")
|
||||
except credstash.ItemNotFound as e:
|
||||
raise AnsibleError(f"Key {term} not found") from e
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Encountered exception while fetching {term}: {e}")
|
||||
raise AnsibleError(f"Encountered exception while fetching {term}: {e}") from e
|
||||
|
||||
return ret
|
||||
|
||||
@@ -164,11 +164,11 @@ class CyberarkPassword:
|
||||
result_dict[output_names[i]] = to_native(output_values[i])
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise AnsibleError(e.output)
|
||||
raise AnsibleError(e.output) from e
|
||||
except OSError as e:
|
||||
raise AnsibleError(
|
||||
f"ERROR - AIM not installed or clipasswordsdk not in standard location. ERROR=({e.errno}) => {e.strerror} "
|
||||
)
|
||||
) from e
|
||||
|
||||
return [result_dict]
|
||||
|
||||
|
||||
@@ -145,7 +145,9 @@ class LookupModule(LookupBase):
|
||||
``variables`` are the variables to use.
|
||||
"""
|
||||
templar.available_variables = variables or {}
|
||||
quoted_expression = "{0}{1}{2}".format("{{", expression, "}}")
|
||||
open_br = "{{"
|
||||
close_br = "}}"
|
||||
quoted_expression = f"{open_br}{expression}{close_br}"
|
||||
if hasattr(templar, "evaluate_expression"):
|
||||
# This is available since the Data Tagging PR has been merged
|
||||
return templar.evaluate_expression(_make_safe(expression))
|
||||
@@ -174,7 +176,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
values = self.__evaluate(expression, templar, variables=vars)
|
||||
except Exception as e:
|
||||
raise AnsibleLookupError(f'Caught "{e}" while evaluating {key!r} with item == {current!r}')
|
||||
raise AnsibleLookupError(f'Caught "{e}" while evaluating {key!r} with item == {current!r}') from e
|
||||
|
||||
if isinstance(values, Mapping):
|
||||
for idx, val in sorted(values.items()):
|
||||
|
||||
@@ -387,7 +387,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
rdclass = dns.rdataclass.from_text(self.get_option("class"))
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"dns lookup illegal CLASS: {e}")
|
||||
raise AnsibleError(f"dns lookup illegal CLASS: {e}") from e
|
||||
myres.retry_servfail = self.get_option("retry_servfail")
|
||||
|
||||
for t in terms:
|
||||
@@ -405,7 +405,7 @@ class LookupModule(LookupBase):
|
||||
nsaddr = dns.resolver.query(ns)[0].address
|
||||
nameservers.append(nsaddr)
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"dns lookup NS: {e}")
|
||||
raise AnsibleError(f"dns lookup NS: {e}") from e
|
||||
continue
|
||||
if "=" in t:
|
||||
try:
|
||||
@@ -421,7 +421,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
rdclass = dns.rdataclass.from_text(arg)
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"dns lookup illegal CLASS: {e}")
|
||||
raise AnsibleError(f"dns lookup illegal CLASS: {e}") from e
|
||||
elif opt == "retry_servfail":
|
||||
myres.retry_servfail = boolean(arg)
|
||||
elif opt == "fail_on_error":
|
||||
@@ -458,7 +458,7 @@ class LookupModule(LookupBase):
|
||||
except dns.exception.SyntaxError:
|
||||
pass
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"dns.reversename unhandled exception {e}")
|
||||
raise AnsibleError(f"dns.reversename unhandled exception {e}") from e
|
||||
domains = reversed_domains
|
||||
|
||||
if len(domains) > 1:
|
||||
@@ -487,20 +487,20 @@ class LookupModule(LookupBase):
|
||||
ret.append(rd)
|
||||
except Exception as err:
|
||||
if fail_on_error:
|
||||
raise AnsibleError(f"Lookup failed: {err}")
|
||||
raise AnsibleError(f"Lookup failed: {err}") from err
|
||||
ret.append(str(err))
|
||||
|
||||
except dns.resolver.NXDOMAIN as err:
|
||||
if fail_on_error:
|
||||
raise AnsibleError(f"Lookup failed: {err}")
|
||||
raise AnsibleError(f"Lookup failed: {err}") from err
|
||||
if not real_empty:
|
||||
ret.append("NXDOMAIN")
|
||||
except (dns.resolver.NoAnswer, dns.resolver.Timeout, dns.resolver.NoNameservers) as err:
|
||||
if fail_on_error:
|
||||
raise AnsibleError(f"Lookup failed: {err}")
|
||||
raise AnsibleError(f"Lookup failed: {err}") from err
|
||||
if not real_empty:
|
||||
ret.append("")
|
||||
except dns.exception.DNSException as err:
|
||||
raise AnsibleError(f"dns.resolver unhandled exception {err}")
|
||||
raise AnsibleError(f"dns.resolver unhandled exception {err}") from err
|
||||
|
||||
return ret
|
||||
|
||||
@@ -105,7 +105,7 @@ class LookupModule(LookupBase):
|
||||
continue
|
||||
string = ""
|
||||
except DNSException as e:
|
||||
raise AnsibleError(f"dns.resolver unhandled exception {e}")
|
||||
raise AnsibleError(f"dns.resolver unhandled exception {e}") from e
|
||||
|
||||
ret.append("".join(string))
|
||||
|
||||
|
||||
@@ -109,8 +109,8 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
vault = SecretsVault(**vault_parameters)
|
||||
return vault
|
||||
except TypeError:
|
||||
raise AnsibleError("python-dsv-sdk==0.0.1 must be installed to use this plugin")
|
||||
except TypeError as e:
|
||||
raise AnsibleError("python-dsv-sdk==0.0.1 must be installed to use this plugin") from e
|
||||
|
||||
def run(self, terms, variables, **kwargs):
|
||||
if sdk_is_missing:
|
||||
@@ -140,5 +140,5 @@ class LookupModule(LookupBase):
|
||||
display.vvv(f"DevOps Secrets Vault GET /secrets/{path}")
|
||||
result.append(vault.get_secret_json(path))
|
||||
except SecretsVaultError as error:
|
||||
raise AnsibleError(f"DevOps Secrets Vault lookup failure: {error.message}")
|
||||
raise AnsibleError(f"DevOps Secrets Vault lookup failure: {error.message}") from error
|
||||
return result
|
||||
|
||||
@@ -167,7 +167,7 @@ def etcd3_client(client_params):
|
||||
etcd = etcd3.client(**client_params)
|
||||
etcd.status()
|
||||
except Exception as exp:
|
||||
raise AnsibleLookupError(f"Cannot connect to etcd cluster: {exp}")
|
||||
raise AnsibleLookupError(f"Cannot connect to etcd cluster: {exp}") from exp
|
||||
return etcd
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class PythonJWT:
|
||||
with open(path, "rb") as pem_file:
|
||||
return jwk_from_pem(pem_file.read())
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error while parsing key file: {e}")
|
||||
raise AnsibleError(f"Error while parsing key file: {e}") from e
|
||||
|
||||
@staticmethod
|
||||
def encode_jwt(app_id, jwk, exp=600):
|
||||
@@ -129,7 +129,7 @@ class PythonJWT:
|
||||
try:
|
||||
return jwt_instance.encode(payload, jwk, alg="RS256")
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error while encoding jwt: {e}")
|
||||
raise AnsibleError(f"Error while encoding jwt: {e}") from e
|
||||
|
||||
|
||||
def read_key(path, private_key=None):
|
||||
@@ -143,7 +143,7 @@ def read_key(path, private_key=None):
|
||||
key_bytes = pem_file.read()
|
||||
return serialization.load_pem_private_key(key_bytes, password=None)
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error while parsing key file: {e}")
|
||||
raise AnsibleError(f"Error while parsing key file: {e}") from e
|
||||
|
||||
|
||||
def encode_jwt(app_id, private_key_obj, exp=600):
|
||||
@@ -158,7 +158,7 @@ def encode_jwt(app_id, private_key_obj, exp=600):
|
||||
try:
|
||||
return jwt.encode(payload, private_key_obj, algorithm="RS256")
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"Error while encoding jwt: {e}")
|
||||
raise AnsibleError(f"Error while encoding jwt: {e}") from e
|
||||
|
||||
|
||||
def post_request(generated_jwt, installation_id, api_base):
|
||||
@@ -178,15 +178,15 @@ def post_request(generated_jwt, installation_id, api_base):
|
||||
except Exception:
|
||||
error_body = {}
|
||||
if e.code == 404:
|
||||
raise AnsibleError("Github return error. Please confirm your installation_id value is valid")
|
||||
raise AnsibleError("Github return error. Please confirm your installation_id value is valid") from e
|
||||
elif e.code == 401:
|
||||
raise AnsibleError("Github return error. Please confirm your private key is valid")
|
||||
raise AnsibleError(f"Unexpected data returned: {e} -- {error_body}")
|
||||
raise AnsibleError("Github return error. Please confirm your private key is valid") from e
|
||||
raise AnsibleError(f"Unexpected data returned: {e} -- {error_body}") from e
|
||||
response_body = response.read()
|
||||
try:
|
||||
json_data = json.loads(response_body.decode("utf-8"))
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
raise AnsibleError(f"Error while dencoding JSON respone from github: {e}")
|
||||
raise AnsibleError(f"Error while dencoding JSON respone from github: {e}") from e
|
||||
return json_data.get("token")
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
env = lmdb.open(str(db), readonly=True)
|
||||
except Exception as e:
|
||||
raise AnsibleError(f"LMDB cannot open database {db}: {e}")
|
||||
raise AnsibleError(f"LMDB cannot open database {db}: {e}") from e
|
||||
|
||||
ret = []
|
||||
if len(terms) == 0:
|
||||
|
||||
@@ -129,7 +129,7 @@ def _verify_and_get_type(variable):
|
||||
elif isinstance(variable, dict):
|
||||
return "dict"
|
||||
else:
|
||||
raise AnsibleError("Not supported type detected, variable must be a list or a dict")
|
||||
raise AnsibleError(f"Not supported type detected, variable must be a list or a dict: '{variable}'")
|
||||
|
||||
|
||||
class LookupModule(LookupBase):
|
||||
@@ -163,10 +163,7 @@ class LookupModule(LookupBase):
|
||||
return True
|
||||
|
||||
group_intersection = [host_group_name for host_group_name in host_groups if host_group_name in self._groups]
|
||||
if group_intersection:
|
||||
return True
|
||||
|
||||
return False
|
||||
return bool(group_intersection)
|
||||
|
||||
def _var_matches(self, key, search_pattern):
|
||||
if self._pattern_type == "prefix":
|
||||
|
||||
@@ -198,13 +198,13 @@ class OnePassCLIBase(metaclass=abc.ABCMeta):
|
||||
based on the current version."""
|
||||
try:
|
||||
bin_path = get_bin_path(cls.bin)
|
||||
except ValueError:
|
||||
raise AnsibleLookupError(f"Unable to locate '{cls.bin}' command line tool")
|
||||
except ValueError as e:
|
||||
raise AnsibleLookupError(f"Unable to locate '{cls.bin}' command line tool") from e
|
||||
|
||||
try:
|
||||
b_out = subprocess.check_output([bin_path, "--version"], stderr=subprocess.PIPE)
|
||||
except subprocess.CalledProcessError as cpe:
|
||||
raise AnsibleLookupError(f"Unable to get the op version: {cpe}")
|
||||
raise AnsibleLookupError(f"Unable to get the op version: {cpe}") from cpe
|
||||
|
||||
return to_text(b_out).strip()
|
||||
|
||||
@@ -653,7 +653,7 @@ class OnePass:
|
||||
self.connect_token,
|
||||
)
|
||||
except TypeError as e:
|
||||
raise AnsibleLookupError(e)
|
||||
raise AnsibleLookupError(e) from e
|
||||
|
||||
raise AnsibleLookupError(f"op version {version} is unsupported")
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ class LookupModule(LookupBase):
|
||||
)
|
||||
self.realpass = "pass: the standard unix password manager" in passoutput
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
|
||||
|
||||
return self.realpass
|
||||
|
||||
@@ -329,14 +329,14 @@ class LookupModule(LookupBase):
|
||||
raise AnsibleAssertionError(f"{name} not in paramvals")
|
||||
self.paramvals[name] = value
|
||||
except (ValueError, AssertionError) as e:
|
||||
raise AnsibleError(e)
|
||||
raise AnsibleError(e) from e
|
||||
# check and convert values
|
||||
try:
|
||||
for key in ["create", "returnall", "overwrite", "backup", "nosymbols"]:
|
||||
if not isinstance(self.paramvals[key], bool):
|
||||
self.paramvals[key] = boolean(self.paramvals[key])
|
||||
except (ValueError, AssertionError) as e:
|
||||
raise AnsibleError(e)
|
||||
raise AnsibleError(e) from e
|
||||
if self.paramvals["missing"] not in ["error", "warn", "create", "empty"]:
|
||||
raise AnsibleError(f"{self.paramvals['missing']} is not a valid option for missing")
|
||||
if not isinstance(self.paramvals["length"], int):
|
||||
@@ -395,7 +395,7 @@ class LookupModule(LookupBase):
|
||||
except subprocess.CalledProcessError as e:
|
||||
# 'not in password store' is the expected error if a password wasn't found
|
||||
if "not in the password store" not in e.output:
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
|
||||
|
||||
if self.paramvals["missing"] == "error":
|
||||
raise AnsibleError(f"passwordstore: passname {self.passname} not found and missing=error is set")
|
||||
@@ -459,7 +459,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
check_output2([self.pass_cmd, "insert", "-f", "-m", self.passname], input=msg, env=self.env)
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
|
||||
return newpass
|
||||
|
||||
def generate_password(self):
|
||||
@@ -480,7 +480,7 @@ class LookupModule(LookupBase):
|
||||
try:
|
||||
check_output2([self.pass_cmd, "insert", "-f", "-m", self.passname], input=msg, env=self.env)
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
|
||||
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
|
||||
|
||||
return newpass
|
||||
|
||||
|
||||
@@ -112,5 +112,5 @@ class LookupModule(LookupBase):
|
||||
ret.append(to_text(res))
|
||||
except Exception as e:
|
||||
# connection failed or key not found
|
||||
raise AnsibleError(f"Encountered exception while fetching {term}: {e}")
|
||||
raise AnsibleError(f"Encountered exception while fetching {term}: {e}") from e
|
||||
return ret
|
||||
|
||||
@@ -98,5 +98,5 @@ class LookupModule(LookupBase):
|
||||
display.vvv(f"Secret Server lookup of Secret with ID {term}")
|
||||
result.append({term: secret_server.get_pam_secret(term)})
|
||||
except Exception as error:
|
||||
raise AnsibleError(f"Secret Server lookup failure: {error.message}")
|
||||
raise AnsibleError(f"Secret Server lookup failure: {error.message}") from error
|
||||
return result
|
||||
|
||||
@@ -74,7 +74,7 @@ class LookupModule(LookupBase):
|
||||
|
||||
except (ValueError, AssertionError) as e:
|
||||
# In case "file" or "key" are not present
|
||||
raise AnsibleError(e)
|
||||
raise AnsibleError(e) from e
|
||||
|
||||
key = paramvals["key"]
|
||||
|
||||
|
||||
@@ -377,8 +377,8 @@ class TSSClient(metaclass=abc.ABCMeta): # noqa: B024
|
||||
file_content = i["itemValue"].content
|
||||
with open(os.path.join(file_download_path, f"{obj['id']}_{i['slug']}"), "wb") as f:
|
||||
f.write(file_content)
|
||||
except ValueError:
|
||||
raise AnsibleOptionsError(f"Failed to download {i['slug']}")
|
||||
except ValueError as e:
|
||||
raise AnsibleOptionsError(f"Failed to download {i['slug']}") from e
|
||||
except AttributeError:
|
||||
display.warning(f"Could not read file content for {i['slug']}")
|
||||
finally:
|
||||
@@ -403,15 +403,15 @@ class TSSClient(metaclass=abc.ABCMeta): # noqa: B024
|
||||
def _term_to_secret_id(term):
|
||||
try:
|
||||
return int(term)
|
||||
except ValueError:
|
||||
raise AnsibleOptionsError("Secret ID must be an integer")
|
||||
except ValueError as e:
|
||||
raise AnsibleOptionsError("Secret ID must be an integer") from e
|
||||
|
||||
@staticmethod
|
||||
def _term_to_folder_id(term):
|
||||
try:
|
||||
return int(term)
|
||||
except ValueError:
|
||||
raise AnsibleOptionsError("Folder ID must be an integer")
|
||||
except ValueError as e:
|
||||
raise AnsibleOptionsError("Folder ID must be an integer") from e
|
||||
|
||||
|
||||
class TSSClientV0(TSSClient):
|
||||
@@ -493,4 +493,4 @@ class LookupModule(LookupBase):
|
||||
for term in terms
|
||||
]
|
||||
except SecretServerError as error:
|
||||
raise AnsibleError(f"Secret Server lookup failure: {error.message}")
|
||||
raise AnsibleError(f"Secret Server lookup failure: {error.message}") from error
|
||||
|
||||
@@ -11,9 +11,13 @@ import os
|
||||
import stat
|
||||
import time
|
||||
import fcntl
|
||||
import typing as t
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from io import TextIOWrapper
|
||||
|
||||
|
||||
class LockTimeout(Exception):
|
||||
pass
|
||||
@@ -27,11 +31,13 @@ class FileLock:
|
||||
unwanted and/or unexpected behaviour
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.lockfd = None
|
||||
def __init__(self) -> None:
|
||||
self.lockfd: TextIOWrapper | None = None
|
||||
|
||||
@contextmanager
|
||||
def lock_file(self, path, tmpdir, lock_timeout=None):
|
||||
def lock_file(
|
||||
self, path: os.PathLike, tmpdir: os.PathLike, lock_timeout: int | float | None = None
|
||||
) -> t.Generator[None]:
|
||||
"""
|
||||
Context for lock acquisition
|
||||
"""
|
||||
@@ -41,7 +47,9 @@ class FileLock:
|
||||
finally:
|
||||
self.unlock()
|
||||
|
||||
def set_lock(self, path, tmpdir, lock_timeout=None):
|
||||
def set_lock(
|
||||
self, path: os.PathLike, tmpdir: os.PathLike, lock_timeout: int | float | None = None
|
||||
) -> t.Literal[True]:
|
||||
"""
|
||||
Create a lock file based on path with flock to prevent other processes
|
||||
using given path.
|
||||
@@ -61,13 +69,13 @@ class FileLock:
|
||||
|
||||
self.lockfd = open(lock_path, "w")
|
||||
|
||||
if lock_timeout <= 0:
|
||||
if lock_timeout is not None and lock_timeout <= 0:
|
||||
fcntl.flock(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
os.chmod(lock_path, stat.S_IWRITE | stat.S_IREAD)
|
||||
return True
|
||||
|
||||
if lock_timeout:
|
||||
e_secs = 0
|
||||
e_secs: float = 0
|
||||
while e_secs < lock_timeout:
|
||||
try:
|
||||
fcntl.flock(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
@@ -86,7 +94,7 @@ class FileLock:
|
||||
|
||||
return True
|
||||
|
||||
def unlock(self):
|
||||
def unlock(self) -> t.Literal[True]:
|
||||
"""
|
||||
Make sure lock file is available for everyone and Unlock the file descriptor
|
||||
locked by set_lock
|
||||
|
||||
61
plugins/module_utils/_lxc.py
Normal file
61
plugins/module_utils/_lxc.py
Normal file
@@ -0,0 +1,61 @@
|
||||
# Copyright (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
|
||||
# Copyright (c) 2025, Alexei Znamensky <russoz@gmail.com>
|
||||
# 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 annotations
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
|
||||
# This is used to attach to a running container and execute commands from
|
||||
# within the container on the host. This will provide local access to a
|
||||
# container without using SSH. The template will attempt to work within the
|
||||
# home directory of the user that was attached to the container and source
|
||||
# that users environment variables by default.
|
||||
ATTACH_TEMPLATE = """#!/usr/bin/env bash
|
||||
pushd "$(getent passwd $(whoami)|cut -f6 -d':')"
|
||||
if [[ -f ".bashrc" ]];then
|
||||
source .bashrc
|
||||
unset HOSTNAME
|
||||
fi
|
||||
popd
|
||||
|
||||
# User defined command
|
||||
{}
|
||||
"""
|
||||
|
||||
|
||||
def create_script(command: str, module: AnsibleModule) -> None:
|
||||
"""Write out a script onto a target.
|
||||
|
||||
This method should be backward compatible with Python when executing
|
||||
from within the container.
|
||||
|
||||
:param command: command to run, this can be a script and can use spacing
|
||||
with newlines as separation.
|
||||
:param module: AnsibleModule to run commands with.
|
||||
"""
|
||||
|
||||
script_file = ""
|
||||
try:
|
||||
f = tempfile.NamedTemporaryFile(prefix="lxc-attach-script", delete=False, mode="wb")
|
||||
f.write(to_bytes(ATTACH_TEMPLATE.format(command), errors="surrogate_or_strict"))
|
||||
script_file = f.name
|
||||
f.flush()
|
||||
f.close()
|
||||
|
||||
os.chmod(script_file, 0o0700)
|
||||
|
||||
with tempfile.NamedTemporaryFile(prefix="lxc-attach-script-log", delete=False, mode="ab") as stdout_file:
|
||||
with tempfile.NamedTemporaryFile(prefix="lxc-attach-script-err", delete=False, mode="ab") as stderr_file:
|
||||
subprocess.Popen([script_file], stdout=stdout_file, stderr=stderr_file).communicate()
|
||||
|
||||
finally:
|
||||
if script_file:
|
||||
os.remove(script_file)
|
||||
@@ -1,52 +0,0 @@
|
||||
# This code is part of Ansible, but is an independent component.
|
||||
# This particular file snippet, and this file snippet only, is based on
|
||||
# Lib/posixpath.py of cpython
|
||||
#
|
||||
# Copyright (c) 2001-2022 Python Software Foundation. All rights reserved.
|
||||
# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
||||
# (See LICENSES/PSF-2.0.txt in this collection)
|
||||
# SPDX-License-Identifier: PSF-2.0
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def ismount(path):
|
||||
"""Test whether a path is a mount point
|
||||
This is a copy of the upstream version of ismount(). Originally this was copied here as a workaround
|
||||
until Python issue 2466 was fixed. Now it is here so this will work on older versions of Python
|
||||
that may not have the upstream fix.
|
||||
https://github.com/ansible/ansible-modules-core/issues/2186
|
||||
http://bugs.python.org/issue2466
|
||||
"""
|
||||
try:
|
||||
s1 = os.lstat(path)
|
||||
except (OSError, ValueError):
|
||||
# It doesn't exist -- so not a mount point. :-)
|
||||
return False
|
||||
else:
|
||||
# A symlink can never be a mount point
|
||||
if os.path.stat.S_ISLNK(s1.st_mode):
|
||||
return False
|
||||
|
||||
if isinstance(path, bytes):
|
||||
parent = os.path.join(path, b"..")
|
||||
else:
|
||||
parent = os.path.join(path, "..")
|
||||
parent = os.path.realpath(parent)
|
||||
try:
|
||||
s2 = os.lstat(parent)
|
||||
except (OSError, ValueError):
|
||||
return False
|
||||
|
||||
dev1 = s1.st_dev
|
||||
dev2 = s2.st_dev
|
||||
if dev1 != dev2:
|
||||
return True # path/.. on a different device as path
|
||||
ino1 = s1.st_ino
|
||||
ino2 = s2.st_ino
|
||||
if ino1 == ino2:
|
||||
return True # path/.. is the same i-node as path
|
||||
return False
|
||||
@@ -184,7 +184,7 @@ class ConfigParser:
|
||||
continue
|
||||
|
||||
searchable_information = host_entry.get("host")
|
||||
for key, value in host_entry.get("options").items():
|
||||
for value in host_entry.get("options").values():
|
||||
if isinstance(value, list):
|
||||
value = " ".join(value)
|
||||
if isinstance(value, int):
|
||||
|
||||
@@ -14,8 +14,13 @@ from __future__ import annotations
|
||||
import os
|
||||
import json
|
||||
import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.basic import env_fallback
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
try:
|
||||
import footmark
|
||||
import footmark.ecs
|
||||
@@ -200,7 +205,7 @@ def get_profile(params):
|
||||
return params
|
||||
|
||||
|
||||
def ecs_connect(module):
|
||||
def ecs_connect(module: AnsibleModule):
|
||||
"""Return an ecs connection"""
|
||||
ecs_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -214,7 +219,7 @@ def ecs_connect(module):
|
||||
return ecs
|
||||
|
||||
|
||||
def slb_connect(module):
|
||||
def slb_connect(module: AnsibleModule):
|
||||
"""Return an slb connection"""
|
||||
slb_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -228,7 +233,7 @@ def slb_connect(module):
|
||||
return slb
|
||||
|
||||
|
||||
def dns_connect(module):
|
||||
def dns_connect(module: AnsibleModule):
|
||||
"""Return an dns connection"""
|
||||
dns_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -242,7 +247,7 @@ def dns_connect(module):
|
||||
return dns
|
||||
|
||||
|
||||
def vpc_connect(module):
|
||||
def vpc_connect(module: AnsibleModule):
|
||||
"""Return an vpc connection"""
|
||||
vpc_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -256,7 +261,7 @@ def vpc_connect(module):
|
||||
return vpc
|
||||
|
||||
|
||||
def rds_connect(module):
|
||||
def rds_connect(module: AnsibleModule):
|
||||
"""Return an rds connection"""
|
||||
rds_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -270,7 +275,7 @@ def rds_connect(module):
|
||||
return rds
|
||||
|
||||
|
||||
def ess_connect(module):
|
||||
def ess_connect(module: AnsibleModule):
|
||||
"""Return an ess connection"""
|
||||
ess_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -284,7 +289,7 @@ def ess_connect(module):
|
||||
return ess
|
||||
|
||||
|
||||
def sts_connect(module):
|
||||
def sts_connect(module: AnsibleModule):
|
||||
"""Return an sts connection"""
|
||||
sts_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -298,7 +303,7 @@ def sts_connect(module):
|
||||
return sts
|
||||
|
||||
|
||||
def ram_connect(module):
|
||||
def ram_connect(module: AnsibleModule):
|
||||
"""Return an ram connection"""
|
||||
ram_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
@@ -312,7 +317,7 @@ def ram_connect(module):
|
||||
return ram
|
||||
|
||||
|
||||
def market_connect(module):
|
||||
def market_connect(module: AnsibleModule):
|
||||
"""Return an market connection"""
|
||||
market_params = get_profile(module.params)
|
||||
# If we have a region specified, connect to its endpoint.
|
||||
|
||||
@@ -6,22 +6,27 @@ from __future__ import annotations
|
||||
|
||||
|
||||
import re
|
||||
import typing as t
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
__state_map = {"present": "--install", "absent": "--uninstall"}
|
||||
|
||||
# sdkmanager --help 2>&1 | grep -A 2 -- --channel
|
||||
__channel_map = {"stable": 0, "beta": 1, "dev": 2, "canary": 3}
|
||||
|
||||
|
||||
def __map_channel(channel_name):
|
||||
def __map_channel(channel_name: str) -> int:
|
||||
if channel_name not in __channel_map:
|
||||
raise ValueError(f"Unknown channel name '{channel_name}'")
|
||||
return __channel_map[channel_name]
|
||||
|
||||
|
||||
def sdkmanager_runner(module, **kwargs):
|
||||
def sdkmanager_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
|
||||
return CmdRunner(
|
||||
module,
|
||||
command="sdkmanager",
|
||||
@@ -40,18 +45,18 @@ def sdkmanager_runner(module, **kwargs):
|
||||
|
||||
|
||||
class Package:
|
||||
def __init__(self, name):
|
||||
def __init__(self, name: str) -> None:
|
||||
self.name = name
|
||||
|
||||
def __hash__(self):
|
||||
def __hash__(self) -> int:
|
||||
return hash(self.name)
|
||||
|
||||
def __ne__(self, other):
|
||||
def __ne__(self, other: object) -> bool:
|
||||
if not isinstance(other, Package):
|
||||
return True
|
||||
return self.name != other.name
|
||||
|
||||
def __eq__(self, other):
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if not isinstance(other, Package):
|
||||
return False
|
||||
|
||||
@@ -78,20 +83,20 @@ class AndroidSdkManager:
|
||||
r"the packages they depend on were not accepted"
|
||||
)
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
self.runner = sdkmanager_runner(module)
|
||||
|
||||
def get_installed_packages(self):
|
||||
def get_installed_packages(self) -> set[Package]:
|
||||
with self.runner("installed sdk_root channel") as ctx:
|
||||
rc, stdout, stderr = ctx.run()
|
||||
return self._parse_packages(stdout, self._RE_INSTALLED_PACKAGES_HEADER, self._RE_INSTALLED_PACKAGE)
|
||||
|
||||
def get_updatable_packages(self):
|
||||
def get_updatable_packages(self) -> set[Package]:
|
||||
with self.runner("list newer sdk_root channel") as ctx:
|
||||
rc, stdout, stderr = ctx.run()
|
||||
return self._parse_packages(stdout, self._RE_UPDATABLE_PACKAGES_HEADER, self._RE_UPDATABLE_PACKAGE)
|
||||
|
||||
def apply_packages_changes(self, packages, accept_licenses=False):
|
||||
def apply_packages_changes(self, packages: list[Package], accept_licenses: bool = False) -> tuple[int, str, str]:
|
||||
"""Install or delete packages, depending on the `module.vars.state` parameter"""
|
||||
if len(packages) == 0:
|
||||
return 0, "", ""
|
||||
@@ -113,7 +118,7 @@ class AndroidSdkManager:
|
||||
return rc, stdout, stderr
|
||||
return 0, "", ""
|
||||
|
||||
def _try_parse_stderr(self, stderr):
|
||||
def _try_parse_stderr(self, stderr: str) -> None:
|
||||
data = stderr.splitlines()
|
||||
for line in data:
|
||||
unknown_package_regex = self._RE_UNKNOWN_PACKAGE.match(line)
|
||||
@@ -122,15 +127,15 @@ class AndroidSdkManager:
|
||||
raise SdkManagerException(f"Unknown package {package}")
|
||||
|
||||
@staticmethod
|
||||
def _parse_packages(stdout, header_regexp, row_regexp):
|
||||
def _parse_packages(stdout: str, header_regexp: re.Pattern, row_regexp: re.Pattern) -> set[Package]:
|
||||
data = stdout.splitlines()
|
||||
|
||||
section_found = False
|
||||
section_found: bool = False
|
||||
packages = set()
|
||||
|
||||
for line in data:
|
||||
if not section_found:
|
||||
section_found = header_regexp.match(line)
|
||||
section_found = bool(header_regexp.match(line))
|
||||
continue
|
||||
else:
|
||||
p = row_regexp.match(line)
|
||||
|
||||
@@ -7,6 +7,10 @@ from __future__ import annotations
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
import re
|
||||
import os
|
||||
import typing as t
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def normalize_subvolume_path(path):
|
||||
@@ -28,12 +32,12 @@ class BtrfsCommands:
|
||||
Provides access to a subset of the Btrfs command line
|
||||
"""
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
self.__module = module
|
||||
self.__btrfs = self.__module.get_bin_path("btrfs", required=True)
|
||||
self.__btrfs: str = self.__module.get_bin_path("btrfs", required=True)
|
||||
|
||||
def filesystem_show(self):
|
||||
command = f"{self.__btrfs} filesystem show -d"
|
||||
def filesystem_show(self) -> list[dict[str, t.Any]]:
|
||||
command = [self.__btrfs, "filesystem", "show", "-d"]
|
||||
result = self.__module.run_command(command, check_rc=True)
|
||||
stdout = [x.strip() for x in result[1].splitlines()]
|
||||
filesystems = []
|
||||
@@ -43,14 +47,16 @@ class BtrfsCommands:
|
||||
current = self.__parse_filesystem(line)
|
||||
filesystems.append(current)
|
||||
elif line.startswith("devid"):
|
||||
if current is None:
|
||||
raise ValueError("Found 'devid' line without previous 'Label' line")
|
||||
current["devices"].append(self.__parse_filesystem_device(line))
|
||||
return filesystems
|
||||
|
||||
def __parse_filesystem(self, line):
|
||||
def __parse_filesystem(self, line) -> dict[str, t.Any]:
|
||||
label = re.sub(r"\s*uuid:.*$", "", re.sub(r"^Label:\s*", "", line))
|
||||
id = re.sub(r"^.*uuid:\s*", "", line)
|
||||
|
||||
filesystem = {}
|
||||
filesystem: dict[str, t.Any] = {}
|
||||
filesystem["label"] = label.strip("'") if label != "none" else None
|
||||
filesystem["uuid"] = id
|
||||
filesystem["devices"] = []
|
||||
@@ -59,44 +65,44 @@ class BtrfsCommands:
|
||||
filesystem["default_subvolid"] = None
|
||||
return filesystem
|
||||
|
||||
def __parse_filesystem_device(self, line):
|
||||
def __parse_filesystem_device(self, line: str) -> str:
|
||||
return re.sub(r"^.*path\s", "", line)
|
||||
|
||||
def subvolumes_list(self, filesystem_path):
|
||||
command = f"{self.__btrfs} subvolume list -tap {filesystem_path}"
|
||||
def subvolumes_list(self, filesystem_path: str) -> list[dict[str, t.Any]]:
|
||||
command = [self.__btrfs, "subvolume", "list", "-tap", to_bytes(filesystem_path)]
|
||||
result = self.__module.run_command(command, check_rc=True)
|
||||
stdout = [x.split("\t") for x in result[1].splitlines()]
|
||||
subvolumes = [{"id": 5, "parent": None, "path": "/"}]
|
||||
subvolumes: list[dict[str, t.Any]] = [{"id": 5, "parent": None, "path": "/"}]
|
||||
if len(stdout) > 2:
|
||||
subvolumes.extend([self.__parse_subvolume_list_record(x) for x in stdout[2:]])
|
||||
return subvolumes
|
||||
|
||||
def __parse_subvolume_list_record(self, item):
|
||||
def __parse_subvolume_list_record(self, item: list[str]) -> dict[str, t.Any]:
|
||||
return {
|
||||
"id": int(item[0]),
|
||||
"parent": int(item[2]),
|
||||
"path": normalize_subvolume_path(item[5]),
|
||||
}
|
||||
|
||||
def subvolume_get_default(self, filesystem_path):
|
||||
def subvolume_get_default(self, filesystem_path: str) -> int:
|
||||
command = [self.__btrfs, "subvolume", "get-default", to_bytes(filesystem_path)]
|
||||
result = self.__module.run_command(command, check_rc=True)
|
||||
# ID [n] ...
|
||||
return int(result[1].strip().split()[1])
|
||||
|
||||
def subvolume_set_default(self, filesystem_path, subvolume_id):
|
||||
def subvolume_set_default(self, filesystem_path: str, subvolume_id: int) -> None:
|
||||
command = [self.__btrfs, "subvolume", "set-default", str(subvolume_id), to_bytes(filesystem_path)]
|
||||
self.__module.run_command(command, check_rc=True)
|
||||
|
||||
def subvolume_create(self, subvolume_path):
|
||||
def subvolume_create(self, subvolume_path: str) -> None:
|
||||
command = [self.__btrfs, "subvolume", "create", to_bytes(subvolume_path)]
|
||||
self.__module.run_command(command, check_rc=True)
|
||||
|
||||
def subvolume_snapshot(self, snapshot_source, snapshot_destination):
|
||||
def subvolume_snapshot(self, snapshot_source: str, snapshot_destination: str) -> None:
|
||||
command = [self.__btrfs, "subvolume", "snapshot", to_bytes(snapshot_source), to_bytes(snapshot_destination)]
|
||||
self.__module.run_command(command, check_rc=True)
|
||||
|
||||
def subvolume_delete(self, subvolume_path):
|
||||
def subvolume_delete(self, subvolume_path: str) -> None:
|
||||
command = [self.__btrfs, "subvolume", "delete", to_bytes(subvolume_path)]
|
||||
self.__module.run_command(command, check_rc=True)
|
||||
|
||||
@@ -106,12 +112,12 @@ class BtrfsInfoProvider:
|
||||
Utility providing details of the currently available btrfs filesystems
|
||||
"""
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
self.__module = module
|
||||
self.__btrfs_api = BtrfsCommands(module)
|
||||
self.__findmnt_path = self.__module.get_bin_path("findmnt", required=True)
|
||||
self.__findmnt_path: str = self.__module.get_bin_path("findmnt", required=True)
|
||||
|
||||
def get_filesystems(self):
|
||||
def get_filesystems(self) -> list[dict[str, t.Any]]:
|
||||
filesystems = self.__btrfs_api.filesystem_show()
|
||||
mountpoints = self.__find_mountpoints()
|
||||
for filesystem in filesystems:
|
||||
@@ -126,21 +132,23 @@ class BtrfsInfoProvider:
|
||||
|
||||
return filesystems
|
||||
|
||||
def get_mountpoints(self, filesystem_devices):
|
||||
def get_mountpoints(self, filesystem_devices: list[str]) -> list[dict[str, t.Any]]:
|
||||
mountpoints = self.__find_mountpoints()
|
||||
return self.__filter_mountpoints_for_devices(mountpoints, filesystem_devices)
|
||||
|
||||
def get_subvolumes(self, filesystem_path):
|
||||
def get_subvolumes(self, filesystem_path) -> list[dict[str, t.Any]]:
|
||||
return self.__btrfs_api.subvolumes_list(filesystem_path)
|
||||
|
||||
def get_default_subvolume_id(self, filesystem_path):
|
||||
def get_default_subvolume_id(self, filesystem_path) -> int:
|
||||
return self.__btrfs_api.subvolume_get_default(filesystem_path)
|
||||
|
||||
def __filter_mountpoints_for_devices(self, mountpoints, devices):
|
||||
def __filter_mountpoints_for_devices(
|
||||
self, mountpoints: list[dict[str, t.Any]], devices: list[str]
|
||||
) -> list[dict[str, t.Any]]:
|
||||
return [m for m in mountpoints if (m["device"] in devices)]
|
||||
|
||||
def __find_mountpoints(self):
|
||||
command = f"{self.__findmnt_path} -t btrfs -nvP"
|
||||
def __find_mountpoints(self) -> list[dict[str, t.Any]]:
|
||||
command = [self.__findmnt_path, "-t", "btrfs", "-nvP"]
|
||||
result = self.__module.run_command(command)
|
||||
mountpoints = []
|
||||
if result[0] == 0:
|
||||
@@ -150,7 +158,7 @@ class BtrfsInfoProvider:
|
||||
mountpoints.append(mountpoint)
|
||||
return mountpoints
|
||||
|
||||
def __parse_mountpoint_pairs(self, line):
|
||||
def __parse_mountpoint_pairs(self, line) -> dict[str, t.Any]:
|
||||
pattern = re.compile(
|
||||
r'^TARGET="(?P<target>.*)"\s+SOURCE="(?P<source>.*)"\s+FSTYPE="(?P<fstype>.*)"\s+OPTIONS="(?P<options>.*)"\s*$'
|
||||
)
|
||||
@@ -164,13 +172,13 @@ class BtrfsInfoProvider:
|
||||
"subvolid": self.__extract_mount_subvolid(groups["options"]),
|
||||
}
|
||||
else:
|
||||
raise BtrfsModuleException(f"Failed to parse findmnt result for line: '{line}'")
|
||||
raise BtrfsModuleException(f"Failed to parse findmnt result for line: {line!r}")
|
||||
|
||||
def __extract_mount_subvolid(self, mount_options):
|
||||
def __extract_mount_subvolid(self, mount_options: str) -> int:
|
||||
for option in mount_options.split(","):
|
||||
if option.startswith("subvolid="):
|
||||
return int(option[len("subvolid=") :])
|
||||
raise BtrfsModuleException(f"Failed to find subvolid for mountpoint in options '{mount_options}'")
|
||||
raise BtrfsModuleException(f"Failed to find subvolid for mountpoint in options {mount_options!r}")
|
||||
|
||||
|
||||
class BtrfsSubvolume:
|
||||
@@ -178,39 +186,38 @@ class BtrfsSubvolume:
|
||||
Wrapper class providing convenience methods for inspection of a btrfs subvolume
|
||||
"""
|
||||
|
||||
def __init__(self, filesystem, subvolume_id):
|
||||
def __init__(self, filesystem: BtrfsFilesystem, subvolume_id: int):
|
||||
self.__filesystem = filesystem
|
||||
self.__subvolume_id = subvolume_id
|
||||
|
||||
def get_filesystem(self):
|
||||
def get_filesystem(self) -> BtrfsFilesystem:
|
||||
return self.__filesystem
|
||||
|
||||
def is_mounted(self):
|
||||
def is_mounted(self) -> bool:
|
||||
mountpoints = self.get_mountpoints()
|
||||
return mountpoints is not None and len(mountpoints) > 0
|
||||
|
||||
def is_filesystem_root(self):
|
||||
def is_filesystem_root(self) -> bool:
|
||||
return self.__subvolume_id == 5
|
||||
|
||||
def is_filesystem_default(self):
|
||||
def is_filesystem_default(self) -> bool:
|
||||
return self.__filesystem.default_subvolid == self.__subvolume_id
|
||||
|
||||
def get_mounted_path(self):
|
||||
def get_mounted_path(self) -> str | None:
|
||||
mountpoints = self.get_mountpoints()
|
||||
if mountpoints is not None and len(mountpoints) > 0:
|
||||
return mountpoints[0]
|
||||
elif self.parent is not None:
|
||||
if self.parent is not None:
|
||||
parent = self.__filesystem.get_subvolume_by_id(self.parent)
|
||||
parent_path = parent.get_mounted_path()
|
||||
parent_path = parent.get_mounted_path() if parent else None
|
||||
if parent_path is not None:
|
||||
return parent_path + os.path.sep + self.name
|
||||
else:
|
||||
return None
|
||||
return f"{parent_path}{os.path.sep}{self.name}"
|
||||
return None
|
||||
|
||||
def get_mountpoints(self):
|
||||
def get_mountpoints(self) -> list[str]:
|
||||
return self.__filesystem.get_mountpoints_by_subvolume_id(self.__subvolume_id)
|
||||
|
||||
def get_child_relative_path(self, absolute_child_path):
|
||||
def get_child_relative_path(self, absolute_child_path: str) -> str:
|
||||
"""
|
||||
Get the relative path from this subvolume to the named child subvolume.
|
||||
The provided parameter is expected to be normalized as by normalize_subvolume_path.
|
||||
@@ -222,19 +229,21 @@ class BtrfsSubvolume:
|
||||
else:
|
||||
raise BtrfsModuleException(f"Path '{absolute_child_path}' doesn't start with '{path}'")
|
||||
|
||||
def get_parent_subvolume(self):
|
||||
def get_parent_subvolume(self) -> BtrfsSubvolume | None:
|
||||
parent_id = self.parent
|
||||
return self.__filesystem.get_subvolume_by_id(parent_id) if parent_id is not None else None
|
||||
|
||||
def get_child_subvolumes(self):
|
||||
def get_child_subvolumes(self) -> list[BtrfsSubvolume]:
|
||||
return self.__filesystem.get_subvolume_children(self.__subvolume_id)
|
||||
|
||||
@property
|
||||
def __info(self):
|
||||
return self.__filesystem.get_subvolume_info_for_id(self.__subvolume_id)
|
||||
def __info(self) -> dict[str, t.Any]:
|
||||
result = self.__filesystem.get_subvolume_info_for_id(self.__subvolume_id)
|
||||
# assert result is not None
|
||||
return result # type: ignore
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
def id(self) -> int:
|
||||
return self.__subvolume_id
|
||||
|
||||
@property
|
||||
@@ -242,7 +251,7 @@ class BtrfsSubvolume:
|
||||
return self.path.split("/").pop()
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
def path(self) -> str:
|
||||
return self.__info["path"]
|
||||
|
||||
@property
|
||||
@@ -255,105 +264,105 @@ class BtrfsFilesystem:
|
||||
Wrapper class providing convenience methods for inspection of a btrfs filesystem
|
||||
"""
|
||||
|
||||
def __init__(self, info, provider, module):
|
||||
def __init__(self, info: dict[str, t.Any], provider: BtrfsInfoProvider, module: AnsibleModule) -> None:
|
||||
self.__provider = provider
|
||||
|
||||
# constant for module execution
|
||||
self.__uuid = info["uuid"]
|
||||
self.__label = info["label"]
|
||||
self.__devices = info["devices"]
|
||||
self.__uuid: str = info["uuid"]
|
||||
self.__label: str = info["label"]
|
||||
self.__devices: list[str] = info["devices"]
|
||||
|
||||
# refreshable
|
||||
self.__default_subvolid = info["default_subvolid"] if "default_subvolid" in info else None
|
||||
self.__default_subvolid: int | None = info["default_subvolid"] if "default_subvolid" in info else None
|
||||
self.__update_mountpoints(info["mountpoints"] if "mountpoints" in info else [])
|
||||
self.__update_subvolumes(info["subvolumes"] if "subvolumes" in info else [])
|
||||
|
||||
@property
|
||||
def uuid(self):
|
||||
def uuid(self) -> str:
|
||||
return self.__uuid
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
def label(self) -> str:
|
||||
return self.__label
|
||||
|
||||
@property
|
||||
def default_subvolid(self):
|
||||
def default_subvolid(self) -> int | None:
|
||||
return self.__default_subvolid
|
||||
|
||||
@property
|
||||
def devices(self):
|
||||
def devices(self) -> list[str]:
|
||||
return list(self.__devices)
|
||||
|
||||
def refresh(self):
|
||||
def refresh(self) -> None:
|
||||
self.refresh_mountpoints()
|
||||
self.refresh_subvolumes()
|
||||
self.refresh_default_subvolume()
|
||||
|
||||
def refresh_mountpoints(self):
|
||||
def refresh_mountpoints(self) -> None:
|
||||
mountpoints = self.__provider.get_mountpoints(list(self.__devices))
|
||||
self.__update_mountpoints(mountpoints)
|
||||
|
||||
def __update_mountpoints(self, mountpoints):
|
||||
self.__mountpoints = dict()
|
||||
def __update_mountpoints(self, mountpoints: list[dict[str, t.Any]]) -> None:
|
||||
self.__mountpoints: dict[int, list[str]] = dict()
|
||||
for i in mountpoints:
|
||||
subvolid = i["subvolid"]
|
||||
mountpoint = i["mountpoint"]
|
||||
subvolid: int = i["subvolid"]
|
||||
mountpoint: str = i["mountpoint"]
|
||||
if subvolid not in self.__mountpoints:
|
||||
self.__mountpoints[subvolid] = []
|
||||
self.__mountpoints[subvolid].append(mountpoint)
|
||||
|
||||
def refresh_subvolumes(self):
|
||||
def refresh_subvolumes(self) -> None:
|
||||
filesystem_path = self.get_any_mountpoint()
|
||||
if filesystem_path is not None:
|
||||
subvolumes = self.__provider.get_subvolumes(filesystem_path)
|
||||
self.__update_subvolumes(subvolumes)
|
||||
|
||||
def __update_subvolumes(self, subvolumes):
|
||||
def __update_subvolumes(self, subvolumes: list[dict[str, t.Any]]) -> None:
|
||||
# TODO strategy for retaining information on deleted subvolumes?
|
||||
self.__subvolumes = dict()
|
||||
self.__subvolumes: dict[int, dict[str, t.Any]] = dict()
|
||||
for subvolume in subvolumes:
|
||||
self.__subvolumes[subvolume["id"]] = subvolume
|
||||
|
||||
def refresh_default_subvolume(self):
|
||||
def refresh_default_subvolume(self) -> None:
|
||||
filesystem_path = self.get_any_mountpoint()
|
||||
if filesystem_path is not None:
|
||||
self.__default_subvolid = self.__provider.get_default_subvolume_id(filesystem_path)
|
||||
|
||||
def contains_device(self, device):
|
||||
def contains_device(self, device: str) -> bool:
|
||||
return device in self.__devices
|
||||
|
||||
def contains_subvolume(self, subvolume):
|
||||
def contains_subvolume(self, subvolume: str) -> bool:
|
||||
return self.get_subvolume_by_name(subvolume) is not None
|
||||
|
||||
def get_subvolume_by_id(self, subvolume_id):
|
||||
def get_subvolume_by_id(self, subvolume_id: int) -> BtrfsSubvolume | None:
|
||||
return BtrfsSubvolume(self, subvolume_id) if subvolume_id in self.__subvolumes else None
|
||||
|
||||
def get_subvolume_info_for_id(self, subvolume_id):
|
||||
def get_subvolume_info_for_id(self, subvolume_id: int) -> dict[str, t.Any] | None:
|
||||
return self.__subvolumes[subvolume_id] if subvolume_id in self.__subvolumes else None
|
||||
|
||||
def get_subvolume_by_name(self, subvolume):
|
||||
def get_subvolume_by_name(self, subvolume: str) -> BtrfsSubvolume | None:
|
||||
for subvolume_info in self.__subvolumes.values():
|
||||
if subvolume_info["path"] == subvolume:
|
||||
return BtrfsSubvolume(self, subvolume_info["id"])
|
||||
return None
|
||||
|
||||
def get_any_mountpoint(self):
|
||||
def get_any_mountpoint(self) -> str | None:
|
||||
for subvol_mountpoints in self.__mountpoints.values():
|
||||
if len(subvol_mountpoints) > 0:
|
||||
return subvol_mountpoints[0]
|
||||
# maybe error?
|
||||
return None
|
||||
|
||||
def get_any_mounted_subvolume(self):
|
||||
def get_any_mounted_subvolume(self) -> BtrfsSubvolume | None:
|
||||
for subvolid, subvol_mountpoints in self.__mountpoints.items():
|
||||
if len(subvol_mountpoints) > 0:
|
||||
return self.get_subvolume_by_id(subvolid)
|
||||
return None
|
||||
|
||||
def get_mountpoints_by_subvolume_id(self, subvolume_id):
|
||||
def get_mountpoints_by_subvolume_id(self, subvolume_id: int) -> list[str]:
|
||||
return self.__mountpoints[subvolume_id] if subvolume_id in self.__mountpoints else []
|
||||
|
||||
def get_nearest_subvolume(self, subvolume):
|
||||
def get_nearest_subvolume(self, subvolume: str) -> BtrfsSubvolume:
|
||||
"""Return the identified subvolume if existing, else the closest matching parent"""
|
||||
subvolumes_by_path = self.__get_subvolumes_by_path()
|
||||
while len(subvolume) > 1:
|
||||
@@ -364,30 +373,31 @@ class BtrfsFilesystem:
|
||||
|
||||
return BtrfsSubvolume(self, 5)
|
||||
|
||||
def get_mountpath_as_child(self, subvolume_name):
|
||||
def get_mountpath_as_child(self, subvolume_name: str) -> str:
|
||||
"""Find a path to the target subvolume through a mounted ancestor"""
|
||||
nearest = self.get_nearest_subvolume(subvolume_name)
|
||||
nearest_or_none: BtrfsSubvolume | None = nearest
|
||||
if nearest.path == subvolume_name:
|
||||
nearest = nearest.get_parent_subvolume()
|
||||
if nearest is None or nearest.get_mounted_path() is None:
|
||||
nearest_or_none = nearest.get_parent_subvolume()
|
||||
if nearest_or_none is None or nearest_or_none.get_mounted_path() is None:
|
||||
raise BtrfsModuleException(f"Failed to find a path '{subvolume_name}' through a mounted parent subvolume")
|
||||
else:
|
||||
return nearest.get_mounted_path() + os.path.sep + nearest.get_child_relative_path(subvolume_name)
|
||||
return f"{nearest_or_none.get_mounted_path()}{os.path.sep}{nearest_or_none.get_child_relative_path(subvolume_name)}"
|
||||
|
||||
def get_subvolume_children(self, subvolume_id):
|
||||
def get_subvolume_children(self, subvolume_id: int) -> list[BtrfsSubvolume]:
|
||||
return [BtrfsSubvolume(self, x["id"]) for x in self.__subvolumes.values() if x["parent"] == subvolume_id]
|
||||
|
||||
def __get_subvolumes_by_path(self):
|
||||
def __get_subvolumes_by_path(self) -> dict[str, dict[str, t.Any]]:
|
||||
result = {}
|
||||
for s in self.__subvolumes.values():
|
||||
path = s["path"]
|
||||
result[path] = s
|
||||
return result
|
||||
|
||||
def is_mounted(self):
|
||||
def is_mounted(self) -> bool:
|
||||
return self.__mountpoints is not None and len(self.__mountpoints) > 0
|
||||
|
||||
def get_summary(self):
|
||||
def get_summary(self) -> dict[str, t.Any]:
|
||||
subvolumes = []
|
||||
sources = self.__subvolumes.values() if self.__subvolumes is not None else []
|
||||
for subvolume in sources:
|
||||
@@ -415,17 +425,19 @@ class BtrfsFilesystemsProvider:
|
||||
Provides methods to query available btrfs filesystems
|
||||
"""
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
self.__module = module
|
||||
self.__provider = BtrfsInfoProvider(module)
|
||||
self.__filesystems = None
|
||||
self.__filesystems: dict[str, BtrfsFilesystem] | None = None
|
||||
|
||||
def get_matching_filesystem(self, criteria):
|
||||
def get_matching_filesystem(self, criteria: dict[str, t.Any]) -> BtrfsFilesystem:
|
||||
if criteria["device"] is not None:
|
||||
criteria["device"] = os.path.realpath(criteria["device"])
|
||||
|
||||
self.__check_init()
|
||||
matching = [f for f in self.__filesystems.values() if self.__filesystem_matches_criteria(f, criteria)]
|
||||
# assert self.__filesystems is not None # TODO
|
||||
self_filesystems: dict[str, BtrfsFilesystem] = self.__filesystems # type: ignore
|
||||
matching = [f for f in self_filesystems.values() if self.__filesystem_matches_criteria(f, criteria)]
|
||||
if len(matching) == 1:
|
||||
return matching[0]
|
||||
else:
|
||||
@@ -433,26 +445,30 @@ class BtrfsFilesystemsProvider:
|
||||
f"Found {len(matching)} filesystems matching criteria uuid={criteria['uuid']} label={criteria['label']} device={criteria['device']}"
|
||||
)
|
||||
|
||||
def __filesystem_matches_criteria(self, filesystem, criteria):
|
||||
def __filesystem_matches_criteria(self, filesystem: BtrfsFilesystem, criteria: dict[str, t.Any]):
|
||||
return (
|
||||
(criteria["uuid"] is None or filesystem.uuid == criteria["uuid"])
|
||||
and (criteria["label"] is None or filesystem.label == criteria["label"])
|
||||
and (criteria["device"] is None or filesystem.contains_device(criteria["device"]))
|
||||
)
|
||||
|
||||
def get_filesystem_for_device(self, device):
|
||||
def get_filesystem_for_device(self, device: str) -> BtrfsFilesystem | None:
|
||||
real_device = os.path.realpath(device)
|
||||
self.__check_init()
|
||||
for fs in self.__filesystems.values():
|
||||
# assert self.__filesystems is not None # TODO
|
||||
self_filesystems: dict[str, BtrfsFilesystem] = self.__filesystems # type: ignore
|
||||
for fs in self_filesystems.values():
|
||||
if fs.contains_device(real_device):
|
||||
return fs
|
||||
return None
|
||||
|
||||
def get_filesystems(self):
|
||||
def get_filesystems(self) -> list[BtrfsFilesystem]:
|
||||
self.__check_init()
|
||||
return list(self.__filesystems.values())
|
||||
# assert self.__filesystems is not None # TODO
|
||||
self_filesystems: dict[str, BtrfsFilesystem] = self.__filesystems # type: ignore
|
||||
return list(self_filesystems.values())
|
||||
|
||||
def __check_init(self):
|
||||
def __check_init(self) -> None:
|
||||
if self.__filesystems is None:
|
||||
self.__filesystems = dict()
|
||||
for f in self.__provider.get_filesystems():
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# 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
|
||||
|
||||
# This module utils is deprecated and will be removed in community.general 13.0.0
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
|
||||
@@ -5,11 +5,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.collections import is_sequence
|
||||
from ansible.module_utils.common.locale import get_best_parsable_locale
|
||||
from ansible_collections.community.general.plugins.module_utils import cmd_runner_fmt
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner_fmt import ArgFormatType
|
||||
|
||||
ArgFormatter = t.Union[ArgFormatType, cmd_runner_fmt._ArgFormat] # noqa: UP007
|
||||
|
||||
|
||||
def _ensure_list(value):
|
||||
return list(value) if is_sequence(value) else [value]
|
||||
@@ -24,7 +32,7 @@ class CmdRunnerException(Exception):
|
||||
|
||||
|
||||
class MissingArgumentFormat(CmdRunnerException):
|
||||
def __init__(self, arg, args_order, args_formats):
|
||||
def __init__(self, arg, args_order: tuple[str, ...], args_formats) -> None:
|
||||
self.args_order = args_order
|
||||
self.arg = arg
|
||||
self.args_formats = args_formats
|
||||
@@ -37,7 +45,7 @@ class MissingArgumentFormat(CmdRunnerException):
|
||||
|
||||
|
||||
class MissingArgumentValue(CmdRunnerException):
|
||||
def __init__(self, args_order, arg):
|
||||
def __init__(self, args_order: tuple[str, ...], arg) -> None:
|
||||
self.args_order = args_order
|
||||
self.arg = arg
|
||||
|
||||
@@ -72,19 +80,19 @@ class CmdRunner:
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def _prepare_args_order(order):
|
||||
return tuple(order) if is_sequence(order) else tuple(order.split())
|
||||
def _prepare_args_order(order: str | Sequence[str]) -> tuple[str, ...]:
|
||||
return tuple(order) if is_sequence(order) else tuple(order.split()) # type: ignore
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
module,
|
||||
module: AnsibleModule,
|
||||
command,
|
||||
arg_formats=None,
|
||||
default_args_order=(),
|
||||
check_rc=False,
|
||||
force_lang="C",
|
||||
path_prefix=None,
|
||||
environ_update=None,
|
||||
arg_formats: Mapping[str, ArgFormatter] | None = None,
|
||||
default_args_order: str | Sequence[str] = (),
|
||||
check_rc: bool = False,
|
||||
force_lang: str = "C",
|
||||
path_prefix: Sequence[str] | None = None,
|
||||
environ_update: dict[str, str] | None = None,
|
||||
):
|
||||
self.module = module
|
||||
self.command = _ensure_list(command)
|
||||
@@ -117,10 +125,17 @@ class CmdRunner:
|
||||
)
|
||||
|
||||
@property
|
||||
def binary(self):
|
||||
def binary(self) -> str:
|
||||
return self.command[0]
|
||||
|
||||
def __call__(self, args_order=None, output_process=None, check_mode_skip=False, check_mode_return=None, **kwargs):
|
||||
def __call__(
|
||||
self,
|
||||
args_order: str | Sequence[str] | None = None,
|
||||
output_process: Callable[[int, str, str], t.Any] | None = None,
|
||||
check_mode_skip: bool = False,
|
||||
check_mode_return: t.Any | None = None,
|
||||
**kwargs,
|
||||
):
|
||||
if output_process is None:
|
||||
output_process = _process_as_is
|
||||
if args_order is None:
|
||||
@@ -146,7 +161,15 @@ class CmdRunner:
|
||||
|
||||
|
||||
class _CmdRunnerContext:
|
||||
def __init__(self, runner, args_order, output_process, check_mode_skip, check_mode_return, **kwargs):
|
||||
def __init__(
|
||||
self,
|
||||
runner: CmdRunner,
|
||||
args_order: tuple[str, ...],
|
||||
output_process: Callable[[int, str, str], t.Any],
|
||||
check_mode_skip: bool,
|
||||
check_mode_return: t.Any,
|
||||
**kwargs,
|
||||
) -> None:
|
||||
self.runner = runner
|
||||
self.args_order = tuple(args_order)
|
||||
self.output_process = output_process
|
||||
@@ -194,7 +217,7 @@ class _CmdRunnerContext:
|
||||
except MissingArgumentValue:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise FormatError(arg_name, value, runner.arg_formats[arg_name], e)
|
||||
raise FormatError(arg_name, value, runner.arg_formats[arg_name], e) from e
|
||||
|
||||
if self.check_mode_skip and module.check_mode:
|
||||
return self.check_mode_return
|
||||
@@ -204,7 +227,7 @@ class _CmdRunnerContext:
|
||||
return self.results_processed
|
||||
|
||||
@property
|
||||
def run_info(self):
|
||||
def run_info(self) -> dict[str, t.Any]:
|
||||
return dict(
|
||||
check_rc=self.check_rc,
|
||||
environ_update=self.environ_update,
|
||||
|
||||
@@ -11,36 +11,46 @@ from functools import wraps
|
||||
from ansible.module_utils.common.collections import is_sequence
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
|
||||
ArgFormatType = Callable[[t.Any], list[str]]
|
||||
ArgFormatType = Callable[[t.Any], Sequence[t.Any]]
|
||||
_T = t.TypeVar("_T")
|
||||
|
||||
|
||||
def _ensure_list(value):
|
||||
return list(value) if is_sequence(value) else [value]
|
||||
def _ensure_list(value: _T | Sequence[_T]) -> list[_T]:
|
||||
return list(value) if is_sequence(value) else [value] # type: ignore # TODO need type assertion for is_sequence
|
||||
|
||||
|
||||
class _ArgFormat:
|
||||
def __init__(self, func, ignore_none=True, ignore_missing_value=False):
|
||||
def __init__(
|
||||
self,
|
||||
func: ArgFormatType,
|
||||
ignore_none: bool | None = True,
|
||||
ignore_missing_value: bool = False,
|
||||
) -> None:
|
||||
self.func = func
|
||||
self.ignore_none = ignore_none
|
||||
self.ignore_missing_value = ignore_missing_value
|
||||
|
||||
def __call__(self, value):
|
||||
def __call__(self, value: t.Any | None) -> list[str]:
|
||||
ignore_none = self.ignore_none if self.ignore_none is not None else True
|
||||
if value is None and ignore_none:
|
||||
return []
|
||||
f = self.func
|
||||
return [str(x) for x in f(value)]
|
||||
|
||||
def __str__(self):
|
||||
def __str__(self) -> str:
|
||||
return f"<ArgFormat: func={self.func}, ignore_none={self.ignore_none}, ignore_missing_value={self.ignore_missing_value}>"
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return str(self)
|
||||
|
||||
|
||||
def as_bool(args_true, args_false=None, ignore_none=None):
|
||||
def as_bool(
|
||||
args_true: Sequence[t.Any] | t.Any,
|
||||
args_false: Sequence[t.Any] | t.Any | None = None,
|
||||
ignore_none: bool | None = None,
|
||||
) -> _ArgFormat:
|
||||
if args_false is not None:
|
||||
if ignore_none is None:
|
||||
ignore_none = False
|
||||
@@ -51,24 +61,24 @@ def as_bool(args_true, args_false=None, ignore_none=None):
|
||||
)
|
||||
|
||||
|
||||
def as_bool_not(args):
|
||||
def as_bool_not(args: Sequence[t.Any] | t.Any) -> _ArgFormat:
|
||||
return as_bool([], args, ignore_none=False)
|
||||
|
||||
|
||||
def as_optval(arg, ignore_none=None):
|
||||
def as_optval(arg, ignore_none: bool | None = None) -> _ArgFormat:
|
||||
return _ArgFormat(lambda value: [f"{arg}{value}"], ignore_none=ignore_none)
|
||||
|
||||
|
||||
def as_opt_val(arg, ignore_none=None):
|
||||
def as_opt_val(arg: str, ignore_none: bool | None = None) -> _ArgFormat:
|
||||
return _ArgFormat(lambda value: [arg, value], ignore_none=ignore_none)
|
||||
|
||||
|
||||
def as_opt_eq_val(arg, ignore_none=None):
|
||||
def as_opt_eq_val(arg: str, ignore_none: bool | None = None) -> _ArgFormat:
|
||||
return _ArgFormat(lambda value: [f"{arg}={value}"], ignore_none=ignore_none)
|
||||
|
||||
|
||||
def as_list(ignore_none=None, min_len=0, max_len=None):
|
||||
def func(value):
|
||||
def as_list(ignore_none: bool | None = None, min_len: int = 0, max_len: int | None = None) -> _ArgFormat:
|
||||
def func(value: t.Any) -> list[t.Any]:
|
||||
value = _ensure_list(value)
|
||||
if len(value) < min_len:
|
||||
raise ValueError(f"Parameter must have at least {min_len} element(s)")
|
||||
@@ -79,17 +89,21 @@ def as_list(ignore_none=None, min_len=0, max_len=None):
|
||||
return _ArgFormat(func, ignore_none=ignore_none)
|
||||
|
||||
|
||||
def as_fixed(*args):
|
||||
def as_fixed(*args: t.Any) -> _ArgFormat:
|
||||
if len(args) == 1 and is_sequence(args[0]):
|
||||
args = args[0]
|
||||
return _ArgFormat(lambda value: _ensure_list(args), ignore_none=False, ignore_missing_value=True)
|
||||
|
||||
|
||||
def as_func(func, ignore_none=None):
|
||||
def as_func(func: ArgFormatType, ignore_none: bool | None = None) -> _ArgFormat:
|
||||
return _ArgFormat(func, ignore_none=ignore_none)
|
||||
|
||||
|
||||
def as_map(_map, default=None, ignore_none=None):
|
||||
def as_map(
|
||||
_map: Mapping[t.Any, Sequence[t.Any] | t.Any],
|
||||
default: Sequence[t.Any] | t.Any | None = None,
|
||||
ignore_none: bool | None = None,
|
||||
) -> _ArgFormat:
|
||||
if default is None:
|
||||
default = []
|
||||
return _ArgFormat(lambda value: _ensure_list(_map.get(value, default)), ignore_none=ignore_none)
|
||||
@@ -126,5 +140,5 @@ def stack(fmt):
|
||||
return wrapper
|
||||
|
||||
|
||||
def is_argformat(fmt):
|
||||
def is_argformat(fmt: object) -> t.TypeGuard[_ArgFormat]:
|
||||
return isinstance(fmt, _ArgFormat)
|
||||
|
||||
@@ -14,6 +14,9 @@ from urllib.parse import urlencode
|
||||
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def get_consul_url(configuration):
|
||||
return f"{configuration.scheme}://{configuration.host}:{configuration.port}/v1"
|
||||
@@ -120,7 +123,7 @@ class _ConsulModule:
|
||||
operational_attributes: set[str] = set()
|
||||
params: dict[str, t.Any] = {}
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
self._module = module
|
||||
self.params = _normalize_params(module.params, module.argument_spec)
|
||||
self.api_params = {
|
||||
|
||||
@@ -6,11 +6,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import csv
|
||||
import typing as t
|
||||
from io import StringIO
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from collections.abc import Sequence
|
||||
|
||||
class DialectParamsOrNone(t.TypedDict):
|
||||
delimiter: t.NotRequired[str | None]
|
||||
doublequote: t.NotRequired[bool | None]
|
||||
escapechar: t.NotRequired[str | None]
|
||||
lineterminator: t.NotRequired[str | None]
|
||||
quotechar: t.NotRequired[str | None]
|
||||
quoting: t.NotRequired[int | None]
|
||||
skipinitialspace: t.NotRequired[bool | None]
|
||||
strict: t.NotRequired[bool | None]
|
||||
|
||||
|
||||
class CustomDialectFailureError(Exception):
|
||||
pass
|
||||
|
||||
@@ -22,7 +37,7 @@ class DialectNotAvailableError(Exception):
|
||||
CSVError = csv.Error
|
||||
|
||||
|
||||
def initialize_dialect(dialect, **kwargs):
|
||||
def initialize_dialect(dialect: str, **kwargs: t.Unpack[DialectParamsOrNone]) -> str:
|
||||
# Add Unix dialect from Python 3
|
||||
class unix_dialect(csv.Dialect):
|
||||
"""Describe the usual properties of Unix-generated CSV files."""
|
||||
@@ -43,16 +58,16 @@ def initialize_dialect(dialect, **kwargs):
|
||||
dialect_params = {k: v for k, v in kwargs.items() if v is not None}
|
||||
if dialect_params:
|
||||
try:
|
||||
csv.register_dialect("custom", dialect, **dialect_params)
|
||||
csv.register_dialect("custom", dialect, **dialect_params) # type: ignore
|
||||
except TypeError as e:
|
||||
raise CustomDialectFailureError(f"Unable to create custom dialect: {e}")
|
||||
raise CustomDialectFailureError(f"Unable to create custom dialect: {e}") from e
|
||||
dialect = "custom"
|
||||
|
||||
return dialect
|
||||
|
||||
|
||||
def read_csv(data, dialect, fieldnames=None):
|
||||
BOM = to_native("\ufeff")
|
||||
def read_csv(data: str, dialect: str, fieldnames: Sequence[str] | None = None) -> csv.DictReader:
|
||||
BOM = "\ufeff"
|
||||
data = to_native(data, errors="surrogate_or_strict")
|
||||
if data.startswith(BOM):
|
||||
data = data[len(BOM) :]
|
||||
|
||||
@@ -9,9 +9,15 @@
|
||||
# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
# This module utils is deprecated and will be removed in community.general 13.0.0
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import typing as t
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
# Input patterns for is_input_dangerous function:
|
||||
@@ -56,8 +62,8 @@ def _find_end_quote(identifier, quote_char):
|
||||
while True:
|
||||
try:
|
||||
quote = identifier.index(quote_char)
|
||||
except ValueError:
|
||||
raise UnclosedQuoteError
|
||||
except ValueError as e:
|
||||
raise UnclosedQuoteError from e
|
||||
accumulate = accumulate + quote
|
||||
try:
|
||||
next_char = identifier[quote + 1]
|
||||
@@ -67,8 +73,8 @@ def _find_end_quote(identifier, quote_char):
|
||||
try:
|
||||
identifier = identifier[quote + 2 :]
|
||||
accumulate = accumulate + 2
|
||||
except IndexError:
|
||||
raise UnclosedQuoteError
|
||||
except IndexError as e:
|
||||
raise UnclosedQuoteError from e
|
||||
else:
|
||||
return accumulate
|
||||
|
||||
@@ -157,14 +163,10 @@ def is_input_dangerous(string):
|
||||
if not string:
|
||||
return False
|
||||
|
||||
for pattern in (PATTERN_1, PATTERN_2, PATTERN_3):
|
||||
if re.search(pattern, string):
|
||||
return True
|
||||
|
||||
return False
|
||||
return any(pattern.search(string) for pattern in (PATTERN_1, PATTERN_2, PATTERN_3))
|
||||
|
||||
|
||||
def check_input(module, *args):
|
||||
def check_input(module: AnsibleModule, *args) -> None:
|
||||
"""Wrapper for is_input_dangerous function."""
|
||||
needs_to_check = args
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ from __future__ import annotations
|
||||
import datetime as _datetime
|
||||
|
||||
|
||||
def ensure_timezone_info(value):
|
||||
def ensure_timezone_info(value: _datetime.datetime) -> _datetime.datetime:
|
||||
if value.tzinfo is not None:
|
||||
return value
|
||||
return value.astimezone(_datetime.timezone.utc)
|
||||
|
||||
|
||||
def fromtimestamp(value):
|
||||
return _datetime.fromtimestamp(value, tz=_datetime.timezone.utc)
|
||||
def fromtimestamp(value: int | float) -> _datetime.datetime:
|
||||
return _datetime.datetime.fromtimestamp(value, tz=_datetime.timezone.utc)
|
||||
|
||||
|
||||
def now():
|
||||
def now() -> _datetime.datetime:
|
||||
return _datetime.datetime.now(tz=_datetime.timezone.utc)
|
||||
|
||||
@@ -7,57 +7,65 @@ from __future__ import annotations
|
||||
|
||||
|
||||
import traceback
|
||||
import typing as t
|
||||
from contextlib import contextmanager
|
||||
from enum import Enum
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
_deps = dict()
|
||||
|
||||
_deps: dict[str, _Dependency] = dict()
|
||||
|
||||
|
||||
class _State(Enum):
|
||||
PENDING = "pending"
|
||||
FAILURE = "failure"
|
||||
SUCCESS = "success"
|
||||
|
||||
|
||||
class _Dependency:
|
||||
_states = ["pending", "failure", "success"]
|
||||
|
||||
def __init__(self, name, reason=None, url=None, msg=None):
|
||||
def __init__(self, name: str, reason: str | None = None, url: str | None = None, msg: str | None = None) -> None:
|
||||
self.name = name
|
||||
self.reason = reason
|
||||
self.url = url
|
||||
self.msg = msg
|
||||
|
||||
self.state = 0
|
||||
self.trace = None
|
||||
self.exc = None
|
||||
self.state = _State.PENDING
|
||||
self.trace: str | None = None
|
||||
self.exc: Exception | None = None
|
||||
|
||||
def succeed(self):
|
||||
self.state = 2
|
||||
def succeed(self) -> None:
|
||||
self.state = _State.SUCCESS
|
||||
|
||||
def fail(self, exc, trace):
|
||||
self.state = 1
|
||||
def fail(self, exc: Exception, trace: str) -> None:
|
||||
self.state = _State.FAILURE
|
||||
self.exc = exc
|
||||
self.trace = trace
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
def message(self) -> str:
|
||||
if self.msg:
|
||||
return to_native(self.msg)
|
||||
return str(self.msg)
|
||||
else:
|
||||
return missing_required_lib(self.name, reason=self.reason, url=self.url)
|
||||
|
||||
@property
|
||||
def failed(self):
|
||||
return self.state == 1
|
||||
def failed(self) -> bool:
|
||||
return self.state == _State.FAILURE
|
||||
|
||||
def validate(self, module):
|
||||
def validate(self, module: AnsibleModule) -> None:
|
||||
if self.failed:
|
||||
module.fail_json(msg=self.message, exception=self.trace)
|
||||
|
||||
def __str__(self):
|
||||
return f"<dependency: {self.name} [{self._states[self.state]}]>"
|
||||
def __str__(self) -> str:
|
||||
return f"<dependency: {self.name} [{self.state.value}]>"
|
||||
|
||||
|
||||
@contextmanager
|
||||
def declare(name, *args, **kwargs):
|
||||
def declare(name: str, *args, **kwargs) -> t.Generator[_Dependency]:
|
||||
dep = _Dependency(name, *args, **kwargs)
|
||||
try:
|
||||
yield dep
|
||||
@@ -69,7 +77,7 @@ def declare(name, *args, **kwargs):
|
||||
_deps[name] = dep
|
||||
|
||||
|
||||
def _select_names(spec):
|
||||
def _select_names(spec: str | None) -> list[str]:
|
||||
dep_names = sorted(_deps)
|
||||
|
||||
if spec:
|
||||
@@ -87,14 +95,14 @@ def _select_names(spec):
|
||||
return dep_names
|
||||
|
||||
|
||||
def validate(module, spec=None):
|
||||
def validate(module: AnsibleModule, spec: str | None = None) -> None:
|
||||
for dep in _select_names(spec):
|
||||
_deps[dep].validate(module)
|
||||
|
||||
|
||||
def failed(spec=None):
|
||||
def failed(spec: str | None = None) -> bool:
|
||||
return any(_deps[d].failed for d in _select_names(spec))
|
||||
|
||||
|
||||
def clear():
|
||||
def clear() -> None:
|
||||
_deps.clear()
|
||||
|
||||
@@ -24,7 +24,6 @@ import os
|
||||
import re
|
||||
import traceback
|
||||
|
||||
# (TODO: remove AnsibleModule from next line!)
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib # noqa: F401, pylint: disable=unused-import
|
||||
from os.path import expanduser
|
||||
from uuid import UUID
|
||||
@@ -57,7 +56,7 @@ class DimensionDataModule:
|
||||
The base class containing common functionality used by Dimension Data modules for Ansible.
|
||||
"""
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
"""
|
||||
Create a new DimensionDataModule.
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ from ansible_collections.community.general.plugins.module_utils.python_runner im
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from .cmd_runner_fmt import ArgFormatType
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import ArgFormatter
|
||||
|
||||
|
||||
django_std_args = dict(
|
||||
@@ -36,7 +37,7 @@ _pks = dict(
|
||||
primary_keys=dict(type="list", elements="str"),
|
||||
)
|
||||
|
||||
_django_std_arg_fmts: dict[str, ArgFormatType] = dict(
|
||||
_django_std_arg_fmts: dict[str, ArgFormatter] = dict(
|
||||
all=cmd_runner_fmt.as_bool("--all"),
|
||||
app=cmd_runner_fmt.as_opt_val("--app"),
|
||||
apps=cmd_runner_fmt.as_list(),
|
||||
@@ -81,7 +82,7 @@ _args_menu = dict(
|
||||
|
||||
|
||||
class _DjangoRunner(PythonRunner):
|
||||
def __init__(self, module, arg_formats=None, **kwargs):
|
||||
def __init__(self, module: AnsibleModule, arg_formats=None, **kwargs) -> None:
|
||||
arg_fmts = dict(arg_formats) if arg_formats else {}
|
||||
arg_fmts.update(_django_std_arg_fmts)
|
||||
|
||||
@@ -108,12 +109,12 @@ class _DjangoRunner(PythonRunner):
|
||||
class DjangoModuleHelper(ModuleHelper):
|
||||
module = {}
|
||||
django_admin_cmd: str | None = None
|
||||
arg_formats: dict[str, ArgFormatType] = {}
|
||||
arg_formats: dict[str, ArgFormatter] = {}
|
||||
django_admin_arg_order: tuple[str, ...] | str = ()
|
||||
_django_args: list[str] = []
|
||||
_check_mode_arg: str = ""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
self.module["argument_spec"], self.arg_formats = self._build_args(
|
||||
self.module.get("argument_spec", {}), self.arg_formats, *(["std"] + self._django_args)
|
||||
)
|
||||
@@ -122,9 +123,9 @@ class DjangoModuleHelper(ModuleHelper):
|
||||
self.vars.command = self.django_admin_cmd
|
||||
|
||||
@staticmethod
|
||||
def _build_args(arg_spec, arg_format, *names):
|
||||
res_arg_spec = {}
|
||||
res_arg_fmts = {}
|
||||
def _build_args(arg_spec, arg_format, *names) -> tuple[dict[str, t.Any], dict[str, ArgFormatter]]:
|
||||
res_arg_spec: dict[str, t.Any] = {}
|
||||
res_arg_fmts: dict[str, ArgFormatter] = {}
|
||||
for name in names:
|
||||
args, fmts = _args_menu[name]
|
||||
res_arg_spec = dict_merge(res_arg_spec, args)
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
class GandiLiveDNSAPI:
|
||||
api_endpoint = "https://api.gandi.net/v5/livedns"
|
||||
@@ -22,7 +25,7 @@ class GandiLiveDNSAPI:
|
||||
|
||||
attribute_map = {"record": "rrset_name", "type": "rrset_type", "ttl": "rrset_ttl", "values": "rrset_values"}
|
||||
|
||||
def __init__(self, module):
|
||||
def __init__(self, module: AnsibleModule) -> None:
|
||||
self.module = module
|
||||
self.api_key = module.params["api_key"]
|
||||
self.personal_access_token = module.params["personal_access_token"]
|
||||
@@ -70,7 +73,7 @@ class GandiLiveDNSAPI:
|
||||
|
||||
if content:
|
||||
try:
|
||||
result = json.loads(to_text(content, errors="surrogate_or_strict"))
|
||||
result = json.loads(content)
|
||||
except getattr(json, "JSONDecodeError", ValueError) as e:
|
||||
error_msg += f"; Failed to parse API response with error {e}: {content}"
|
||||
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
_state_map = {
|
||||
"present": "--set",
|
||||
@@ -14,7 +19,7 @@ _state_map = {
|
||||
}
|
||||
|
||||
|
||||
def gconftool2_runner(module, **kwargs):
|
||||
def gconftool2_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
|
||||
return CmdRunner(
|
||||
module,
|
||||
command="gconftool-2",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user