mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-29 01:46:53 +00:00
Compare commits
80 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
862e6d035f | ||
|
|
12b000ac76 | ||
|
|
ae6fa9a684 | ||
|
|
a87b62d521 | ||
|
|
fce2a7e1be | ||
|
|
f5b6ad1bb7 | ||
|
|
efaf037775 | ||
|
|
a3ef32b758 | ||
|
|
b5c23d5741 | ||
|
|
2ca4a8e472 | ||
|
|
c9819b57b3 | ||
|
|
6230a7a842 | ||
|
|
46c63be23a | ||
|
|
e930e3d42a | ||
|
|
72fc0fd22a | ||
|
|
8dc5eeb11b | ||
|
|
e509382dda | ||
|
|
26b7f0e85b | ||
|
|
9ed35900ba | ||
|
|
1dcbebda20 | ||
|
|
f9c620a83c | ||
|
|
ac2704c629 | ||
|
|
018f4c989d | ||
|
|
d480f5792b | ||
|
|
5c00c5b3a5 | ||
|
|
f7f5c7f913 | ||
|
|
93257c32a8 | ||
|
|
63ed9a553f | ||
|
|
54861a2062 | ||
|
|
b18b9314d3 | ||
|
|
7631941cdd | ||
|
|
7daa21210f | ||
|
|
cfc06284c6 | ||
|
|
71a15b5002 | ||
|
|
2184016f5a | ||
|
|
aa1920bc28 | ||
|
|
add153098e | ||
|
|
cfcfbc19d7 | ||
|
|
d5f3e6fa7f | ||
|
|
68b233aa96 | ||
|
|
8ad2bc31a3 | ||
|
|
8b3fb0b6c0 | ||
|
|
ac3e2bcaa9 | ||
|
|
bc1d0c4663 | ||
|
|
34d9809c0d | ||
|
|
cb26c50d65 | ||
|
|
67269f302d | ||
|
|
fd48bc38f1 | ||
|
|
f89102ffdc | ||
|
|
3d3328ecaf | ||
|
|
fee8278015 | ||
|
|
93c121d4a6 | ||
|
|
12a21e0517 | ||
|
|
7e49c825f7 | ||
|
|
4cce99abb5 | ||
|
|
5a7a3b2f5e | ||
|
|
d481a6b0d4 | ||
|
|
7a9253e68b | ||
|
|
7945d5afbe | ||
|
|
c28021b662 | ||
|
|
3dd39fedd2 | ||
|
|
6d8549f00a | ||
|
|
805362f337 | ||
|
|
c0b5119034 | ||
|
|
fd8a452f22 | ||
|
|
6d46e650b7 | ||
|
|
b4468bd4c7 | ||
|
|
e2af16b03f | ||
|
|
3abf169a2f | ||
|
|
5039265621 | ||
|
|
b52b754a3d | ||
|
|
9aef7ad67e | ||
|
|
0e15608149 | ||
|
|
844e3a581c | ||
|
|
3c86bb9cda | ||
|
|
8222f1f064 | ||
|
|
78e552469a | ||
|
|
acdf0cdc2f | ||
|
|
1246c3357b | ||
|
|
c5f939fbc5 |
@@ -1,9 +0,0 @@
|
||||
<!--
|
||||
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
|
||||
-->
|
||||
|
||||
## Azure Pipelines Configuration
|
||||
|
||||
Please see the [Documentation](https://github.com/ansible/community/wiki/Testing:-Azure-Pipelines) for more information.
|
||||
@@ -1,435 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
trigger:
|
||||
batch: true
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- stable-*
|
||||
|
||||
pr:
|
||||
autoCancel: true
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- stable-*
|
||||
|
||||
schedules:
|
||||
- cron: 0 8 * * *
|
||||
displayName: Nightly (main)
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- cron: 0 10 * * *
|
||||
displayName: Nightly (active stable branches)
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-10
|
||||
- stable-9
|
||||
- cron: 0 11 * * 0
|
||||
displayName: Weekly (old stable branches)
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-8
|
||||
|
||||
variables:
|
||||
- name: checkoutPath
|
||||
value: ansible_collections/community/general
|
||||
- name: coverageBranches
|
||||
value: main
|
||||
- name: entryPoint
|
||||
value: tests/utils/shippable/shippable.sh
|
||||
- name: fetchDepth
|
||||
value: 0
|
||||
|
||||
resources:
|
||||
containers:
|
||||
- container: default
|
||||
image: quay.io/ansible/azure-pipelines-test-container:6.0.0
|
||||
|
||||
pool: Standard
|
||||
|
||||
stages:
|
||||
### Sanity
|
||||
- stage: Sanity_devel
|
||||
displayName: Sanity devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: devel/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_18
|
||||
displayName: Sanity 2.18
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.18/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_17
|
||||
displayName: Sanity 2.17
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.17/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_16
|
||||
displayName: Sanity 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.16/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
### Units
|
||||
- stage: Units_devel
|
||||
displayName: Units devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: devel/units/{0}/1
|
||||
targets:
|
||||
- test: 3.8
|
||||
- test: 3.9
|
||||
- test: '3.10'
|
||||
- test: '3.11'
|
||||
- test: '3.12'
|
||||
- test: '3.13'
|
||||
- stage: Units_2_18
|
||||
displayName: Units 2.18
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.18/units/{0}/1
|
||||
targets:
|
||||
- test: 3.8
|
||||
- test: "3.13"
|
||||
- stage: Units_2_17
|
||||
displayName: Units 2.17
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.17/units/{0}/1
|
||||
targets:
|
||||
- test: 3.7
|
||||
- test: "3.12"
|
||||
- stage: Units_2_16
|
||||
displayName: Units 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.16/units/{0}/1
|
||||
targets:
|
||||
- test: 2.7
|
||||
- test: 3.6
|
||||
- test: "3.11"
|
||||
|
||||
## Remote
|
||||
- stage: Remote_devel_extra_vms
|
||||
displayName: Remote devel extra VMs
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/{0}
|
||||
targets:
|
||||
- name: Alpine 3.21
|
||||
test: alpine/3.21
|
||||
# - name: Fedora 41
|
||||
# test: fedora/41
|
||||
- name: Ubuntu 22.04
|
||||
test: ubuntu/22.04
|
||||
- name: Ubuntu 24.04
|
||||
test: ubuntu/24.04
|
||||
groups:
|
||||
- vm
|
||||
- stage: Remote_devel
|
||||
displayName: Remote devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/{0}
|
||||
targets:
|
||||
- name: macOS 15.3
|
||||
test: macos/15.3
|
||||
- name: RHEL 9.5
|
||||
test: rhel/9.5
|
||||
- name: FreeBSD 14.2
|
||||
test: freebsd/14.2
|
||||
- name: FreeBSD 13.5
|
||||
test: freebsd/13.5
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Remote_2_18
|
||||
displayName: Remote 2.18
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.18/{0}
|
||||
targets:
|
||||
- name: macOS 14.3
|
||||
test: macos/14.3
|
||||
- name: RHEL 9.4
|
||||
test: rhel/9.4
|
||||
- name: FreeBSD 14.1
|
||||
test: freebsd/14.1
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Remote_2_17
|
||||
displayName: Remote 2.17
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.17/{0}
|
||||
targets:
|
||||
- name: FreeBSD 13.3
|
||||
test: freebsd/13.3
|
||||
- name: RHEL 9.3
|
||||
test: rhel/9.3
|
||||
- name: FreeBSD 14.0
|
||||
test: freebsd/14.0
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Remote_2_16
|
||||
displayName: Remote 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.16/{0}
|
||||
targets:
|
||||
- name: macOS 13.2
|
||||
test: macos/13.2
|
||||
- name: RHEL 9.2
|
||||
test: rhel/9.2
|
||||
- name: RHEL 8.8
|
||||
test: rhel/8.8
|
||||
- name: RHEL 7.9
|
||||
test: rhel/7.9
|
||||
# - name: FreeBSD 13.2
|
||||
# test: freebsd/13.2
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Docker
|
||||
- stage: Docker_devel
|
||||
displayName: Docker devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/linux/{0}
|
||||
targets:
|
||||
- name: Fedora 41
|
||||
test: fedora41
|
||||
- name: Alpine 3.21
|
||||
test: alpine321
|
||||
- name: Ubuntu 22.04
|
||||
test: ubuntu2204
|
||||
- name: Ubuntu 24.04
|
||||
test: ubuntu2404
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_18
|
||||
displayName: Docker 2.18
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.18/linux/{0}
|
||||
targets:
|
||||
- name: Fedora 40
|
||||
test: fedora40
|
||||
- name: Alpine 3.20
|
||||
test: alpine320
|
||||
- name: Ubuntu 24.04
|
||||
test: ubuntu2404
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_17
|
||||
displayName: Docker 2.17
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.17/linux/{0}
|
||||
targets:
|
||||
- name: Fedora 39
|
||||
test: fedora39
|
||||
- name: Alpine 3.19
|
||||
test: alpine319
|
||||
- name: Ubuntu 20.04
|
||||
test: ubuntu2004
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_16
|
||||
displayName: Docker 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.16/linux/{0}
|
||||
targets:
|
||||
- name: Fedora 38
|
||||
test: fedora38
|
||||
- name: openSUSE 15
|
||||
test: opensuse15
|
||||
- name: Alpine 3
|
||||
test: alpine3
|
||||
- name: CentOS 7
|
||||
test: centos7
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Community Docker
|
||||
- stage: Docker_community_devel
|
||||
displayName: Docker (community images) devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/linux-community/{0}
|
||||
targets:
|
||||
- name: Debian Bullseye
|
||||
test: debian-bullseye/3.9
|
||||
- name: Debian Bookworm
|
||||
test: debian-bookworm/3.11
|
||||
- name: ArchLinux
|
||||
test: archlinux/3.13
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Generic
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - stage: Generic_devel
|
||||
# displayName: Generic devel
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: templates/matrix.yml
|
||||
# parameters:
|
||||
# nameFormat: Python {0}
|
||||
# testFormat: devel/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '3.8'
|
||||
# - test: '3.11'
|
||||
# - test: '3.13'
|
||||
# - stage: Generic_2_18
|
||||
# displayName: Generic 2.18
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: templates/matrix.yml
|
||||
# parameters:
|
||||
# nameFormat: Python {0}
|
||||
# testFormat: 2.18/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '3.8'
|
||||
# - test: '3.13'
|
||||
# - stage: Generic_2_17
|
||||
# displayName: Generic 2.17
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: templates/matrix.yml
|
||||
# parameters:
|
||||
# nameFormat: Python {0}
|
||||
# testFormat: 2.17/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '3.7'
|
||||
# - test: '3.12'
|
||||
# - stage: Generic_2_16
|
||||
# displayName: Generic 2.16
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: templates/matrix.yml
|
||||
# parameters:
|
||||
# nameFormat: Python {0}
|
||||
# testFormat: 2.16/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '2.7'
|
||||
# - test: '3.6'
|
||||
# - test: '3.11'
|
||||
|
||||
- stage: Summary
|
||||
condition: succeededOrFailed()
|
||||
dependsOn:
|
||||
- Sanity_devel
|
||||
- Sanity_2_18
|
||||
- Sanity_2_17
|
||||
- Sanity_2_16
|
||||
- Units_devel
|
||||
- Units_2_18
|
||||
- Units_2_17
|
||||
- Units_2_16
|
||||
- Remote_devel_extra_vms
|
||||
- Remote_devel
|
||||
- Remote_2_18
|
||||
- Remote_2_17
|
||||
- Remote_2_16
|
||||
- Docker_devel
|
||||
- Docker_2_18
|
||||
- Docker_2_17
|
||||
- Docker_2_16
|
||||
- Docker_community_devel
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - Generic_devel
|
||||
# - Generic_2_18
|
||||
# - Generic_2_17
|
||||
# - Generic_2_16
|
||||
jobs:
|
||||
- template: templates/coverage.yml
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/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
|
||||
|
||||
# Aggregate code coverage results for later processing.
|
||||
|
||||
set -o pipefail -eu
|
||||
|
||||
agent_temp_directory="$1"
|
||||
|
||||
PATH="${PWD}/bin:${PATH}"
|
||||
|
||||
mkdir "${agent_temp_directory}/coverage/"
|
||||
|
||||
options=(--venv --venv-system-site-packages --color -v)
|
||||
|
||||
ansible-test coverage combine --group-by command --export "${agent_temp_directory}/coverage/" "${options[@]}"
|
||||
|
||||
if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then
|
||||
# Only analyze coverage if the installed version of ansible-test supports it.
|
||||
# Doing so allows this script to work unmodified for multiple Ansible versions.
|
||||
ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}"
|
||||
fi
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# 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
|
||||
|
||||
"""
|
||||
Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job.
|
||||
Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}"
|
||||
The recommended coverage artifact name format is: Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)
|
||||
Keep in mind that Azure Pipelines does not enforce unique job display names (only names).
|
||||
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
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
"""Main program entry point."""
|
||||
source_directory = sys.argv[1]
|
||||
|
||||
if '/ansible_collections/' in os.getcwd():
|
||||
output_path = "tests/output"
|
||||
else:
|
||||
output_path = "test/results"
|
||||
|
||||
destination_directory = os.path.join(output_path, 'coverage')
|
||||
|
||||
if not os.path.exists(destination_directory):
|
||||
os.makedirs(destination_directory)
|
||||
|
||||
jobs = {}
|
||||
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'))
|
||||
jobs[label] = max(attempt, jobs.get(label, 0))
|
||||
|
||||
for label, attempt in jobs.items():
|
||||
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)
|
||||
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)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/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
|
||||
|
||||
# Check the test results and set variables for use in later steps.
|
||||
|
||||
set -o pipefail -eu
|
||||
|
||||
if [[ "$PWD" =~ /ansible_collections/ ]]; then
|
||||
output_path="tests/output"
|
||||
else
|
||||
output_path="test/results"
|
||||
fi
|
||||
|
||||
echo "##vso[task.setVariable variable=outputPath]${output_path}"
|
||||
|
||||
if compgen -G "${output_path}"'/junit/*.xml' > /dev/null; then
|
||||
echo "##vso[task.setVariable variable=haveTestResults]true"
|
||||
fi
|
||||
|
||||
if compgen -G "${output_path}"'/bot/ansible-test-*' > /dev/null; then
|
||||
echo "##vso[task.setVariable variable=haveBotResults]true"
|
||||
fi
|
||||
|
||||
if compgen -G "${output_path}"'/coverage/*' > /dev/null; then
|
||||
echo "##vso[task.setVariable variable=haveCoverageData]true"
|
||||
fi
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# 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
|
||||
|
||||
"""
|
||||
Upload code coverage reports to codecov.io.
|
||||
Multiple coverage files from multiple languages are accepted and aggregated after upload.
|
||||
Python coverage, as well as PowerShell and Python stubs can all be uploaded.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import dataclasses
|
||||
import pathlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import typing as t
|
||||
import urllib.request
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class CoverageFile:
|
||||
name: str
|
||||
path: pathlib.Path
|
||||
flags: t.List[str]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Args:
|
||||
dry_run: bool
|
||||
path: pathlib.Path
|
||||
|
||||
|
||||
def parse_args() -> Args:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-n', '--dry-run', action='store_true')
|
||||
parser.add_argument('path', type=pathlib.Path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Store arguments in a typed dataclass
|
||||
fields = dataclasses.fields(Args)
|
||||
kwargs = {field.name: getattr(args, field.name) for field in fields}
|
||||
|
||||
return Args(**kwargs)
|
||||
|
||||
|
||||
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
|
||||
processed = []
|
||||
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
|
||||
|
||||
processed.append(CoverageFile(name, file, flags))
|
||||
|
||||
return tuple(processed)
|
||||
|
||||
|
||||
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
|
||||
for file in files:
|
||||
cmd = [
|
||||
str(codecov_bin),
|
||||
'--name', file.name,
|
||||
'--file', str(file.path),
|
||||
]
|
||||
for flag in file.flags:
|
||||
cmd.extend(['--flags', flag])
|
||||
|
||||
if dry_run:
|
||||
print(f'DRY-RUN: Would run command: {cmd}')
|
||||
continue
|
||||
|
||||
subprocess.run(cmd, check=True)
|
||||
|
||||
|
||||
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}')
|
||||
return
|
||||
|
||||
with urllib.request.urlopen(url) as resp:
|
||||
with dest.open('w+b') as f:
|
||||
# Read data in chunks rather than all at once
|
||||
shutil.copyfileobj(resp, f, 64 * 1024)
|
||||
|
||||
dest.chmod(flags)
|
||||
|
||||
|
||||
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'
|
||||
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__':
|
||||
main()
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/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
|
||||
|
||||
# Generate code coverage reports for uploading to Azure Pipelines and codecov.io.
|
||||
|
||||
set -o pipefail -eu
|
||||
|
||||
PATH="${PWD}/bin:${PATH}"
|
||||
|
||||
if ! ansible-test --help >/dev/null 2>&1; then
|
||||
# Install the devel version of ansible-test for generating code coverage reports.
|
||||
# This is only used by Ansible Collections, which are typically tested against multiple Ansible versions (in separate jobs).
|
||||
# Since a version of ansible-test is required that can work the output from multiple older releases, the devel version is used.
|
||||
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
|
||||
fi
|
||||
|
||||
ansible-test coverage xml --group-by command --stub --venv --venv-system-site-packages --color -v
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/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
|
||||
|
||||
# Configure the test environment and run the tests.
|
||||
|
||||
set -o pipefail -eu
|
||||
|
||||
entry_point="$1"
|
||||
test="$2"
|
||||
read -r -a coverage_branches <<< "$3" # space separated list of branches to run code coverage on for scheduled builds
|
||||
|
||||
export COMMIT_MESSAGE
|
||||
export COMPLETE
|
||||
export COVERAGE
|
||||
export IS_PULL_REQUEST
|
||||
|
||||
if [ "${SYSTEM_PULLREQUEST_TARGETBRANCH:-}" ]; then
|
||||
IS_PULL_REQUEST=true
|
||||
COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD^2)
|
||||
else
|
||||
IS_PULL_REQUEST=
|
||||
COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD)
|
||||
fi
|
||||
|
||||
COMPLETE=
|
||||
COVERAGE=
|
||||
|
||||
if [ "${BUILD_REASON}" = "Schedule" ]; then
|
||||
COMPLETE=yes
|
||||
|
||||
if printf '%s\n' "${coverage_branches[@]}" | grep -q "^${BUILD_SOURCEBRANCHNAME}$"; then
|
||||
COVERAGE=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
"${entry_point}" "${test}" 2>&1 | "$(dirname "$0")/time-command.py"
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# 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
|
||||
|
||||
"""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
|
||||
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
def main():
|
||||
"""Main program entry point."""
|
||||
start = time.time()
|
||||
|
||||
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.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
# This template adds a job for processing code coverage data.
|
||||
# It will upload results to Azure Pipelines and codecov.io.
|
||||
# Use it from a job stage that completes after all other jobs have completed.
|
||||
# This can be done by placing it in a separate summary stage that runs after the test stage(s) have completed.
|
||||
|
||||
jobs:
|
||||
- job: Coverage
|
||||
displayName: Code Coverage
|
||||
container: default
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: $(fetchDepth)
|
||||
path: $(checkoutPath)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Coverage Data
|
||||
inputs:
|
||||
path: coverage/
|
||||
patterns: "Coverage */*=coverage.combined"
|
||||
- bash: .azure-pipelines/scripts/combine-coverage.py coverage/
|
||||
displayName: Combine Coverage Data
|
||||
- bash: .azure-pipelines/scripts/report-coverage.sh
|
||||
displayName: Generate Coverage Report
|
||||
condition: gt(variables.coverageFileCount, 0)
|
||||
- bash: .azure-pipelines/scripts/publish-codecov.py "$(outputPath)"
|
||||
displayName: Publish to codecov.io
|
||||
condition: gt(variables.coverageFileCount, 0)
|
||||
continueOnError: true
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
# This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
|
||||
# If this matrix template does not provide the required functionality, consider using the test template directly instead.
|
||||
|
||||
parameters:
|
||||
# A required list of dictionaries, one per test target.
|
||||
# Each item in the list must contain a "test" or "name" key.
|
||||
# Both may be provided. If one is omitted, the other will be used.
|
||||
- name: targets
|
||||
type: object
|
||||
|
||||
# An optional list of values which will be used to multiply the targets list into a matrix.
|
||||
# Values can be strings or numbers.
|
||||
- name: groups
|
||||
type: object
|
||||
default: []
|
||||
|
||||
# An optional format string used to generate the job name.
|
||||
# - {0} is the name of an item in the targets list.
|
||||
- name: nameFormat
|
||||
type: string
|
||||
default: "{0}"
|
||||
|
||||
# An optional format string used to generate the test name.
|
||||
# - {0} is the name of an item in the targets list.
|
||||
- name: testFormat
|
||||
type: string
|
||||
default: "{0}"
|
||||
|
||||
# An optional format string used to add the group to the job name.
|
||||
# {0} is the formatted name of an item in the targets list.
|
||||
# {{1}} is the group -- be sure to include the double "{{" and "}}".
|
||||
- name: nameGroupFormat
|
||||
type: string
|
||||
default: "{0} - {{1}}"
|
||||
|
||||
# An optional format string used to add the group to the test name.
|
||||
# {0} is the formatted test of an item in the targets list.
|
||||
# {{1}} is the group -- be sure to include the double "{{" and "}}".
|
||||
- name: testGroupFormat
|
||||
type: string
|
||||
default: "{0}/{{1}}"
|
||||
|
||||
jobs:
|
||||
- template: test.yml
|
||||
parameters:
|
||||
jobs:
|
||||
- ${{ if eq(length(parameters.groups), 0) }}:
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- name: ${{ format(parameters.nameFormat, coalesce(target.name, target.test)) }}
|
||||
test: ${{ format(parameters.testFormat, coalesce(target.test, target.name)) }}
|
||||
- ${{ if not(eq(length(parameters.groups), 0)) }}:
|
||||
- ${{ each group in parameters.groups }}:
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- name: ${{ format(format(parameters.nameGroupFormat, parameters.nameFormat), coalesce(target.name, target.test), group) }}
|
||||
test: ${{ format(format(parameters.testGroupFormat, parameters.testFormat), coalesce(target.test, target.name), group) }}
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
# This template uses the provided list of jobs to create test one or more test jobs.
|
||||
# It can be used directly if needed, or through the matrix template.
|
||||
|
||||
parameters:
|
||||
# A required list of dictionaries, one per test job.
|
||||
# Each item in the list must contain a "job" and "name" key.
|
||||
- name: jobs
|
||||
type: object
|
||||
|
||||
jobs:
|
||||
- ${{ each job in parameters.jobs }}:
|
||||
- job: test_${{ replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_') }}
|
||||
displayName: ${{ job.name }}
|
||||
container: default
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: $(fetchDepth)
|
||||
path: $(checkoutPath)
|
||||
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
|
||||
displayName: Run Tests
|
||||
- bash: .azure-pipelines/scripts/process-results.sh
|
||||
condition: succeededOrFailed()
|
||||
displayName: Process Results
|
||||
- bash: .azure-pipelines/scripts/aggregate-coverage.sh "$(Agent.TempDirectory)"
|
||||
condition: eq(variables.haveCoverageData, 'true')
|
||||
displayName: Aggregate Coverage Data
|
||||
- task: PublishTestResults@2
|
||||
condition: eq(variables.haveTestResults, 'true')
|
||||
inputs:
|
||||
testResultsFiles: "$(outputPath)/junit/*.xml"
|
||||
displayName: Publish Test Results
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: eq(variables.haveBotResults, 'true')
|
||||
displayName: Publish Bot Results
|
||||
inputs:
|
||||
targetPath: "$(outputPath)/bot/"
|
||||
artifactName: "Bot $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: eq(variables.haveCoverageData, 'true')
|
||||
displayName: Publish Coverage Data
|
||||
inputs:
|
||||
targetPath: "$(Agent.TempDirectory)/coverage/"
|
||||
artifactName: "Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
|
||||
230
.github/workflows/ansible-test.yml
vendored
230
.github/workflows/ansible-test.yml
vendored
@@ -1,230 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
# For the comprehensive list of the inputs supported by the ansible-community/ansible-test-gh-action GitHub Action, see
|
||||
# https://github.com/marketplace/actions/ansible-test
|
||||
|
||||
name: EOL CI
|
||||
on:
|
||||
# Run EOL CI against all pushes (direct commits, also merged PRs), Pull Requests
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- stable-*
|
||||
pull_request:
|
||||
# Run EOL CI once per day (at 08:00 UTC)
|
||||
schedule:
|
||||
- cron: '0 8 * * *'
|
||||
|
||||
concurrency:
|
||||
# Make sure there is at most one active run per PR, but do not cancel any non-PR runs
|
||||
group: ${{ github.workflow }}-${{ (github.head_ref && github.event.number) || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
sanity:
|
||||
name: EOL Sanity (Ⓐ${{ matrix.ansible }})
|
||||
strategy:
|
||||
matrix:
|
||||
ansible:
|
||||
- '2.13'
|
||||
- '2.14'
|
||||
- '2.15'
|
||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
||||
# image for these stable branches. The list of branches where this is necessary will
|
||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
||||
# for the latest list.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Perform sanity testing
|
||||
uses: felixfontein/ansible-test-gh-action@main
|
||||
with:
|
||||
ansible-core-version: stable-${{ matrix.ansible }}
|
||||
codecov-token: ${{ secrets.CODECOV_TOKEN }}
|
||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
||||
pull-request-change-detection: 'true'
|
||||
testing-type: sanity
|
||||
pre-test-cmd: >-
|
||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
|
||||
|
||||
units:
|
||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
||||
# image for these stable branches. The list of branches where this is necessary will
|
||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
||||
# for the latest list.
|
||||
runs-on: ubuntu-latest
|
||||
name: EOL Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
|
||||
strategy:
|
||||
# As soon as the first unit test fails, cancel the others to free up the CI queue
|
||||
fail-fast: true
|
||||
matrix:
|
||||
ansible:
|
||||
- ''
|
||||
python:
|
||||
- ''
|
||||
exclude:
|
||||
- ansible: ''
|
||||
include:
|
||||
- ansible: '2.13'
|
||||
python: '2.7'
|
||||
- ansible: '2.13'
|
||||
python: '3.8'
|
||||
- ansible: '2.13'
|
||||
python: '2.7'
|
||||
- ansible: '2.13'
|
||||
python: '3.8'
|
||||
- ansible: '2.14'
|
||||
python: '3.9'
|
||||
- ansible: '2.15'
|
||||
python: '3.5'
|
||||
- ansible: '2.15'
|
||||
python: '3.10'
|
||||
|
||||
steps:
|
||||
- name: >-
|
||||
Perform unit testing against
|
||||
Ansible version ${{ matrix.ansible }}
|
||||
uses: felixfontein/ansible-test-gh-action@main
|
||||
with:
|
||||
ansible-core-version: stable-${{ matrix.ansible }}
|
||||
codecov-token: ${{ secrets.CODECOV_TOKEN }}
|
||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
||||
pre-test-cmd: >-
|
||||
mkdir -p ../../ansible
|
||||
;
|
||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
|
||||
pull-request-change-detection: 'true'
|
||||
target-python-version: ${{ matrix.python }}
|
||||
testing-type: units
|
||||
|
||||
integration:
|
||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
||||
# image for these stable branches. The list of branches where this is necessary will
|
||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
||||
# for the latest list.
|
||||
runs-on: ubuntu-latest
|
||||
name: EOL I (Ⓐ${{ matrix.ansible }}+${{ matrix.docker }}+py${{ matrix.python }}:${{ matrix.target }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ansible:
|
||||
- ''
|
||||
docker:
|
||||
- ''
|
||||
python:
|
||||
- ''
|
||||
target:
|
||||
- ''
|
||||
exclude:
|
||||
- ansible: ''
|
||||
include:
|
||||
# 2.13
|
||||
- ansible: '2.13'
|
||||
docker: fedora35
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.13'
|
||||
docker: fedora35
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.13'
|
||||
docker: fedora35
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
- ansible: '2.13'
|
||||
docker: opensuse15py2
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.13'
|
||||
docker: opensuse15py2
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.13'
|
||||
docker: opensuse15py2
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
- ansible: '2.13'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.13'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.13'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# 2.14
|
||||
- ansible: '2.14'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.14'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.14'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# 2.15
|
||||
- ansible: '2.15'
|
||||
docker: fedora37
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.15'
|
||||
docker: fedora37
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.15'
|
||||
docker: fedora37
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - ansible: '2.13'
|
||||
# docker: default
|
||||
# python: '3.9'
|
||||
# target: azp/generic/1/
|
||||
# - ansible: '2.14'
|
||||
# docker: default
|
||||
# python: '3.10'
|
||||
# target: azp/generic/1/
|
||||
# - ansible: '2.15'
|
||||
# docker: default
|
||||
# python: '3.9'
|
||||
# target: azp/generic/1/
|
||||
|
||||
steps:
|
||||
- name: >-
|
||||
Perform integration testing against
|
||||
Ansible version ${{ matrix.ansible }}
|
||||
under Python ${{ matrix.python }}
|
||||
uses: felixfontein/ansible-test-gh-action@main
|
||||
with:
|
||||
ansible-core-version: stable-${{ matrix.ansible }}
|
||||
codecov-token: ${{ secrets.CODECOV_TOKEN }}
|
||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
||||
docker-image: ${{ matrix.docker }}
|
||||
integration-continue-on-error: 'false'
|
||||
integration-diff: 'false'
|
||||
integration-retry-on-error: 'true'
|
||||
pre-test-cmd: >-
|
||||
mkdir -p ../../ansible
|
||||
;
|
||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.posix.git ../../ansible/posix
|
||||
;
|
||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.crypto.git ../../community/crypto
|
||||
;
|
||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.docker.git ../../community/docker
|
||||
;
|
||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
|
||||
pull-request-change-detection: 'true'
|
||||
target: ${{ matrix.target }}
|
||||
target-python-version: ${{ matrix.python }}
|
||||
testing-type: integration
|
||||
38
.github/workflows/codeql-analysis.yml
vendored
38
.github/workflows/codeql-analysis.yml
vendored
@@ -1,38 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '26 19 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: python
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
28
.github/workflows/nox.yml
vendored
28
.github/workflows/nox.yml
vendored
@@ -1,28 +0,0 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
name: nox
|
||||
'on':
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- stable-*
|
||||
pull_request:
|
||||
# Run CI once per day (at 08:00 UTC)
|
||||
schedule:
|
||||
- cron: '0 8 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
nox:
|
||||
runs-on: ubuntu-latest
|
||||
name: "Run extra sanity tests"
|
||||
steps:
|
||||
- name: Check out collection
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run nox
|
||||
uses: ansible-community/antsibull-nox@main
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -383,6 +383,16 @@ cython_debug/
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
### Python Patch ###
|
||||
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
||||
poetry.toml
|
||||
|
||||
# ruff
|
||||
.ruff_cache/
|
||||
|
||||
# LSP config files
|
||||
pyrightconfig.json
|
||||
|
||||
### Vim ###
|
||||
# Swap
|
||||
[._]*.s[a-v][a-z]
|
||||
@@ -482,6 +492,10 @@ tags
|
||||
# https://plugins.jetbrains.com/plugin/12206-codestream
|
||||
.idea/codestream.xml
|
||||
|
||||
# Azure Toolkit for IntelliJ plugin
|
||||
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
|
||||
.idea/**/azureSettings.xml
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
|
||||
254
CHANGELOG.md
254
CHANGELOG.md
@@ -2,79 +2,97 @@
|
||||
|
||||
**Topics**
|
||||
|
||||
- <a href="#v9-5-7">v9\.5\.7</a>
|
||||
- <a href="#v9-5-13">v9\.5\.13</a>
|
||||
- <a href="#release-summary">Release Summary</a>
|
||||
- <a href="#minor-changes">Minor Changes</a>
|
||||
- <a href="#security-fixes">Security Fixes</a>
|
||||
- <a href="#v9-5-12">v9\.5\.12</a>
|
||||
- <a href="#release-summary-1">Release Summary</a>
|
||||
- <a href="#bugfixes">Bugfixes</a>
|
||||
- <a href="#v9-5-11">v9\.5\.11</a>
|
||||
- <a href="#release-summary-2">Release Summary</a>
|
||||
- <a href="#bugfixes-1">Bugfixes</a>
|
||||
- <a href="#v9-5-10">v9\.5\.10</a>
|
||||
- <a href="#release-summary-3">Release Summary</a>
|
||||
- <a href="#bugfixes-2">Bugfixes</a>
|
||||
- <a href="#v9-5-9">v9\.5\.9</a>
|
||||
- <a href="#release-summary-4">Release Summary</a>
|
||||
- <a href="#bugfixes-3">Bugfixes</a>
|
||||
- <a href="#v9-5-8">v9\.5\.8</a>
|
||||
- <a href="#release-summary-5">Release Summary</a>
|
||||
- <a href="#bugfixes-4">Bugfixes</a>
|
||||
- <a href="#v9-5-7">v9\.5\.7</a>
|
||||
- <a href="#release-summary-6">Release Summary</a>
|
||||
- <a href="#minor-changes">Minor Changes</a>
|
||||
- <a href="#bugfixes-5">Bugfixes</a>
|
||||
- <a href="#known-issues">Known Issues</a>
|
||||
- <a href="#v9-5-6">v9\.5\.6</a>
|
||||
- <a href="#release-summary-1">Release Summary</a>
|
||||
- <a href="#release-summary-7">Release Summary</a>
|
||||
- <a href="#minor-changes-1">Minor Changes</a>
|
||||
- <a href="#bugfixes-1">Bugfixes</a>
|
||||
- <a href="#v9-5-5">v9\.5\.5</a>
|
||||
- <a href="#release-summary-2">Release Summary</a>
|
||||
- <a href="#bugfixes-2">Bugfixes</a>
|
||||
- <a href="#v9-5-4">v9\.5\.4</a>
|
||||
- <a href="#security-fixes">Security Fixes</a>
|
||||
- <a href="#bugfixes-3">Bugfixes</a>
|
||||
- <a href="#v9-5-3">v9\.5\.3</a>
|
||||
- <a href="#release-summary-3">Release Summary</a>
|
||||
- <a href="#minor-changes-2">Minor Changes</a>
|
||||
- <a href="#security-fixes-1">Security Fixes</a>
|
||||
- <a href="#bugfixes-4">Bugfixes</a>
|
||||
- <a href="#v9-5-2">v9\.5\.2</a>
|
||||
- <a href="#release-summary-4">Release Summary</a>
|
||||
- <a href="#minor-changes-3">Minor Changes</a>
|
||||
- <a href="#bugfixes-5">Bugfixes</a>
|
||||
- <a href="#v9-5-1">v9\.5\.1</a>
|
||||
- <a href="#release-summary-5">Release Summary</a>
|
||||
- <a href="#minor-changes-4">Minor Changes</a>
|
||||
- <a href="#bugfixes-6">Bugfixes</a>
|
||||
- <a href="#v9-5-5">v9\.5\.5</a>
|
||||
- <a href="#release-summary-8">Release Summary</a>
|
||||
- <a href="#bugfixes-7">Bugfixes</a>
|
||||
- <a href="#v9-5-4">v9\.5\.4</a>
|
||||
- <a href="#security-fixes-1">Security Fixes</a>
|
||||
- <a href="#bugfixes-8">Bugfixes</a>
|
||||
- <a href="#v9-5-3">v9\.5\.3</a>
|
||||
- <a href="#release-summary-9">Release Summary</a>
|
||||
- <a href="#minor-changes-2">Minor Changes</a>
|
||||
- <a href="#security-fixes-2">Security Fixes</a>
|
||||
- <a href="#bugfixes-9">Bugfixes</a>
|
||||
- <a href="#v9-5-2">v9\.5\.2</a>
|
||||
- <a href="#release-summary-10">Release Summary</a>
|
||||
- <a href="#minor-changes-3">Minor Changes</a>
|
||||
- <a href="#bugfixes-10">Bugfixes</a>
|
||||
- <a href="#v9-5-1">v9\.5\.1</a>
|
||||
- <a href="#release-summary-11">Release Summary</a>
|
||||
- <a href="#minor-changes-4">Minor Changes</a>
|
||||
- <a href="#bugfixes-11">Bugfixes</a>
|
||||
- <a href="#v9-5-0">v9\.5\.0</a>
|
||||
- <a href="#release-summary-6">Release Summary</a>
|
||||
- <a href="#release-summary-12">Release Summary</a>
|
||||
- <a href="#minor-changes-5">Minor Changes</a>
|
||||
- <a href="#deprecated-features">Deprecated Features</a>
|
||||
- <a href="#bugfixes-7">Bugfixes</a>
|
||||
- <a href="#bugfixes-12">Bugfixes</a>
|
||||
- <a href="#new-modules">New Modules</a>
|
||||
- <a href="#v9-4-0">v9\.4\.0</a>
|
||||
- <a href="#release-summary-7">Release Summary</a>
|
||||
- <a href="#release-summary-13">Release Summary</a>
|
||||
- <a href="#minor-changes-6">Minor Changes</a>
|
||||
- <a href="#deprecated-features-1">Deprecated Features</a>
|
||||
- <a href="#bugfixes-8">Bugfixes</a>
|
||||
- <a href="#bugfixes-13">Bugfixes</a>
|
||||
- <a href="#new-modules-1">New Modules</a>
|
||||
- <a href="#v9-3-0">v9\.3\.0</a>
|
||||
- <a href="#release-summary-8">Release Summary</a>
|
||||
- <a href="#release-summary-14">Release Summary</a>
|
||||
- <a href="#minor-changes-7">Minor Changes</a>
|
||||
- <a href="#bugfixes-9">Bugfixes</a>
|
||||
- <a href="#bugfixes-14">Bugfixes</a>
|
||||
- <a href="#new-modules-2">New Modules</a>
|
||||
- <a href="#v9-2-0">v9\.2\.0</a>
|
||||
- <a href="#release-summary-9">Release Summary</a>
|
||||
- <a href="#release-summary-15">Release Summary</a>
|
||||
- <a href="#minor-changes-8">Minor Changes</a>
|
||||
- <a href="#bugfixes-10">Bugfixes</a>
|
||||
- <a href="#bugfixes-15">Bugfixes</a>
|
||||
- <a href="#new-plugins">New Plugins</a>
|
||||
- <a href="#filter">Filter</a>
|
||||
- <a href="#test">Test</a>
|
||||
- <a href="#v9-1-0">v9\.1\.0</a>
|
||||
- <a href="#release-summary-10">Release Summary</a>
|
||||
- <a href="#release-summary-16">Release Summary</a>
|
||||
- <a href="#minor-changes-9">Minor Changes</a>
|
||||
- <a href="#deprecated-features-2">Deprecated Features</a>
|
||||
- <a href="#bugfixes-11">Bugfixes</a>
|
||||
- <a href="#bugfixes-16">Bugfixes</a>
|
||||
- <a href="#known-issues-1">Known Issues</a>
|
||||
- <a href="#new-plugins-1">New Plugins</a>
|
||||
- <a href="#filter-1">Filter</a>
|
||||
- <a href="#new-modules-3">New Modules</a>
|
||||
- <a href="#v9-0-1">v9\.0\.1</a>
|
||||
- <a href="#release-summary-11">Release Summary</a>
|
||||
- <a href="#release-summary-17">Release Summary</a>
|
||||
- <a href="#minor-changes-10">Minor Changes</a>
|
||||
- <a href="#bugfixes-12">Bugfixes</a>
|
||||
- <a href="#bugfixes-17">Bugfixes</a>
|
||||
- <a href="#v9-0-0">v9\.0\.0</a>
|
||||
- <a href="#release-summary-12">Release Summary</a>
|
||||
- <a href="#release-summary-18">Release Summary</a>
|
||||
- <a href="#minor-changes-11">Minor Changes</a>
|
||||
- <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
|
||||
- <a href="#deprecated-features-3">Deprecated Features</a>
|
||||
- <a href="#removed-features-previously-deprecated">Removed Features \(previously deprecated\)</a>
|
||||
- <a href="#security-fixes-2">Security Fixes</a>
|
||||
- <a href="#bugfixes-13">Bugfixes</a>
|
||||
- <a href="#security-fixes-3">Security Fixes</a>
|
||||
- <a href="#bugfixes-18">Bugfixes</a>
|
||||
- <a href="#new-plugins-2">New Plugins</a>
|
||||
- <a href="#become">Become</a>
|
||||
- <a href="#callback">Callback</a>
|
||||
@@ -85,10 +103,112 @@
|
||||
- <a href="#new-modules-4">New Modules</a>
|
||||
This changelog describes changes after version 8\.0\.0\.
|
||||
|
||||
<a id="v9-5-13"></a>
|
||||
## v9\.5\.13
|
||||
|
||||
<a id="release-summary"></a>
|
||||
### Release Summary
|
||||
|
||||
Final maintenance release\.
|
||||
|
||||
This is the last community\.general 9\.x\.y release\.
|
||||
Please upgrade to community\.general 10\.x\.y\, 11\.x\.y\, or 12\.x\.y\.
|
||||
Thanks a lot to everyone who contributed to a 9\.x\.y release\!
|
||||
|
||||
<a id="security-fixes"></a>
|
||||
### Security Fixes
|
||||
|
||||
* keycloak\_user \- the parameter <code>credentials\[\]\.value</code> is now marked as <code>no\_log\=true</code>\. Before it was logged by Ansible\, unless the task was marked as <code>no\_log\: true</code>\. Since this parameter can be used for passwords\, this resulted in credential leaking \([https\://github\.com/ansible\-collections/community\.general/issues/11000](https\://github\.com/ansible\-collections/community\.general/issues/11000)\, [https\://github\.com/ansible\-collections/community\.general/pull/11005](https\://github\.com/ansible\-collections/community\.general/pull/11005)\)\.
|
||||
|
||||
<a id="v9-5-12"></a>
|
||||
## v9\.5\.12
|
||||
|
||||
<a id="release-summary-1"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release\.
|
||||
|
||||
<a id="bugfixes"></a>
|
||||
### Bugfixes
|
||||
|
||||
* github\_deploy\_key \- fix bug during error handling if no body was present in the result \([https\://github\.com/ansible\-collections/community\.general/issues/10853](https\://github\.com/ansible\-collections/community\.general/issues/10853)\, [https\://github\.com/ansible\-collections/community\.general/pull/10857](https\://github\.com/ansible\-collections/community\.general/pull/10857)\)\.
|
||||
* yaml cache plugin \- make compatible with ansible\-core 2\.19 \([https\://github\.com/ansible\-collections/community\.general/issues/10849](https\://github\.com/ansible\-collections/community\.general/issues/10849)\, [https\://github\.com/ansible\-collections/community\.general/issues/10852](https\://github\.com/ansible\-collections/community\.general/issues/10852)\)\.
|
||||
|
||||
<a id="v9-5-11"></a>
|
||||
## v9\.5\.11
|
||||
|
||||
<a id="release-summary-2"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release\.
|
||||
|
||||
<a id="bugfixes-1"></a>
|
||||
### Bugfixes
|
||||
|
||||
* apache2\_module \- avoid ansible\-core 2\.19 deprecation \([https\://github\.com/ansible\-collections/community\.general/pull/10459](https\://github\.com/ansible\-collections/community\.general/pull/10459)\)\.
|
||||
* doas become plugin \- disable pipelining on ansible\-core 2\.19\+\. The plugin does not work with pipelining\, and since ansible\-core 2\.19 become plugins can indicate that they do not work with pipelining \([https\://github\.com/ansible\-collections/community\.general/issues/9977](https\://github\.com/ansible\-collections/community\.general/issues/9977)\, [https\://github\.com/ansible\-collections/community\.general/pull/10537](https\://github\.com/ansible\-collections/community\.general/pull/10537)\)\.
|
||||
* htpasswd \- avoid ansible\-core 2\.19 deprecation \([https\://github\.com/ansible\-collections/community\.general/pull/10459](https\://github\.com/ansible\-collections/community\.general/pull/10459)\)\.
|
||||
* irc \- pass hostname to <code>wrap\_socket\(\)</code> if <code>use\_tls\=true</code> and <code>validate\_certs\=true</code> \([https\://github\.com/ansible\-collections/community\.general/issues/10472](https\://github\.com/ansible\-collections/community\.general/issues/10472)\, [https\://github\.com/ansible\-collections/community\.general/pull/10491](https\://github\.com/ansible\-collections/community\.general/pull/10491)\)\.
|
||||
* json\_query filter plugin \- make compatible with lazy evaluation list and dictionary types of ansible\-core 2\.19 \([https\://github\.com/ansible\-collections/community\.general/pull/10539](https\://github\.com/ansible\-collections/community\.general/pull/10539)\)\.
|
||||
* machinectl become plugin \- disable pipelining on ansible\-core 2\.19\+\. The plugin does not work with pipelining\, and since ansible\-core 2\.19 become plugins can indicate that they do not work with pipelining \([https\://github\.com/ansible\-collections/community\.general/pull/10537](https\://github\.com/ansible\-collections/community\.general/pull/10537)\)\.
|
||||
* merge\_variables lookup plugin \- avoid deprecated functionality from ansible\-core 2\.19 \([https\://github\.com/ansible\-collections/community\.general/pull/10566](https\://github\.com/ansible\-collections/community\.general/pull/10566)\)\.
|
||||
* proxmox inventory plugin \- avoid using deprecated option when templating options \([https\://github\.com/ansible\-collections/community\.proxmox/pull/108](https\://github\.com/ansible\-collections/community\.proxmox/pull/108)\, [https\://github\.com/ansible\-collections/community\.general/pull/10553](https\://github\.com/ansible\-collections/community\.general/pull/10553)\)\.
|
||||
* syspatch \- avoid ansible\-core 2\.19 deprecation \([https\://github\.com/ansible\-collections/community\.general/pull/10459](https\://github\.com/ansible\-collections/community\.general/pull/10459)\)\.
|
||||
* sysupgrade \- avoid ansible\-core 2\.19 deprecation \([https\://github\.com/ansible\-collections/community\.general/pull/10459](https\://github\.com/ansible\-collections/community\.general/pull/10459)\)\.
|
||||
* zypper\_repository \- avoid ansible\-core 2\.19 deprecation \([https\://github\.com/ansible\-collections/community\.general/pull/10459](https\://github\.com/ansible\-collections/community\.general/pull/10459)\)\.
|
||||
|
||||
<a id="v9-5-10"></a>
|
||||
## v9\.5\.10
|
||||
|
||||
<a id="release-summary-3"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release with improved ansible\-core 2\.19 compatibility\.
|
||||
|
||||
<a id="bugfixes-2"></a>
|
||||
### Bugfixes
|
||||
|
||||
* dependent lookup plugin \- avoid deprecated ansible\-core 2\.19 functionality \([https\://github\.com/ansible\-collections/community\.general/pull/10359](https\://github\.com/ansible\-collections/community\.general/pull/10359)\)\.
|
||||
* icinga2 inventory plugin \- avoid using deprecated option when templating options \([https\://github\.com/ansible\-collections/community\.general/pull/10271](https\://github\.com/ansible\-collections/community\.general/pull/10271)\)\.
|
||||
* keycloak module\_utils \- fix call of method which does not exist in stable\-9\, which was introduced by backporting 8b1a193a \([https\://github\.com/ansible\-collections/community\.general/pull/10298](https\://github\.com/ansible\-collections/community\.general/pull/10298)\)\.
|
||||
* linode inventory plugin \- avoid using deprecated option when templating options \([https\://github\.com/ansible\-collections/community\.general/pull/10271](https\://github\.com/ansible\-collections/community\.general/pull/10271)\)\.
|
||||
|
||||
<a id="v9-5-9"></a>
|
||||
## v9\.5\.9
|
||||
|
||||
<a id="release-summary-4"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release\.
|
||||
|
||||
<a id="bugfixes-3"></a>
|
||||
### Bugfixes
|
||||
|
||||
* yaml callback plugin \- adjust to latest changes in ansible\-core devel \([https\://github\.com/ansible\-collections/community\.general/pull/10212](https\://github\.com/ansible\-collections/community\.general/pull/10212)\)\.
|
||||
* yaml callback plugin \- when using ansible\-core 2\.19\.0b2 or newer\, uses a new utility provided by ansible\-core\. This allows us to remove all hacks and vendored code that was part of the plugin for ansible\-core versions with Data Tagging so far \([https\://github\.com/ansible\-collections/community\.general/pull/10242](https\://github\.com/ansible\-collections/community\.general/pull/10242)\)\.
|
||||
|
||||
<a id="v9-5-8"></a>
|
||||
## v9\.5\.8
|
||||
|
||||
<a id="release-summary-5"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
|
||||
<a id="bugfixes-4"></a>
|
||||
### Bugfixes
|
||||
|
||||
* cobbler\_system \- fix bug with Cobbler \>\= 3\.4\.0 caused by giving more than 2 positional arguments to <code>CobblerXMLRPCInterface\.get\_system\_handle\(\)</code> \([https\://github\.com/ansible\-collections/community\.general/issues/8506](https\://github\.com/ansible\-collections/community\.general/issues/8506)\, [https\://github\.com/ansible\-collections/community\.general/pull/10145](https\://github\.com/ansible\-collections/community\.general/pull/10145)\)\.
|
||||
* kdeconfig \- allow option values beginning with a dash \([https\://github\.com/ansible\-collections/community\.general/issues/10127](https\://github\.com/ansible\-collections/community\.general/issues/10127)\, [https\://github\.com/ansible\-collections/community\.general/pull/10128](https\://github\.com/ansible\-collections/community\.general/pull/10128)\)\.
|
||||
* keycloak\_user\_rolemapping \- fix <code>\-\-diff</code> mode \([https\://github\.com/ansible\-collections/community\.general/issues/10067](https\://github\.com/ansible\-collections/community\.general/issues/10067)\, [https\://github\.com/ansible\-collections/community\.general/pull/10075](https\://github\.com/ansible\-collections/community\.general/pull/10075)\)\.
|
||||
* pickle cache plugin \- avoid extra JSON serialization with ansible\-core \>\= 2\.19 \([https\://github\.com/ansible\-collections/community\.general/pull/10136](https\://github\.com/ansible\-collections/community\.general/pull/10136)\)\.
|
||||
* rundeck\_acl\_policy \- ensure that project ACLs are sent to the correct endpoint \([https\://github\.com/ansible\-collections/community\.general/pull/10097](https\://github\.com/ansible\-collections/community\.general/pull/10097)\)\.
|
||||
* sysrc \- split the output of <code>sysrc \-e \-a</code> on the first <code>\=</code> only \([https\://github\.com/ansible\-collections/community\.general/issues/10120](https\://github\.com/ansible\-collections/community\.general/issues/10120)\, [https\://github\.com/ansible\-collections/community\.general/pull/10121](https\://github\.com/ansible\-collections/community\.general/pull/10121)\)\.
|
||||
|
||||
<a id="v9-5-7"></a>
|
||||
## v9\.5\.7
|
||||
|
||||
<a id="release-summary"></a>
|
||||
<a id="release-summary-6"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
@@ -98,7 +218,7 @@ Regular bugfix release\.
|
||||
|
||||
* apache2\_module \- added workaround for new PHP module name\, from <code>php7\_module</code> to <code>php\_module</code> \([https\://github\.com/ansible\-collections/community\.general/pull/9951](https\://github\.com/ansible\-collections/community\.general/pull/9951)\)\.
|
||||
|
||||
<a id="bugfixes"></a>
|
||||
<a id="bugfixes-5"></a>
|
||||
### Bugfixes
|
||||
|
||||
* dependent look plugin \- make compatible with ansible\-core\'s Data Tagging feature \([https\://github\.com/ansible\-collections/community\.general/pull/9833](https\://github\.com/ansible\-collections/community\.general/pull/9833)\)\.
|
||||
@@ -121,7 +241,7 @@ Regular bugfix release\.
|
||||
<a id="v9-5-6"></a>
|
||||
## v9\.5\.6
|
||||
|
||||
<a id="release-summary-1"></a>
|
||||
<a id="release-summary-7"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
@@ -131,7 +251,7 @@ Regular bugfix release\.
|
||||
|
||||
* consul\_token \- fix idempotency when <code>policies</code> or <code>roles</code> are supplied by name \([https\://github\.com/ansible\-collections/community\.general/issues/9841](https\://github\.com/ansible\-collections/community\.general/issues/9841)\, [https\://github\.com/ansible\-collections/community\.general/pull/9845](https\://github\.com/ansible\-collections/community\.general/pull/9845)\)\.
|
||||
|
||||
<a id="bugfixes-1"></a>
|
||||
<a id="bugfixes-6"></a>
|
||||
### Bugfixes
|
||||
|
||||
* cloudlare\_dns \- handle exhausted response stream in case of HTTP errors to show nice error message to the user \([https\://github\.com/ansible\-collections/community\.general/issues/9782](https\://github\.com/ansible\-collections/community\.general/issues/9782)\, [https\://github\.com/ansible\-collections/community\.general/pull/9818](https\://github\.com/ansible\-collections/community\.general/pull/9818)\)\.
|
||||
@@ -145,12 +265,12 @@ Regular bugfix release\.
|
||||
<a id="v9-5-5"></a>
|
||||
## v9\.5\.5
|
||||
|
||||
<a id="release-summary-2"></a>
|
||||
<a id="release-summary-8"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
|
||||
<a id="bugfixes-2"></a>
|
||||
<a id="bugfixes-7"></a>
|
||||
### Bugfixes
|
||||
|
||||
* apache2\_mod\_proxy \- make compatible with Python 3 \([https\://github\.com/ansible\-collections/community\.general/pull/9762](https\://github\.com/ansible\-collections/community\.general/pull/9762)\)\.
|
||||
@@ -171,12 +291,12 @@ Regular bugfix release\.
|
||||
<a id="v9-5-4"></a>
|
||||
## v9\.5\.4
|
||||
|
||||
<a id="security-fixes"></a>
|
||||
<a id="security-fixes-1"></a>
|
||||
### Security Fixes
|
||||
|
||||
* keycloak\_client \- Sanitize <code>saml\.encryption\.private\.key</code> so it does not show in the logs \([https\://github\.com/ansible\-collections/community\.general/pull/9621](https\://github\.com/ansible\-collections/community\.general/pull/9621)\)\.
|
||||
|
||||
<a id="bugfixes-3"></a>
|
||||
<a id="bugfixes-8"></a>
|
||||
### Bugfixes
|
||||
|
||||
* redhat\_subscription \- do not try to unsubscribe \(i\.e\. remove subscriptions\)
|
||||
@@ -188,7 +308,7 @@ Regular bugfix release\.
|
||||
<a id="v9-5-3"></a>
|
||||
## v9\.5\.3
|
||||
|
||||
<a id="release-summary-3"></a>
|
||||
<a id="release-summary-9"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
@@ -198,12 +318,12 @@ Regular bugfix release\.
|
||||
|
||||
* proxmox module utils \- add method <code>api\_task\_complete</code> that can wait for task completion and return error message \([https\://github\.com/ansible\-collections/community\.general/pull/9256](https\://github\.com/ansible\-collections/community\.general/pull/9256)\)\.
|
||||
|
||||
<a id="security-fixes-1"></a>
|
||||
<a id="security-fixes-2"></a>
|
||||
### Security Fixes
|
||||
|
||||
* keycloak\_authentication \- API calls did not properly set the <code>priority</code> during update resulting in incorrectly sorted authentication flows\. This apparently only affects Keycloak 25 or newer \([https\://github\.com/ansible\-collections/community\.general/pull/9263](https\://github\.com/ansible\-collections/community\.general/pull/9263)\)\.
|
||||
|
||||
<a id="bugfixes-4"></a>
|
||||
<a id="bugfixes-9"></a>
|
||||
### Bugfixes
|
||||
|
||||
* dig lookup plugin \- correctly handle <code>NoNameserver</code> exception \([https\://github\.com/ansible\-collections/community\.general/pull/9363](https\://github\.com/ansible\-collections/community\.general/pull/9363)\, [https\://github\.com/ansible\-collections/community\.general/issues/9362](https\://github\.com/ansible\-collections/community\.general/issues/9362)\)\.
|
||||
@@ -216,7 +336,7 @@ Regular bugfix release\.
|
||||
<a id="v9-5-2"></a>
|
||||
## v9\.5\.2
|
||||
|
||||
<a id="release-summary-4"></a>
|
||||
<a id="release-summary-10"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
@@ -226,7 +346,7 @@ Regular bugfix release\.
|
||||
|
||||
* proxmox inventory plugin \- fix urllib3 <code>InsecureRequestWarnings</code> not being suppressed when a token is used \([https\://github\.com/ansible\-collections/community\.general/pull/9099](https\://github\.com/ansible\-collections/community\.general/pull/9099)\)\.
|
||||
|
||||
<a id="bugfixes-5"></a>
|
||||
<a id="bugfixes-10"></a>
|
||||
### Bugfixes
|
||||
|
||||
* dnf\_config\_manager \- fix hanging when prompting to import GPG keys \([https\://github\.com/ansible\-collections/community\.general/pull/9124](https\://github\.com/ansible\-collections/community\.general/pull/9124)\, [https\://github\.com/ansible\-collections/community\.general/issues/8830](https\://github\.com/ansible\-collections/community\.general/issues/8830)\)\.
|
||||
@@ -243,7 +363,7 @@ Regular bugfix release\.
|
||||
<a id="v9-5-1"></a>
|
||||
## v9\.5\.1
|
||||
|
||||
<a id="release-summary-5"></a>
|
||||
<a id="release-summary-11"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix release\.
|
||||
@@ -253,7 +373,7 @@ Regular bugfix release\.
|
||||
|
||||
* redfish\_utils module utils \- schedule a BIOS configuration job at next reboot when the BIOS config is changed \([https\://github\.com/ansible\-collections/community\.general/pull/9012](https\://github\.com/ansible\-collections/community\.general/pull/9012)\)\.
|
||||
|
||||
<a id="bugfixes-6"></a>
|
||||
<a id="bugfixes-11"></a>
|
||||
### Bugfixes
|
||||
|
||||
* bitwarden lookup plugin \- support BWS v0\.3\.0 syntax breaking change \([https\://github\.com/ansible\-collections/community\.general/pull/9028](https\://github\.com/ansible\-collections/community\.general/pull/9028)\)\.
|
||||
@@ -271,7 +391,7 @@ Regular bugfix release\.
|
||||
<a id="v9-5-0"></a>
|
||||
## v9\.5\.0
|
||||
|
||||
<a id="release-summary-6"></a>
|
||||
<a id="release-summary-12"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix and feature release\.
|
||||
@@ -336,7 +456,7 @@ From now on\, new features will only go into community\.general 10\.x\.y\.
|
||||
|
||||
* hipchat \- the hipchat service has been discontinued and the self\-hosted variant has been End of Life since 2020\. The module is therefore deprecated and will be removed from community\.general 11\.0\.0 if nobody provides compelling reasons to still keep it \([https\://github\.com/ansible\-collections/community\.general/pull/8919](https\://github\.com/ansible\-collections/community\.general/pull/8919)\)\.
|
||||
|
||||
<a id="bugfixes-7"></a>
|
||||
<a id="bugfixes-12"></a>
|
||||
### Bugfixes
|
||||
|
||||
* cloudflare\_dns \- fix changing Cloudflare SRV records \([https\://github\.com/ansible\-collections/community\.general/issues/8679](https\://github\.com/ansible\-collections/community\.general/issues/8679)\, [https\://github\.com/ansible\-collections/community\.general/pull/8948](https\://github\.com/ansible\-collections/community\.general/pull/8948)\)\.
|
||||
@@ -370,7 +490,7 @@ From now on\, new features will only go into community\.general 10\.x\.y\.
|
||||
<a id="v9-4-0"></a>
|
||||
## v9\.4\.0
|
||||
|
||||
<a id="release-summary-7"></a>
|
||||
<a id="release-summary-13"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix and feature release\.
|
||||
@@ -462,7 +582,7 @@ Bugfix and feature release\.
|
||||
* pipx \- support for versions of the command line tool <code>pipx</code> older than <code>1\.7\.0</code> is deprecated and will be removed in community\.general 11\.0\.0 \([https\://github\.com/ansible\-collections/community\.general/pull/8793](https\://github\.com/ansible\-collections/community\.general/pull/8793)\)\.
|
||||
* pipx\_info \- support for versions of the command line tool <code>pipx</code> older than <code>1\.7\.0</code> is deprecated and will be removed in community\.general 11\.0\.0 \([https\://github\.com/ansible\-collections/community\.general/pull/8793](https\://github\.com/ansible\-collections/community\.general/pull/8793)\)\.
|
||||
|
||||
<a id="bugfixes-8"></a>
|
||||
<a id="bugfixes-13"></a>
|
||||
### Bugfixes
|
||||
|
||||
* gitlab\_group\_access\_token \- fix crash in check mode caused by attempted access to a newly created access token \([https\://github\.com/ansible\-collections/community\.general/pull/8796](https\://github\.com/ansible\-collections/community\.general/pull/8796)\)\.
|
||||
@@ -484,7 +604,7 @@ Bugfix and feature release\.
|
||||
<a id="v9-3-0"></a>
|
||||
## v9\.3\.0
|
||||
|
||||
<a id="release-summary-8"></a>
|
||||
<a id="release-summary-14"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix and feature release\.
|
||||
@@ -512,7 +632,7 @@ Regular bugfix and feature release\.
|
||||
* proxmox inventory plugin \- add new fact for LXC interface details \([https\://github\.com/ansible\-collections/community\.general/pull/8713](https\://github\.com/ansible\-collections/community\.general/pull/8713)\)\.
|
||||
* redis\, redis\_info \- add <code>client\_cert</code> and <code>client\_key</code> options to specify path to certificate for Redis authentication \([https\://github\.com/ansible\-collections/community\.general/pull/8654](https\://github\.com/ansible\-collections/community\.general/pull/8654)\)\.
|
||||
|
||||
<a id="bugfixes-9"></a>
|
||||
<a id="bugfixes-14"></a>
|
||||
### Bugfixes
|
||||
|
||||
* gitlab\_runner \- fix <code>paused</code> parameter being ignored \([https\://github\.com/ansible\-collections/community\.general/pull/8648](https\://github\.com/ansible\-collections/community\.general/pull/8648)\)\.
|
||||
@@ -533,7 +653,7 @@ Regular bugfix and feature release\.
|
||||
<a id="v9-2-0"></a>
|
||||
## v9\.2\.0
|
||||
|
||||
<a id="release-summary-9"></a>
|
||||
<a id="release-summary-15"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix and feature release\.
|
||||
@@ -550,7 +670,7 @@ Regular bugfix and feature release\.
|
||||
* virtualbox inventory plugin \- expose a new parameter <code>enable\_advanced\_group\_parsing</code> to change how the VirtualBox dynamic inventory parses VM groups \([https\://github\.com/ansible\-collections/community\.general/issues/8508](https\://github\.com/ansible\-collections/community\.general/issues/8508)\, [https\://github\.com/ansible\-collections/community\.general/pull/8510](https\://github\.com/ansible\-collections/community\.general/pull/8510)\)\.
|
||||
* wdc\_redfish\_command \- minor change to handle upgrade file for Redfish WD platforms \([https\://github\.com/ansible\-collections/community\.general/pull/8444](https\://github\.com/ansible\-collections/community\.general/pull/8444)\)\.
|
||||
|
||||
<a id="bugfixes-10"></a>
|
||||
<a id="bugfixes-15"></a>
|
||||
### Bugfixes
|
||||
|
||||
* bitwarden lookup plugin \- fix <code>KeyError</code> in <code>search\_field</code> \([https\://github\.com/ansible\-collections/community\.general/issues/8549](https\://github\.com/ansible\-collections/community\.general/issues/8549)\, [https\://github\.com/ansible\-collections/community\.general/pull/8557](https\://github\.com/ansible\-collections/community\.general/pull/8557)\)\.
|
||||
@@ -575,7 +695,7 @@ Regular bugfix and feature release\.
|
||||
<a id="v9-1-0"></a>
|
||||
## v9\.1\.0
|
||||
|
||||
<a id="release-summary-10"></a>
|
||||
<a id="release-summary-16"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular feature and bugfix release\.
|
||||
@@ -604,7 +724,7 @@ Regular feature and bugfix release\.
|
||||
* git\_config \- the <code>list\_all</code> option has been deprecated and will be removed in community\.general 11\.0\.0\. Use the <code>community\.general\.git\_config\_info</code> module instead \([https\://github\.com/ansible\-collections/community\.general/pull/8453](https\://github\.com/ansible\-collections/community\.general/pull/8453)\)\.
|
||||
* git\_config \- using <code>state\=present</code> without providing <code>value</code> is deprecated and will be disallowed in community\.general 11\.0\.0\. Use the <code>community\.general\.git\_config\_info</code> module instead to read a value \([https\://github\.com/ansible\-collections/community\.general/pull/8453](https\://github\.com/ansible\-collections/community\.general/pull/8453)\)\.
|
||||
|
||||
<a id="bugfixes-11"></a>
|
||||
<a id="bugfixes-16"></a>
|
||||
### Bugfixes
|
||||
|
||||
* git\_config \- fix behavior of <code>state\=absent</code> if <code>value</code> is present \([https\://github\.com/ansible\-collections/community\.general/issues/8436](https\://github\.com/ansible\-collections/community\.general/issues/8436)\, [https\://github\.com/ansible\-collections/community\.general/pull/8452](https\://github\.com/ansible\-collections/community\.general/pull/8452)\)\.
|
||||
@@ -642,7 +762,7 @@ Regular feature and bugfix release\.
|
||||
<a id="v9-0-1"></a>
|
||||
## v9\.0\.1
|
||||
|
||||
<a id="release-summary-11"></a>
|
||||
<a id="release-summary-17"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release for inclusion in Ansible 10\.0\.0rc1\.
|
||||
@@ -652,7 +772,7 @@ Bugfix release for inclusion in Ansible 10\.0\.0rc1\.
|
||||
|
||||
* ansible\_galaxy\_install \- minor refactor in the module \([https\://github\.com/ansible\-collections/community\.general/pull/8413](https\://github\.com/ansible\-collections/community\.general/pull/8413)\)\.
|
||||
|
||||
<a id="bugfixes-12"></a>
|
||||
<a id="bugfixes-17"></a>
|
||||
### Bugfixes
|
||||
|
||||
* cpanm \- use new <code>VarDict</code> to prevent deprecation warning \([https\://github\.com/ansible\-collections/community\.general/issues/8410](https\://github\.com/ansible\-collections/community\.general/issues/8410)\, [https\://github\.com/ansible\-collections/community\.general/pull/8411](https\://github\.com/ansible\-collections/community\.general/pull/8411)\)\.
|
||||
@@ -671,7 +791,7 @@ Bugfix release for inclusion in Ansible 10\.0\.0rc1\.
|
||||
<a id="v9-0-0"></a>
|
||||
## v9\.0\.0
|
||||
|
||||
<a id="release-summary-12"></a>
|
||||
<a id="release-summary-18"></a>
|
||||
### Release Summary
|
||||
|
||||
This is release 9\.0\.0 of <code>community\.general</code>\, released on 2024\-05\-20\.
|
||||
@@ -840,13 +960,13 @@ This is release 9\.0\.0 of <code>community\.general</code>\, released on 2024\-0
|
||||
* stackdriver \- this module relied on HTTPS APIs that do not exist anymore and was thus removed \([https\://github\.com/ansible\-collections/community\.general/pull/8198](https\://github\.com/ansible\-collections/community\.general/pull/8198)\)\.
|
||||
* webfaction\_\* modules \- these modules relied on HTTPS APIs that do not exist anymore and were thus removed \([https\://github\.com/ansible\-collections/community\.general/pull/8198](https\://github\.com/ansible\-collections/community\.general/pull/8198)\)\.
|
||||
|
||||
<a id="security-fixes-2"></a>
|
||||
<a id="security-fixes-3"></a>
|
||||
### Security Fixes
|
||||
|
||||
* cobbler\, gitlab\_runners\, icinga2\, linode\, lxd\, nmap\, online\, opennebula\, proxmox\, scaleway\, stackpath\_compute\, virtualbox\, and xen\_orchestra inventory plugin \- make sure all data received from the remote servers is marked as unsafe\, so remote code execution by obtaining texts that can be evaluated as templates is not possible \([https\://www\.die\-welt\.net/2024/03/remote\-code\-execution\-in\-ansible\-dynamic\-inventory\-plugins/](https\://www\.die\-welt\.net/2024/03/remote\-code\-execution\-in\-ansible\-dynamic\-inventory\-plugins/)\, [https\://github\.com/ansible\-collections/community\.general/pull/8098](https\://github\.com/ansible\-collections/community\.general/pull/8098)\)\.
|
||||
* keycloak\_identity\_provider \- the client secret was not correctly sanitized by the module\. The return values <code>proposed</code>\, <code>existing</code>\, and <code>end\_state</code>\, as well as the diff\, did contain the client secret unmasked \([https\://github\.com/ansible\-collections/community\.general/pull/8355](https\://github\.com/ansible\-collections/community\.general/pull/8355)\)\.
|
||||
|
||||
<a id="bugfixes-13"></a>
|
||||
<a id="bugfixes-18"></a>
|
||||
### Bugfixes
|
||||
|
||||
* aix\_filesystem \- fix <code>\_validate\_vg</code> not passing VG name to <code>lsvg\_cmd</code> \([https\://github\.com/ansible\-collections/community\.general/issues/8151](https\://github\.com/ansible\-collections/community\.general/issues/8151)\)\.
|
||||
|
||||
102
CHANGELOG.rst
102
CHANGELOG.rst
@@ -6,6 +6,108 @@ Community General Release Notes
|
||||
|
||||
This changelog describes changes after version 8.0.0.
|
||||
|
||||
v9.5.13
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Final maintenance release.
|
||||
|
||||
This is the last community.general 9.x.y release.
|
||||
Please upgrade to community.general 10.x.y, 11.x.y, or 12.x.y.
|
||||
Thanks a lot to everyone who contributed to a 9.x.y release!
|
||||
|
||||
Security Fixes
|
||||
--------------
|
||||
|
||||
- keycloak_user - the parameter ``credentials[].value`` is now marked as ``no_log=true``. Before it was logged by Ansible, unless the task was marked as ``no_log: true``. Since this parameter can be used for passwords, this resulted in credential leaking (https://github.com/ansible-collections/community.general/issues/11000, https://github.com/ansible-collections/community.general/pull/11005).
|
||||
|
||||
v9.5.12
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- github_deploy_key - fix bug during error handling if no body was present in the result (https://github.com/ansible-collections/community.general/issues/10853, https://github.com/ansible-collections/community.general/pull/10857).
|
||||
- yaml cache plugin - make compatible with ansible-core 2.19 (https://github.com/ansible-collections/community.general/issues/10849, https://github.com/ansible-collections/community.general/issues/10852).
|
||||
|
||||
v9.5.11
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- apache2_module - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- doas become plugin - disable pipelining on ansible-core 2.19+. The plugin does not work with pipelining, and since ansible-core 2.19 become plugins can indicate that they do not work with pipelining (https://github.com/ansible-collections/community.general/issues/9977, https://github.com/ansible-collections/community.general/pull/10537).
|
||||
- htpasswd - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- irc - pass hostname to ``wrap_socket()`` if ``use_tls=true`` and ``validate_certs=true`` (https://github.com/ansible-collections/community.general/issues/10472, https://github.com/ansible-collections/community.general/pull/10491).
|
||||
- json_query filter plugin - make compatible with lazy evaluation list and dictionary types of ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/10539).
|
||||
- machinectl become plugin - disable pipelining on ansible-core 2.19+. The plugin does not work with pipelining, and since ansible-core 2.19 become plugins can indicate that they do not work with pipelining (https://github.com/ansible-collections/community.general/pull/10537).
|
||||
- merge_variables lookup plugin - avoid deprecated functionality from ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/10566).
|
||||
- proxmox inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.proxmox/pull/108, https://github.com/ansible-collections/community.general/pull/10553).
|
||||
- syspatch - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- sysupgrade - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- zypper_repository - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
|
||||
v9.5.10
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release with improved ansible-core 2.19 compatibility.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- dependent lookup plugin - avoid deprecated ansible-core 2.19 functionality (https://github.com/ansible-collections/community.general/pull/10359).
|
||||
- icinga2 inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.general/pull/10271).
|
||||
- keycloak module_utils - fix call of method which does not exist in stable-9, which was introduced by backporting 8b1a193a (https://github.com/ansible-collections/community.general/pull/10298).
|
||||
- linode inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.general/pull/10271).
|
||||
|
||||
v9.5.9
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- yaml callback plugin - adjust to latest changes in ansible-core devel (https://github.com/ansible-collections/community.general/pull/10212).
|
||||
- yaml callback plugin - when using ansible-core 2.19.0b2 or newer, uses a new utility provided by ansible-core. This allows us to remove all hacks and vendored code that was part of the plugin for ansible-core versions with Data Tagging so far (https://github.com/ansible-collections/community.general/pull/10242).
|
||||
|
||||
v9.5.8
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- cobbler_system - fix bug with Cobbler >= 3.4.0 caused by giving more than 2 positional arguments to ``CobblerXMLRPCInterface.get_system_handle()`` (https://github.com/ansible-collections/community.general/issues/8506, https://github.com/ansible-collections/community.general/pull/10145).
|
||||
- kdeconfig - allow option values beginning with a dash (https://github.com/ansible-collections/community.general/issues/10127, https://github.com/ansible-collections/community.general/pull/10128).
|
||||
- keycloak_user_rolemapping - fix ``--diff`` mode (https://github.com/ansible-collections/community.general/issues/10067, https://github.com/ansible-collections/community.general/pull/10075).
|
||||
- pickle cache plugin - avoid extra JSON serialization with ansible-core >= 2.19 (https://github.com/ansible-collections/community.general/pull/10136).
|
||||
- rundeck_acl_policy - ensure that project ACLs are sent to the correct endpoint (https://github.com/ansible-collections/community.general/pull/10097).
|
||||
- sysrc - split the output of ``sysrc -e -a`` on the first ``=`` only (https://github.com/ansible-collections/community.general/issues/10120, https://github.com/ansible-collections/community.general/pull/10121).
|
||||
|
||||
v9.5.7
|
||||
======
|
||||
|
||||
|
||||
@@ -44,7 +44,49 @@ If you want to test a PR locally, refer to [our testing guide](https://github.co
|
||||
|
||||
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.
|
||||
|
||||
## Run sanity, unit or integration tests locally
|
||||
## Run sanity or unit locally (with antsibull-nox)
|
||||
|
||||
The easiest way to run sanity and unit tests locally is to use [antsibull-nox](https://ansible.readthedocs.io/projects/antsibull-nox/).
|
||||
(If you have [nox](https://nox.thea.codes/en/stable/) installed, it will automatically install antsibull-nox in a virtual environment for you.)
|
||||
|
||||
### Sanity tests
|
||||
|
||||
The following commands show how to run ansible-test sanity tests:
|
||||
|
||||
```.bash
|
||||
# Run basic sanity tests for all files in the collection:
|
||||
nox -Re ansible-test-sanity-devel
|
||||
|
||||
# Run basic sanity tests for the given files and directories:
|
||||
nox -Re ansible-test-sanity-devel -- plugins/modules/system/pids.py tests/integration/targets/pids/
|
||||
|
||||
# Run all other sanity tests for all files in the collection:
|
||||
nox -R
|
||||
```
|
||||
|
||||
If you replace `-Re` with `-e`, respectively. If you leave `-R` away, then the virtual environments will be re-created. The `-R` re-uses them (if they already exist).
|
||||
|
||||
### Unit tests
|
||||
|
||||
The following commands show how to run unit tests:
|
||||
|
||||
```.bash
|
||||
# Run all unit tests:
|
||||
nox -Re ansible-test-units-devel
|
||||
|
||||
# Run all unit tests for one Python version (a lot faster):
|
||||
nox -Re ansible-test-units-devel -- --python 3.13
|
||||
|
||||
# Run a specific unit test (for the nmcli module) for one Python version:
|
||||
nox -Re ansible-test-units-devel -- --python 3.13 tests/unit/plugins/modules/net_tools/test_nmcli.py
|
||||
```
|
||||
|
||||
If you replace `-Re` with `-e`, then the virtual environments will be re-created. The `-R` re-uses them (if they already exist).
|
||||
|
||||
## Run basic sanity, unit or integration tests locally (with ansible-test)
|
||||
|
||||
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:
|
||||
|
||||
@@ -56,20 +98,27 @@ cd ~/dev/ansible_collections/community/general
|
||||
|
||||
Then you can run `ansible-test` (which is a part of [ansible-core](https://pypi.org/project/ansible-core/)) inside the checkout. The following example commands expect that you have installed Docker or Podman. Note that Podman has only been supported by more recent ansible-core releases. If you are using Docker, the following will work with Ansible 2.9+.
|
||||
|
||||
### Sanity tests
|
||||
### Basic sanity tests
|
||||
|
||||
The following commands show how to run sanity tests:
|
||||
The following commands show how to run basic sanity tests:
|
||||
|
||||
```.bash
|
||||
# Run sanity tests for all files in the collection:
|
||||
# Run basic sanity tests for all files in the collection:
|
||||
ansible-test sanity --docker -v
|
||||
|
||||
# Run sanity tests for the given files and directories:
|
||||
# Run basic sanity tests for the given files and directories:
|
||||
ansible-test sanity --docker -v plugins/modules/system/pids.py tests/integration/targets/pids/
|
||||
```
|
||||
|
||||
### Unit tests
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
The following commands show how to run unit tests:
|
||||
|
||||
```.bash
|
||||
@@ -85,6 +134,16 @@ ansible-test units --docker -v --python 3.8 tests/unit/plugins/modules/net_tools
|
||||
|
||||
### Integration tests
|
||||
|
||||
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
|
||||
git clone https://github.com/ansible-collections/community.crypto.git ~/dev/ansible_collections/community/crypto
|
||||
git clone https://github.com/ansible-collections/community.docker.git ~/dev/ansible_collections/community/docker
|
||||
```
|
||||
|
||||
The following commands show how to run integration tests:
|
||||
|
||||
#### In Docker
|
||||
@@ -92,8 +151,8 @@ The following commands show how to run integration tests:
|
||||
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`.
|
||||
- `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
|
||||
|
||||
@@ -39,7 +39,7 @@ For more information about communication, see the [Ansible communication guide](
|
||||
|
||||
## Tested with Ansible
|
||||
|
||||
Tested with the current ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, ansible-core 2.18 releases and the current development version of ansible-core. Ansible-core versions before 2.13.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
|
||||
Tested with the current ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, ansible-core 2.18, and ansible-core 2.19 releases. Ansible-core versions before 2.13.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
|
||||
|
||||
## External requirements
|
||||
|
||||
@@ -141,4 +141,4 @@ See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/commu
|
||||
|
||||
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/stable-9/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-9/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/stable-9/LICENSES/PSF-2.0.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/dep5`. This conforms to the [REUSE specification](https://reuse.software/spec/).
|
||||
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/).
|
||||
|
||||
@@ -8,6 +8,25 @@
|
||||
"community.docker" = "git+https://github.com/ansible-collections/community.docker.git,main"
|
||||
"community.internal_test_tools" = "git+https://github.com/ansible-collections/community.internal_test_tools.git,main"
|
||||
|
||||
[collection_sources_per_ansible.'2.13']
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[collection_sources_per_ansible.'2.14']
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[collection_sources_per_ansible.'2.15']
|
||||
# community.crypto's main branch needs ansible-core >= 2.17
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[collection_sources_per_ansible.'2.16']
|
||||
# community.crypto's main branch needs ansible-core >= 2.17
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[vcs]
|
||||
vcs = "git"
|
||||
development_branch = "main"
|
||||
stable_branches = [ "stable-*" ]
|
||||
|
||||
[sessions]
|
||||
|
||||
[sessions.docs_check]
|
||||
@@ -25,6 +44,7 @@ run_action_groups = true
|
||||
name = "consul"
|
||||
pattern = "^consul_.*$"
|
||||
exclusions = [
|
||||
"consul_acl",
|
||||
"consul_acl_bootstrap",
|
||||
"consul_kv",
|
||||
]
|
||||
@@ -38,3 +58,11 @@ doc_fragment = "community.general.proxmox.actiongroup_proxmox"
|
||||
|
||||
[sessions.build_import_check]
|
||||
run_galaxy_importer = true
|
||||
|
||||
[sessions.ansible_test_sanity]
|
||||
include_devel = false
|
||||
max_version = "2.19"
|
||||
|
||||
[sessions.ansible_test_units]
|
||||
include_devel = false
|
||||
max_version = "2.19"
|
||||
|
||||
@@ -1699,3 +1699,130 @@ releases:
|
||||
- 9987-keycloak-auth-flow-fix-config.yaml
|
||||
- 9992-filtertypeerror.yml
|
||||
release_date: '2025-04-21'
|
||||
9.5.8:
|
||||
changes:
|
||||
bugfixes:
|
||||
- cobbler_system - fix bug with Cobbler >= 3.4.0 caused by giving more than
|
||||
2 positional arguments to ``CobblerXMLRPCInterface.get_system_handle()``
|
||||
(https://github.com/ansible-collections/community.general/issues/8506, https://github.com/ansible-collections/community.general/pull/10145).
|
||||
- kdeconfig - allow option values beginning with a dash (https://github.com/ansible-collections/community.general/issues/10127,
|
||||
https://github.com/ansible-collections/community.general/pull/10128).
|
||||
- keycloak_user_rolemapping - fix ``--diff`` mode (https://github.com/ansible-collections/community.general/issues/10067,
|
||||
https://github.com/ansible-collections/community.general/pull/10075).
|
||||
- pickle cache plugin - avoid extra JSON serialization with ansible-core >=
|
||||
2.19 (https://github.com/ansible-collections/community.general/pull/10136).
|
||||
- rundeck_acl_policy - ensure that project ACLs are sent to the correct endpoint
|
||||
(https://github.com/ansible-collections/community.general/pull/10097).
|
||||
- sysrc - split the output of ``sysrc -e -a`` on the first ``=`` only (https://github.com/ansible-collections/community.general/issues/10120,
|
||||
https://github.com/ansible-collections/community.general/pull/10121).
|
||||
release_summary: Regular bugfix release.
|
||||
fragments:
|
||||
- 10075-keycloak_user_rolemapping-diff.yml
|
||||
- 10097-fix-rundeck_acl_policy-project-endpoint.yml
|
||||
- 10121-sysrc-fix-split-first-separator.yml
|
||||
- 10128-mark-end-of-options.yml
|
||||
- 10136-cache-pickle-json.yml
|
||||
- 10145-fix-typeerror-cobbler-xmlrpc.yml
|
||||
- 9.5.8.yml
|
||||
release_date: '2025-05-19'
|
||||
9.5.9:
|
||||
changes:
|
||||
bugfixes:
|
||||
- yaml callback plugin - adjust to latest changes in ansible-core devel (https://github.com/ansible-collections/community.general/pull/10212).
|
||||
- yaml callback plugin - when using ansible-core 2.19.0b2 or newer, uses a
|
||||
new utility provided by ansible-core. This allows us to remove all hacks
|
||||
and vendored code that was part of the plugin for ansible-core versions
|
||||
with Data Tagging so far (https://github.com/ansible-collections/community.general/pull/10242).
|
||||
release_summary: Bugfix release.
|
||||
fragments:
|
||||
- 10212-yaml.yml
|
||||
- 10242-yaml.yml
|
||||
- 9.5.9.yml
|
||||
release_date: '2025-06-15'
|
||||
9.5.10:
|
||||
changes:
|
||||
bugfixes:
|
||||
- dependent lookup plugin - avoid deprecated ansible-core 2.19 functionality
|
||||
(https://github.com/ansible-collections/community.general/pull/10359).
|
||||
- icinga2 inventory plugin - avoid using deprecated option when templating
|
||||
options (https://github.com/ansible-collections/community.general/pull/10271).
|
||||
- keycloak module_utils - fix call of method which does not exist in stable-9,
|
||||
which was introduced by backporting 8b1a193a (https://github.com/ansible-collections/community.general/pull/10298).
|
||||
- linode inventory plugin - avoid using deprecated option when templating
|
||||
options (https://github.com/ansible-collections/community.general/pull/10271).
|
||||
release_summary: Bugfix release with improved ansible-core 2.19 compatibility.
|
||||
fragments:
|
||||
- 10271--disable_lookups.yml
|
||||
- 10298--keycloak-api-fix-stable9.yml
|
||||
- 10359-dependent.yml
|
||||
- 9.5.10.yml
|
||||
release_date: '2025-07-13'
|
||||
9.5.11:
|
||||
changes:
|
||||
bugfixes:
|
||||
- apache2_module - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- doas become plugin - disable pipelining on ansible-core 2.19+. The plugin
|
||||
does not work with pipelining, and since ansible-core 2.19 become plugins
|
||||
can indicate that they do not work with pipelining (https://github.com/ansible-collections/community.general/issues/9977,
|
||||
https://github.com/ansible-collections/community.general/pull/10537).
|
||||
- htpasswd - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- irc - pass hostname to ``wrap_socket()`` if ``use_tls=true`` and ``validate_certs=true``
|
||||
(https://github.com/ansible-collections/community.general/issues/10472,
|
||||
https://github.com/ansible-collections/community.general/pull/10491).
|
||||
- json_query filter plugin - make compatible with lazy evaluation list and
|
||||
dictionary types of ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/10539).
|
||||
- machinectl become plugin - disable pipelining on ansible-core 2.19+. The
|
||||
plugin does not work with pipelining, and since ansible-core 2.19 become
|
||||
plugins can indicate that they do not work with pipelining (https://github.com/ansible-collections/community.general/pull/10537).
|
||||
- merge_variables lookup plugin - avoid deprecated functionality from ansible-core
|
||||
2.19 (https://github.com/ansible-collections/community.general/pull/10566).
|
||||
- proxmox inventory plugin - avoid using deprecated option when templating
|
||||
options (https://github.com/ansible-collections/community.proxmox/pull/108,
|
||||
https://github.com/ansible-collections/community.general/pull/10553).
|
||||
- syspatch - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- sysupgrade - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
- zypper_repository - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459).
|
||||
release_summary: Bugfix release.
|
||||
fragments:
|
||||
- 10459-deprecations.yml
|
||||
- 10491-irc.yml
|
||||
- 10539-json_query.yml
|
||||
- 10566-merge_variables.yml
|
||||
- 108--disable_lookups.yml
|
||||
- 9.5.11.yml
|
||||
- become-pipelining.yml
|
||||
release_date: '2025-08-11'
|
||||
9.5.12:
|
||||
changes:
|
||||
bugfixes:
|
||||
- github_deploy_key - fix bug during error handling if no body was present
|
||||
in the result (https://github.com/ansible-collections/community.general/issues/10853,
|
||||
https://github.com/ansible-collections/community.general/pull/10857).
|
||||
- yaml cache plugin - make compatible with ansible-core 2.19 (https://github.com/ansible-collections/community.general/issues/10849,
|
||||
https://github.com/ansible-collections/community.general/issues/10852).
|
||||
release_summary: Bugfix release.
|
||||
fragments:
|
||||
- 10852-yaml.yml
|
||||
- 10857-github_deploy_key-err.yml
|
||||
- 9.5.12.yml
|
||||
release_date: '2025-10-06'
|
||||
9.5.13:
|
||||
changes:
|
||||
release_summary: 'Final maintenance release.
|
||||
|
||||
|
||||
This is the last community.general 9.x.y release.
|
||||
|
||||
Please upgrade to community.general 10.x.y, 11.x.y, or 12.x.y.
|
||||
|
||||
Thanks a lot to everyone who contributed to a 9.x.y release!'
|
||||
security_fixes:
|
||||
- 'keycloak_user - the parameter ``credentials[].value`` is now marked as
|
||||
``no_log=true``. Before it was logged by Ansible, unless the task was marked
|
||||
as ``no_log: true``. Since this parameter can be used for passwords, this
|
||||
resulted in credential leaking (https://github.com/ansible-collections/community.general/issues/11000,
|
||||
https://github.com/ansible-collections/community.general/pull/11005).'
|
||||
fragments:
|
||||
- 11005-keycloak_user.yml
|
||||
- 9.5.13.yml
|
||||
release_date: '2025-11-02'
|
||||
|
||||
@@ -7,9 +7,9 @@ changelog_filename_template: ../CHANGELOG.rst
|
||||
changelog_filename_version_depth: 0
|
||||
changes_file: changelog.yaml
|
||||
changes_format: combined
|
||||
ignore_other_fragment_extensions: true
|
||||
keep_fragments: false
|
||||
mention_ancestor: true
|
||||
flatmap: true
|
||||
new_plugins_after_name: removed_features
|
||||
notesdir: fragments
|
||||
output_formats:
|
||||
@@ -40,3 +40,4 @@ use_fqcn: true
|
||||
add_plugin_period: true
|
||||
changelog_nice_yaml: true
|
||||
changelog_sort: version
|
||||
vcs: auto
|
||||
|
||||
@@ -22,6 +22,7 @@ The same example from the Developer Guide would become:
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils import deps
|
||||
|
||||
|
||||
with deps.declare("foo"):
|
||||
import foo
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ section above, but there are more elements that will take part in it.
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||
|
||||
|
||||
class MyTest(ModuleHelper):
|
||||
output_params = ()
|
||||
change_params = ()
|
||||
@@ -256,9 +257,9 @@ With that, MH will automatically generate the diff output for variables that hav
|
||||
class MyTest(ModuleHelper):
|
||||
diff_params = ('value', )
|
||||
|
||||
def __run__(self):
|
||||
# example from community.general.gio_mime
|
||||
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True)
|
||||
def __run__(self):
|
||||
# example from community.general.gio_mime
|
||||
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True)
|
||||
|
||||
Moreover, if a module is set to return *facts* instead of return values, then again use the metadata ``fact=True`` and ``fact_params`` for module parameters.
|
||||
Additionally, you must specify ``facts_name``, as in:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace: community
|
||||
name: general
|
||||
version: 9.5.7
|
||||
version: 9.5.13
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
|
||||
@@ -84,6 +84,9 @@ DOCUMENTATION = '''
|
||||
- name: ansible_doas_prompt_l10n
|
||||
env:
|
||||
- name: ANSIBLE_DOAS_PROMPT_L10N
|
||||
notes:
|
||||
- This become plugin does not work when connection pipelining is enabled. With ansible-core 2.19+, using it automatically
|
||||
disables pipelining. On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
|
||||
'''
|
||||
|
||||
import re
|
||||
@@ -100,6 +103,10 @@ class BecomeModule(BecomeBase):
|
||||
fail = ('Permission denied',)
|
||||
missing = ('Authorization required',)
|
||||
|
||||
# See https://github.com/ansible-collections/community.general/issues/9977,
|
||||
# https://github.com/ansible/ansible/pull/78111
|
||||
pipelining = False
|
||||
|
||||
def check_password_prompt(self, b_output):
|
||||
''' checks if the expected password prompt exists in b_output '''
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ DOCUMENTATION = '''
|
||||
if the user is allowed to perform the action (take a look at the examples section).
|
||||
If such a rule is not present the plugin only work if it is used in context with the root user,
|
||||
because then no further prompt will be shown by machinectl.
|
||||
- This become plugin does not work when connection pipelining is enabled. With ansible-core 2.19+, using it automatically
|
||||
disables pipelining. On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
|
||||
'''
|
||||
|
||||
EXAMPLES = r'''
|
||||
@@ -109,6 +111,10 @@ class BecomeModule(BecomeBase):
|
||||
success = ('==== AUTHENTICATION COMPLETE ====',)
|
||||
require_tty = True # see https://github.com/ansible-collections/community.general/issues/6932
|
||||
|
||||
# See https://github.com/ansible/ansible/issues/81254,
|
||||
# https://github.com/ansible/ansible/pull/78111
|
||||
pipelining = False
|
||||
|
||||
@staticmethod
|
||||
def remove_ansi_codes(line):
|
||||
return ansi_color_codes.sub(b"", line)
|
||||
|
||||
1
plugins/cache/pickle.py
vendored
1
plugins/cache/pickle.py
vendored
@@ -57,6 +57,7 @@ class CacheModule(BaseFileCacheModule):
|
||||
"""
|
||||
A caching module backed by pickle files.
|
||||
"""
|
||||
_persistent = False # prevent unnecessary JSON serialization and key munging
|
||||
|
||||
def _load(self, filepath):
|
||||
# Pickle is a binary format
|
||||
|
||||
7
plugins/cache/yaml.py
vendored
7
plugins/cache/yaml.py
vendored
@@ -45,8 +45,7 @@ options:
|
||||
# TODO: determine whether it is OK to change to: type: float
|
||||
"""
|
||||
|
||||
|
||||
import codecs
|
||||
import os
|
||||
|
||||
import yaml
|
||||
|
||||
@@ -61,9 +60,9 @@ class CacheModule(BaseFileCacheModule):
|
||||
"""
|
||||
|
||||
def _load(self, filepath):
|
||||
with codecs.open(filepath, 'r', encoding='utf-8') as f:
|
||||
with open(os.path.abspath(filepath), 'r', encoding='utf-8') as f:
|
||||
return AnsibleLoader(f).get_single_data()
|
||||
|
||||
def _dump(self, value, filepath):
|
||||
with codecs.open(filepath, 'w', encoding='utf-8') as f:
|
||||
with open(os.path.abspath(filepath), 'w', encoding='utf-8') as f:
|
||||
yaml.dump(value, f, Dumper=AnsibleDumper, default_flow_style=False)
|
||||
|
||||
@@ -33,9 +33,9 @@ import yaml
|
||||
import json
|
||||
import re
|
||||
import string
|
||||
from collections.abc import Mapping, Sequence
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
from ansible.parsing.yaml.dumper import AnsibleDumper
|
||||
from ansible.plugins.callback import strip_internal_keys, module_response_deepcopy
|
||||
from ansible.plugins.callback.default import CallbackModule as Default
|
||||
|
||||
@@ -49,77 +49,77 @@ def should_use_block(value):
|
||||
return False
|
||||
|
||||
|
||||
def adjust_str_value_for_block(value):
|
||||
# we care more about readable than accuracy, so...
|
||||
# ...no trailing space
|
||||
value = value.rstrip()
|
||||
# ...and non-printable characters
|
||||
value = ''.join(x for x in value if x in string.printable or ord(x) >= 0xA0)
|
||||
# ...tabs prevent blocks from expanding
|
||||
value = value.expandtabs()
|
||||
# ...and odd bits of whitespace
|
||||
value = re.sub(r'[\x0b\x0c\r]', '', value)
|
||||
# ...as does trailing space
|
||||
value = re.sub(r' +\n', '\n', value)
|
||||
return value
|
||||
|
||||
|
||||
def create_string_node(tag, value, style, default_style):
|
||||
if style is None:
|
||||
if should_use_block(value):
|
||||
style = '|'
|
||||
value = adjust_str_value_for_block(value)
|
||||
else:
|
||||
style = default_style
|
||||
return yaml.representer.ScalarNode(tag, value, style=style)
|
||||
|
||||
|
||||
try:
|
||||
from ansible.module_utils.common.yaml import HAS_LIBYAML
|
||||
# import below was added in https://github.com/ansible/ansible/pull/85039,
|
||||
# first contained in ansible-core 2.19.0b2:
|
||||
from ansible.utils.vars import transform_to_native_types
|
||||
|
||||
if HAS_LIBYAML:
|
||||
from yaml.cyaml import CSafeDumper as SafeDumper
|
||||
else:
|
||||
from yaml import SafeDumper
|
||||
|
||||
class MyDumper(SafeDumper):
|
||||
def represent_scalar(self, tag, value, style=None):
|
||||
"""Uses block style for multi-line strings"""
|
||||
node = create_string_node(tag, value, style, self.default_style)
|
||||
if self.alias_key is not None:
|
||||
self.represented_objects[self.alias_key] = node
|
||||
return node
|
||||
|
||||
except ImportError:
|
||||
# In case transform_to_native_types cannot be imported, we either have ansible-core 2.19.0b1
|
||||
# (or some random commit from the devel or stable-2.19 branch after merging the DT changes
|
||||
# and before transform_to_native_types was added), or we have a version without the DT changes.
|
||||
|
||||
# Here we simply assume we have a version without the DT changes, and thus can continue as
|
||||
# with ansible-core 2.18 and before.
|
||||
|
||||
transform_to_native_types = None
|
||||
|
||||
from ansible.parsing.yaml.dumper import AnsibleDumper
|
||||
|
||||
class MyDumper(AnsibleDumper): # pylint: disable=inherit-non-class
|
||||
def represent_scalar(self, tag, value, style=None):
|
||||
"""Uses block style for multi-line strings"""
|
||||
if style is None:
|
||||
if should_use_block(value):
|
||||
style = '|'
|
||||
# we care more about readable than accuracy, so...
|
||||
# ...no trailing space
|
||||
value = value.rstrip()
|
||||
# ...and non-printable characters
|
||||
value = ''.join(x for x in value if x in string.printable or ord(x) >= 0xA0)
|
||||
# ...tabs prevent blocks from expanding
|
||||
value = value.expandtabs()
|
||||
# ...and odd bits of whitespace
|
||||
value = re.sub(r'[\x0b\x0c\r]', '', value)
|
||||
# ...as does trailing space
|
||||
value = re.sub(r' +\n', '\n', value)
|
||||
else:
|
||||
style = self.default_style
|
||||
node = yaml.representer.ScalarNode(tag, value, style=style)
|
||||
node = create_string_node(tag, value, style, self.default_style)
|
||||
if self.alias_key is not None:
|
||||
self.represented_objects[self.alias_key] = node
|
||||
return node
|
||||
except: # noqa: E722, pylint: disable=bare-except
|
||||
# This happens with Data Tagging, see https://github.com/ansible/ansible/issues/84781
|
||||
# Until there is a better solution we'll resort to using ansible-core internals.
|
||||
from ansible._internal._yaml import _dumper
|
||||
import typing as t
|
||||
|
||||
class MyDumper(_dumper._BaseDumper):
|
||||
# This code is mostly taken from ansible._internal._yaml._dumper
|
||||
@classmethod
|
||||
def _register_representers(cls) -> None:
|
||||
cls.add_multi_representer(_dumper.AnsibleTaggedObject, cls.represent_ansible_tagged_object)
|
||||
cls.add_multi_representer(_dumper.Tripwire, cls.represent_tripwire)
|
||||
cls.add_multi_representer(_dumper.c.Mapping, _dumper.SafeRepresenter.represent_dict)
|
||||
cls.add_multi_representer(_dumper.c.Sequence, _dumper.SafeRepresenter.represent_list)
|
||||
|
||||
def represent_ansible_tagged_object(self, data):
|
||||
if ciphertext := _dumper.VaultHelper.get_ciphertext(data, with_tags=False):
|
||||
return self.represent_scalar('!vault', ciphertext, style='|')
|
||||
|
||||
return self.represent_data(_dumper.AnsibleTagHelper.as_native_type(data)) # automatically decrypts encrypted strings
|
||||
|
||||
def represent_tripwire(self, data: _dumper.Tripwire) -> t.NoReturn:
|
||||
data.trip()
|
||||
|
||||
# The following function is the same as in the try/except
|
||||
def represent_scalar(self, tag, value, style=None):
|
||||
"""Uses block style for multi-line strings"""
|
||||
if style is None:
|
||||
if should_use_block(value):
|
||||
style = '|'
|
||||
# we care more about readable than accuracy, so...
|
||||
# ...no trailing space
|
||||
value = value.rstrip()
|
||||
# ...and non-printable characters
|
||||
value = ''.join(x for x in value if x in string.printable or ord(x) >= 0xA0)
|
||||
# ...tabs prevent blocks from expanding
|
||||
value = value.expandtabs()
|
||||
# ...and odd bits of whitespace
|
||||
value = re.sub(r'[\x0b\x0c\r]', '', value)
|
||||
# ...as does trailing space
|
||||
value = re.sub(r' +\n', '\n', value)
|
||||
else:
|
||||
style = self.default_style
|
||||
node = yaml.representer.ScalarNode(tag, value, style=style)
|
||||
if self.alias_key is not None:
|
||||
self.represented_objects[self.alias_key] = node
|
||||
return node
|
||||
def transform_recursively(value, transform):
|
||||
if isinstance(value, Mapping):
|
||||
return {transform(k): transform(v) for k, v in value.items()}
|
||||
if isinstance(value, Sequence) and not isinstance(value, (str, bytes)):
|
||||
return [transform(e) for e in value]
|
||||
return transform(value)
|
||||
|
||||
|
||||
class CallbackModule(Default):
|
||||
@@ -176,6 +176,8 @@ class CallbackModule(Default):
|
||||
|
||||
if abridged_result:
|
||||
dumped += '\n'
|
||||
if transform_to_native_types is not None:
|
||||
abridged_result = transform_recursively(abridged_result, lambda v: transform_to_native_types(v, redact=False))
|
||||
dumped += to_text(yaml.dump(abridged_result, allow_unicode=True, width=1000, Dumper=MyDumper, default_flow_style=False))
|
||||
|
||||
# indent by a couple of spaces
|
||||
|
||||
@@ -125,10 +125,17 @@ def json_query(data, expr):
|
||||
'json_query filter')
|
||||
|
||||
# Hack to handle Ansible Unsafe text, AnsibleMapping and AnsibleSequence
|
||||
# See issue: https://github.com/ansible-collections/community.general/issues/320
|
||||
jmespath.functions.REVERSE_TYPES_MAP['string'] = jmespath.functions.REVERSE_TYPES_MAP['string'] + ('AnsibleUnicode', 'AnsibleUnsafeText', )
|
||||
jmespath.functions.REVERSE_TYPES_MAP['array'] = jmespath.functions.REVERSE_TYPES_MAP['array'] + ('AnsibleSequence', )
|
||||
jmespath.functions.REVERSE_TYPES_MAP['object'] = jmespath.functions.REVERSE_TYPES_MAP['object'] + ('AnsibleMapping', )
|
||||
# See issues https://github.com/ansible-collections/community.general/issues/320
|
||||
# and https://github.com/ansible/ansible/issues/85600.
|
||||
jmespath.functions.REVERSE_TYPES_MAP['string'] = jmespath.functions.REVERSE_TYPES_MAP['string'] + (
|
||||
'AnsibleUnicode', 'AnsibleUnsafeText', '_AnsibleTaggedStr',
|
||||
)
|
||||
jmespath.functions.REVERSE_TYPES_MAP['array'] = jmespath.functions.REVERSE_TYPES_MAP['array'] + (
|
||||
'AnsibleSequence', '_AnsibleLazyTemplateList',
|
||||
)
|
||||
jmespath.functions.REVERSE_TYPES_MAP['object'] = jmespath.functions.REVERSE_TYPES_MAP['object'] + (
|
||||
'AnsibleMapping', '_AnsibleLazyTemplateDict',
|
||||
)
|
||||
try:
|
||||
return jmespath.search(expr, data)
|
||||
except jmespath.exceptions.JMESPathError as e:
|
||||
|
||||
@@ -296,11 +296,11 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||
self.group_by_hostgroups = self.get_option('group_by_hostgroups')
|
||||
|
||||
if self.templar.is_template(self.icinga2_url):
|
||||
self.icinga2_url = self.templar.template(variable=self.icinga2_url, disable_lookups=False)
|
||||
self.icinga2_url = self.templar.template(variable=self.icinga2_url)
|
||||
if self.templar.is_template(self.icinga2_user):
|
||||
self.icinga2_user = self.templar.template(variable=self.icinga2_user, disable_lookups=False)
|
||||
self.icinga2_user = self.templar.template(variable=self.icinga2_user)
|
||||
if self.templar.is_template(self.icinga2_password):
|
||||
self.icinga2_password = self.templar.template(variable=self.icinga2_password, disable_lookups=False)
|
||||
self.icinga2_password = self.templar.template(variable=self.icinga2_password)
|
||||
|
||||
self.icinga2_url = self.icinga2_url.rstrip('/') + '/v1'
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
|
||||
access_token = self.get_option('access_token')
|
||||
if self.templar.is_template(access_token):
|
||||
access_token = self.templar.template(variable=access_token, disable_lookups=False)
|
||||
access_token = self.templar.template(variable=access_token)
|
||||
|
||||
if access_token is None:
|
||||
raise AnsibleError((
|
||||
|
||||
@@ -682,7 +682,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
for o in ('url', 'user', 'password', 'token_id', 'token_secret'):
|
||||
v = self.get_option(o)
|
||||
if self.templar.is_template(v):
|
||||
v = self.templar.template(v, disable_lookups=False)
|
||||
v = self.templar.template(v)
|
||||
setattr(self, 'proxmox_%s' % o, v)
|
||||
|
||||
# some more cleanup and validation
|
||||
|
||||
@@ -210,7 +210,10 @@ class LookupModule(LookupBase):
|
||||
|
||||
result = []
|
||||
if len(terms) > 0:
|
||||
templar = Templar(loader=self._templar._loader)
|
||||
if HAS_DATATAGGING:
|
||||
templar = self._templar.copy_with_new_env(available_variables={})
|
||||
else:
|
||||
templar = Templar(loader=self._templar._loader)
|
||||
data = []
|
||||
vars_so_far = set()
|
||||
for index, term in enumerate(terms):
|
||||
|
||||
@@ -197,8 +197,8 @@ class LookupModule(LookupBase):
|
||||
result = initial_value
|
||||
|
||||
for var_name in var_merge_names:
|
||||
with self._templar.set_temporary_context(available_variables=variables): # tmp. switch renderer to context of current variables
|
||||
var_value = self._templar.template(variables[var_name]) # Render jinja2 templates
|
||||
temp_templar = self._templar.copy_with_new_env(available_variables=variables) # tmp. switch renderer to context of current variables
|
||||
var_value = temp_templar.template(variables[var_name]) # Render jinja2 templates
|
||||
var_type = _verify_and_get_type(var_value)
|
||||
|
||||
if prev_var_type is None:
|
||||
|
||||
@@ -2236,14 +2236,17 @@ class KeycloakAPI(object):
|
||||
"""
|
||||
try:
|
||||
# Send a DELETE request to remove the specified authentication config from the Keycloak server.
|
||||
self._request(
|
||||
open_url(
|
||||
URL_AUTHENTICATION_CONFIG.format(
|
||||
url=self.baseurl,
|
||||
realm=realm,
|
||||
id=configId),
|
||||
method='DELETE')
|
||||
method='DELETE',
|
||||
http_agent=self.http_agent, headers=self.restheaders,
|
||||
timeout=self.connection_timeout,
|
||||
validate_certs=self.validate_certs)
|
||||
except Exception as e:
|
||||
self.fail_request(e, msg="Unable to delete authentication config %s: %s" % (configId, str(e)))
|
||||
self.fail_open_url(e, msg="Unable to delete authentication config %s: %s" % (configId, str(e)))
|
||||
|
||||
def create_subflow(self, subflowName, flowAlias, realm='master', flowType='basic-flow'):
|
||||
""" Create new sublow on the flow
|
||||
|
||||
@@ -166,12 +166,12 @@ def _module_is_enabled(module):
|
||||
if module.params['ignore_configcheck']:
|
||||
if 'AH00534' in stderr and 'mpm_' in module.params['name']:
|
||||
if module.params['warn_mpm_absent']:
|
||||
module.warnings.append(
|
||||
module.warn(
|
||||
"No MPM module loaded! apache2 reload AND other module actions"
|
||||
" will fail if no MPM module is loaded immediately."
|
||||
)
|
||||
else:
|
||||
module.warnings.append(error_msg)
|
||||
module.warn(error_msg)
|
||||
return False
|
||||
else:
|
||||
module.fail_json(msg=error_msg)
|
||||
@@ -226,9 +226,7 @@ def _set_state(module, state):
|
||||
|
||||
if _module_is_enabled(module) != want_enabled:
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True,
|
||||
result=success_msg,
|
||||
warnings=module.warnings)
|
||||
module.exit_json(changed=True, result=success_msg)
|
||||
|
||||
a2mod_binary_path = module.get_bin_path(a2mod_binary)
|
||||
if a2mod_binary_path is None:
|
||||
@@ -243,9 +241,7 @@ def _set_state(module, state):
|
||||
result, stdout, stderr = module.run_command(a2mod_binary_cmd + [name])
|
||||
|
||||
if _module_is_enabled(module) == want_enabled:
|
||||
module.exit_json(changed=True,
|
||||
result=success_msg,
|
||||
warnings=module.warnings)
|
||||
module.exit_json(changed=True, result=success_msg)
|
||||
else:
|
||||
msg = (
|
||||
'Failed to set module {name} to {state}:\n'
|
||||
@@ -263,9 +259,7 @@ def _set_state(module, state):
|
||||
stdout=stdout,
|
||||
stderr=stderr)
|
||||
else:
|
||||
module.exit_json(changed=False,
|
||||
result=success_msg,
|
||||
warnings=module.warnings)
|
||||
module.exit_json(changed=False, result=success_msg)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -281,8 +275,6 @@ def main():
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
module.warnings = []
|
||||
|
||||
name = module.params['name']
|
||||
if name == 'cgi' and _run_threaded(module):
|
||||
module.fail_json(msg="Your MPM seems to be threaded. No automatic actions on module cgi possible.")
|
||||
|
||||
@@ -162,6 +162,8 @@ from ansible.module_utils.common.text.converters import to_text
|
||||
from ansible_collections.community.general.plugins.module_utils.datetime import (
|
||||
now,
|
||||
)
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
|
||||
IFPROPS_MAPPING = dict(
|
||||
bondingopts='bonding_opts',
|
||||
@@ -279,7 +281,11 @@ def main():
|
||||
|
||||
if system:
|
||||
# Update existing entry
|
||||
system_id = conn.get_system_handle(name, token)
|
||||
system_id = None
|
||||
if LooseVersion(str(conn.version())) >= LooseVersion('3.4.0'):
|
||||
system_id = conn.get_system_handle(name)
|
||||
else:
|
||||
system_id = conn.get_system_handle(name, token)
|
||||
|
||||
for key, value in iteritems(module.params['properties']):
|
||||
if key not in system:
|
||||
|
||||
@@ -77,7 +77,7 @@ EXAMPLES = r'''
|
||||
state: opts_present
|
||||
opts: discard
|
||||
loop: '{{ ansible_mounts }}'
|
||||
when: "'/dev/mapper/luks-' in {{ item.device }}"
|
||||
when: "'/dev/mapper/luks-' in item.device"
|
||||
'''
|
||||
|
||||
import os
|
||||
|
||||
@@ -40,6 +40,8 @@ options:
|
||||
required: false
|
||||
type: str
|
||||
choices: [enabled, disabled]
|
||||
notes:
|
||||
- Does not work with C(dnf5).
|
||||
seealso:
|
||||
- module: ansible.builtin.dnf
|
||||
- module: ansible.builtin.yum_repository
|
||||
|
||||
@@ -74,6 +74,7 @@ notes:
|
||||
guess as close as possible to the behaviour inferred from its code.
|
||||
- For most of cases where you want to lock and unlock specific versions of a
|
||||
package, this works fairly well.
|
||||
- Does not work with C(dnf5).
|
||||
requirements:
|
||||
- dnf
|
||||
- dnf-plugin-versionlock
|
||||
@@ -96,12 +97,12 @@ EXAMPLES = r'''
|
||||
|
||||
- name: Remove lock from nginx to be updated again
|
||||
community.general.dnf_versionlock:
|
||||
package: nginx
|
||||
name: nginx
|
||||
state: absent
|
||||
|
||||
- name: Exclude bind 32:9.11 from installs or updates
|
||||
community.general.dnf_versionlock:
|
||||
package: bind-32:9.11*
|
||||
name: bind-32:9.11*
|
||||
state: excluded
|
||||
|
||||
- name: Keep bash package in major version 4
|
||||
|
||||
@@ -284,6 +284,8 @@ class GithubDeployKey(object):
|
||||
body = info.get('body')
|
||||
if body:
|
||||
err = self.module.from_json(body)['message']
|
||||
else:
|
||||
err = None
|
||||
|
||||
if status_code == 401:
|
||||
self.module.fail_json(msg="Failed to connect to {0} due to invalid credentials".format(self.github_url), http_status_code=status_code, error=err)
|
||||
|
||||
@@ -238,8 +238,8 @@ def main():
|
||||
(msg, changed) = present(path, username, password, hash_scheme, create, check_mode)
|
||||
elif state == 'absent':
|
||||
if not os.path.exists(path):
|
||||
module.exit_json(msg="%s not present" % username,
|
||||
warnings="%s does not exist" % path, changed=False)
|
||||
module.warn("%s does not exist" % path)
|
||||
module.exit_json(msg="%s not present" % username, changed=False)
|
||||
(msg, changed) = absent(path, username, check_mode)
|
||||
else:
|
||||
module.fail_json(msg="Invalid state: %s" % state)
|
||||
|
||||
@@ -221,9 +221,11 @@ def send_msg(msg, server='localhost', port='6667', channel=None, nick_to=None, k
|
||||
|
||||
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
if use_tls:
|
||||
kwargs = {}
|
||||
if validate_certs:
|
||||
try:
|
||||
context = ssl.create_default_context()
|
||||
kwargs["server_hostname"] = server
|
||||
except AttributeError:
|
||||
raise Exception('Need at least Python 2.7.9 for SSL certificate validation')
|
||||
else:
|
||||
@@ -233,7 +235,7 @@ def send_msg(msg, server='localhost', port='6667', channel=None, nick_to=None, k
|
||||
else:
|
||||
context = ssl.SSLContext()
|
||||
context.verify_mode = ssl.CERT_NONE
|
||||
irc = context.wrap_socket(irc)
|
||||
irc = context.wrap_socket(irc, **kwargs)
|
||||
irc.connect((server, int(port)))
|
||||
|
||||
if passwd:
|
||||
|
||||
@@ -144,7 +144,7 @@ def run_kwriteconfig(module, cmd, path, groups, key, value):
|
||||
else:
|
||||
args.append('false')
|
||||
else:
|
||||
args.append(value)
|
||||
args.extend(['--', value])
|
||||
module.run_command(args, check_rc=True)
|
||||
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ def main():
|
||||
argument_spec['auth_username']['aliases'] = []
|
||||
credential_spec = dict(
|
||||
type=dict(type='str', required=True),
|
||||
value=dict(type='str', required=True),
|
||||
value=dict(type='str', required=True, no_log=True),
|
||||
temporary=dict(type='bool', default=False)
|
||||
)
|
||||
client_consents_spec = dict(
|
||||
|
||||
@@ -369,7 +369,7 @@ def main():
|
||||
# Assign roles
|
||||
result['changed'] = True
|
||||
if module._diff:
|
||||
result['diff'] = dict(before=assigned_roles_before, after=update_roles)
|
||||
result['diff'] = dict(before={"roles": assigned_roles_before}, after={"roles": update_roles})
|
||||
if module.check_mode:
|
||||
module.exit_json(**result)
|
||||
kc.add_user_rolemapping(uid=uid, cid=cid, role_rep=update_roles, realm=realm)
|
||||
@@ -384,7 +384,7 @@ def main():
|
||||
# Remove mapping of role
|
||||
result['changed'] = True
|
||||
if module._diff:
|
||||
result['diff'] = dict(before=assigned_roles_before, after=update_roles)
|
||||
result['diff'] = dict(before={"roles": assigned_roles_before}, after={"roles": update_roles})
|
||||
if module.check_mode:
|
||||
module.exit_json(**result)
|
||||
kc.delete_user_rolemapping(uid=uid, cid=cid, role_rep=update_roles, realm=realm)
|
||||
|
||||
@@ -1335,7 +1335,7 @@ EXAMPLES = r'''
|
||||
community.general.nmcli:
|
||||
conn_name: my-eth1
|
||||
state: up
|
||||
reload: true
|
||||
conn_reload: true
|
||||
|
||||
- name: Add second ip4 address
|
||||
community.general.nmcli:
|
||||
|
||||
@@ -130,11 +130,18 @@ from ansible_collections.community.general.plugins.module_utils.rundeck import (
|
||||
class RundeckACLManager:
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
if module.params.get("project"):
|
||||
self.endpoint = "project/%s/acl/%s.aclpolicy" % (
|
||||
self.module.params["project"],
|
||||
self.module.params["name"],
|
||||
)
|
||||
else:
|
||||
self.endpoint = "system/acl/%s.aclpolicy" % self.module.params["name"]
|
||||
|
||||
def get_acl(self):
|
||||
resp, info = api_request(
|
||||
module=self.module,
|
||||
endpoint="system/acl/%s.aclpolicy" % self.module.params["name"],
|
||||
endpoint=self.endpoint,
|
||||
)
|
||||
|
||||
return resp
|
||||
@@ -148,7 +155,7 @@ class RundeckACLManager:
|
||||
|
||||
resp, info = api_request(
|
||||
module=self.module,
|
||||
endpoint="system/acl/%s.aclpolicy" % self.module.params["name"],
|
||||
endpoint=self.endpoint,
|
||||
method="POST",
|
||||
data={"contents": self.module.params["policy"]},
|
||||
)
|
||||
@@ -172,7 +179,7 @@ class RundeckACLManager:
|
||||
|
||||
resp, info = api_request(
|
||||
module=self.module,
|
||||
endpoint="system/acl/%s.aclpolicy" % self.module.params["name"],
|
||||
endpoint=self.endpoint,
|
||||
method="PUT",
|
||||
data={"contents": self.module.params["policy"]},
|
||||
)
|
||||
@@ -195,7 +202,7 @@ class RundeckACLManager:
|
||||
if not self.module.check_mode:
|
||||
api_request(
|
||||
module=self.module,
|
||||
endpoint="system/acl/%s.aclpolicy" % self.module.params["name"],
|
||||
endpoint=self.endpoint,
|
||||
method="DELETE",
|
||||
)
|
||||
|
||||
|
||||
@@ -103,7 +103,6 @@ def syspatch_run(module):
|
||||
cmd = module.get_bin_path('syspatch', True)
|
||||
changed = False
|
||||
reboot_needed = False
|
||||
warnings = []
|
||||
|
||||
# Set safe defaults for run_flag and check_flag
|
||||
run_flag = ['-c']
|
||||
@@ -145,11 +144,11 @@ def syspatch_run(module):
|
||||
# Kernel update applied
|
||||
reboot_needed = True
|
||||
elif out.lower().find('syspatch updated itself') >= 0:
|
||||
warnings.append('Syspatch was updated. Please run syspatch again.')
|
||||
module.warn('Syspatch was updated. Please run syspatch again.')
|
||||
|
||||
# If no stdout, then warn user
|
||||
if len(out) == 0:
|
||||
warnings.append('syspatch had suggested changes, but stdout was empty.')
|
||||
module.warn('syspatch had suggested changes, but stdout was empty.')
|
||||
|
||||
changed = True
|
||||
else:
|
||||
@@ -161,7 +160,6 @@ def syspatch_run(module):
|
||||
rc=rc,
|
||||
stderr=err,
|
||||
stdout=out,
|
||||
warnings=warnings
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class Sysrc(object):
|
||||
Use this dictionary to preform the tests.
|
||||
"""
|
||||
(rc, out, err) = self.run_sysrc('-e', '-a')
|
||||
conf = dict([i.split('=') for i in out.splitlines()])
|
||||
conf = dict([i.split('=', 1) for i in out.splitlines()])
|
||||
if self.value is None:
|
||||
return self.name in conf
|
||||
else:
|
||||
|
||||
@@ -101,7 +101,6 @@ def sysupgrade_run(module):
|
||||
sysupgrade_bin = module.get_bin_path('/usr/sbin/sysupgrade', required=True)
|
||||
cmd = [sysupgrade_bin]
|
||||
changed = False
|
||||
warnings = []
|
||||
|
||||
# Setup command flags
|
||||
if module.params['snapshot']:
|
||||
@@ -137,7 +136,6 @@ def sysupgrade_run(module):
|
||||
rc=rc,
|
||||
stderr=err,
|
||||
stdout=out,
|
||||
warnings=warnings
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ options:
|
||||
aliases: [rtc]
|
||||
choices: [local, UTC]
|
||||
notes:
|
||||
- On Ubuntu 24.04 the C(util-linux-extra) package is required to provide the C(hwclock) command.
|
||||
- On Ubuntu 24.04 and Debian 13 (Trixie), the C(util-linux-extra) package is required to provide the C(hwclock) command.
|
||||
- On SmartOS the C(sm-set-timezone) utility (part of the smtools package) is required to set the zone timezone.
|
||||
- On AIX only Olson/tz database timezones are usable (POSIX is not supported). An OS reboot is also required on AIX for the new timezone setting
|
||||
to take effect. Note that AIX 6.1+ is needed (OS level 61 or newer).
|
||||
|
||||
@@ -248,7 +248,7 @@ def repo_exists(module, repodata, overwrite_multiple):
|
||||
module.fail_json(msg=errmsg)
|
||||
|
||||
|
||||
def addmodify_repo(module, repodata, old_repos, zypper_version, warnings):
|
||||
def addmodify_repo(module, repodata, old_repos, zypper_version):
|
||||
"Adds the repo, removes old repos before, that would conflict."
|
||||
repo = repodata['url']
|
||||
cmd = _get_cmd(module, 'addrepo', '--check')
|
||||
@@ -261,7 +261,7 @@ def addmodify_repo(module, repodata, old_repos, zypper_version, warnings):
|
||||
if zypper_version >= LooseVersion('1.12.25'):
|
||||
cmd.extend(['--priority', str(repodata['priority'])])
|
||||
else:
|
||||
warnings.append("Setting priority only available for zypper >= 1.12.25. Ignoring priority argument.")
|
||||
module.warn("Setting priority only available for zypper >= 1.12.25. Ignoring priority argument.")
|
||||
|
||||
if repodata['enabled'] == '0':
|
||||
cmd.append('--disable')
|
||||
@@ -275,7 +275,7 @@ def addmodify_repo(module, repodata, old_repos, zypper_version, warnings):
|
||||
else:
|
||||
cmd.append('--no-gpgcheck')
|
||||
else:
|
||||
warnings.append("Enabling/disabling gpgcheck only available for zypper >= 1.6.2. Using zypper default value.")
|
||||
module.warn("Enabling/disabling gpgcheck only available for zypper >= 1.6.2. Using zypper default value.")
|
||||
|
||||
if repodata['autorefresh'] == '1':
|
||||
cmd.append('--refresh')
|
||||
@@ -348,7 +348,6 @@ def main():
|
||||
runrefresh = module.params['runrefresh']
|
||||
|
||||
zypper_version = get_zypper_version(module)
|
||||
warnings = [] # collect warning messages for final output
|
||||
|
||||
repodata = {
|
||||
'url': repo,
|
||||
@@ -455,7 +454,7 @@ def main():
|
||||
if runrefresh:
|
||||
runrefreshrepo(module, auto_import_keys, shortname)
|
||||
exit_unchanged()
|
||||
rc, stdout, stderr = addmodify_repo(module, repodata, old_repos, zypper_version, warnings)
|
||||
rc, stdout, stderr = addmodify_repo(module, repodata, old_repos, zypper_version)
|
||||
if rc == 0 and (runrefresh or auto_import_keys):
|
||||
runrefreshrepo(module, auto_import_keys, shortname)
|
||||
elif state == 'absent':
|
||||
@@ -464,9 +463,9 @@ def main():
|
||||
rc, stdout, stderr = remove_repo(module, shortname)
|
||||
|
||||
if rc == 0:
|
||||
module.exit_json(changed=True, repodata=repodata, state=state, warnings=warnings)
|
||||
module.exit_json(changed=True, repodata=repodata, state=state)
|
||||
else:
|
||||
module.fail_json(msg="Zypper failed with rc %s" % rc, rc=rc, stdout=stdout, stderr=stderr, repodata=repodata, state=state, warnings=warnings)
|
||||
module.fail_json(msg="Zypper failed with rc %s" % rc, rc=rc, stdout=stdout, stderr=stderr, repodata=repodata, state=state)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
assert:
|
||||
that:
|
||||
- cmd.rc == 2
|
||||
- '"No such file" in cmd.msg'
|
||||
- '"No such file" in cmd.msg or "Error executing command." == cmd.msg'
|
||||
|
||||
- name: Get dummymain alternatives output
|
||||
command:
|
||||
@@ -172,7 +172,7 @@
|
||||
assert:
|
||||
that:
|
||||
- cmd.rc == 2
|
||||
- '"No such file" in cmd.msg'
|
||||
- '"No such file" in cmd.msg or "Error executing command." == cmd.msg'
|
||||
|
||||
- name: Get dummymain alternatives output
|
||||
command:
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
- name: ensure configcheck fails task with when run without mpm modules
|
||||
assert:
|
||||
that:
|
||||
- "{{ item.failed }}"
|
||||
- item is failed
|
||||
with_items: "{{ remove_with_configcheck.results }}"
|
||||
|
||||
- name: try to disable all mpm modules without configcheck
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
label: "{{ test.name }}"
|
||||
|
||||
- name: Collect outputs
|
||||
command: "ansible-playbook -i {{ inventory }} {{ playbook }}"
|
||||
command: "ansible-playbook -i {{ inventory }} {{ playbook }} {{ test.extra_cli_arguments | default('') }}"
|
||||
environment: "{{ test.environment }}"
|
||||
loop: "{{ tests }}"
|
||||
loop_control:
|
||||
|
||||
@@ -460,3 +460,63 @@
|
||||
"PLAY RECAP *********************************************************************",
|
||||
"testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
]
|
||||
|
||||
- name: Set on_any_msg
|
||||
environment:
|
||||
ANSIBLE_NOCOLOR: 'true'
|
||||
ANSIBLE_FORCE_COLOR: 'false'
|
||||
ANSIBLE_STDOUT_CALLBACK: community.general.diy
|
||||
ANSIBLE_CALLBACK_DIY_ON_ANY_MSG: foo
|
||||
playbook: !unsafe |
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: A loop
|
||||
debug:
|
||||
msg: "{{ item }}"
|
||||
loop:
|
||||
- 1
|
||||
- 2
|
||||
- name: Sample task name
|
||||
debug:
|
||||
msg: sample debug msg
|
||||
- name: Skipped task
|
||||
command: ls /
|
||||
when: false
|
||||
expected_output:
|
||||
- "foo"
|
||||
- ""
|
||||
- "PLAY [testhost] ****************************************************************"
|
||||
- "foo"
|
||||
- ""
|
||||
- "TASK [A loop] ******************************************************************"
|
||||
- "foo"
|
||||
- "foo"
|
||||
- "ok: [testhost] => (item=1) => {"
|
||||
- " \"msg\": 1"
|
||||
- "}"
|
||||
- "foo"
|
||||
- "ok: [testhost] => (item=2) => {"
|
||||
- " \"msg\": 2"
|
||||
- "}"
|
||||
- "foo"
|
||||
- "foo"
|
||||
- ""
|
||||
- "TASK [Sample task name] ********************************************************"
|
||||
- "foo"
|
||||
- "foo"
|
||||
- "ok: [testhost] => {"
|
||||
- " \"msg\": \"sample debug msg\""
|
||||
- "}"
|
||||
- "foo"
|
||||
- ""
|
||||
- "TASK [Skipped task] ************************************************************"
|
||||
- "foo"
|
||||
- "foo"
|
||||
- "skipping: [testhost]"
|
||||
- "foo"
|
||||
- ""
|
||||
- "PLAY RECAP *********************************************************************"
|
||||
- "testhost : ok=2 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 "
|
||||
- ""
|
||||
- "foo"
|
||||
|
||||
7
tests/integration/targets/callback_yaml/meta/main.yml
Normal file
7
tests/integration/targets/callback_yaml/meta/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
dependencies:
|
||||
- setup_remote_tmp_dir
|
||||
@@ -8,6 +8,11 @@
|
||||
# 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
|
||||
|
||||
- name: Write vault password to disk
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ remote_tmp_dir }}/vault-password"
|
||||
content: asdf
|
||||
|
||||
- name: Run tests
|
||||
include_role:
|
||||
name: callback
|
||||
@@ -97,3 +102,43 @@
|
||||
"PLAY RECAP *********************************************************************",
|
||||
"testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
]
|
||||
- name: Some more fun with data tagging
|
||||
environment:
|
||||
ANSIBLE_NOCOLOR: 'true'
|
||||
ANSIBLE_FORCE_COLOR: 'false'
|
||||
ANSIBLE_STDOUT_CALLBACK: community.general.yaml
|
||||
extra_cli_arguments: "--vault-password-file {{ remote_tmp_dir }}/vault-password"
|
||||
playbook: !unsafe |
|
||||
- hosts: testhost
|
||||
gather_facts: false
|
||||
vars:
|
||||
foo: bar
|
||||
baz: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
30393064316433636636373336363538663034643135363938646665393661353833633865313765
|
||||
3835366434646339313337663335393865336163663434310a316161313662666466333332353731
|
||||
64663064366461643162666137303737643164376134303034306366383830336232363837636638
|
||||
3830653338626130360a313639623231353931356563313065373661303262646337383534663932
|
||||
64353461663065333362346264326335373032313333343539646661656634653138646332313639
|
||||
3566313765626464613734623664663266336237646139373935
|
||||
tasks:
|
||||
- name: Test regular string
|
||||
debug:
|
||||
var: foo
|
||||
- name: Test vaulted string
|
||||
debug:
|
||||
var: baz
|
||||
expected_output:
|
||||
- ""
|
||||
- "PLAY [testhost] ****************************************************************"
|
||||
- ""
|
||||
- "TASK [Test regular string] *****************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " foo: bar"
|
||||
- ""
|
||||
- "TASK [Test vaulted string] *****************************************************"
|
||||
- "ok: [testhost] => "
|
||||
- " baz: aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"
|
||||
- ""
|
||||
- "PLAY RECAP *********************************************************************"
|
||||
- "testhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||
|
||||
@@ -260,3 +260,5 @@ cmd_echo_tests:
|
||||
assertions:
|
||||
- >
|
||||
"No such file or directory" in test_result.msg
|
||||
or
|
||||
"Error executing command." == test_result.msg
|
||||
|
||||
@@ -7,3 +7,5 @@ needs/root
|
||||
skip/macos
|
||||
skip/osx
|
||||
skip/freebsd
|
||||
skip/rhel10.0 # FIXME
|
||||
disabled # FIXME - https://github.com/ansible-collections/community.general/issues/10987
|
||||
|
||||
@@ -20,3 +20,4 @@ skip/rhel9.2
|
||||
skip/rhel9.3
|
||||
skip/rhel9.4
|
||||
skip/rhel9.5
|
||||
skip/rhel10.0
|
||||
|
||||
@@ -20,3 +20,4 @@ skip/rhel9.2
|
||||
skip/rhel9.3
|
||||
skip/rhel9.4
|
||||
skip/rhel9.5
|
||||
skip/rhel10.0
|
||||
|
||||
@@ -11,4 +11,23 @@
|
||||
- name: Test json_query filter
|
||||
assert:
|
||||
that:
|
||||
- "users | community.general.json_query('[*].hosts[].host') == ['host_a', 'host_b', 'host_c', 'host_d']"
|
||||
- >-
|
||||
users | community.general.json_query('[*].hosts[].host') == ['host_a', 'host_b', 'host_c', 'host_d']
|
||||
- >-
|
||||
ports | json_query("[?contains(ports, `22`)]") == [ports[0]]
|
||||
- >-
|
||||
ports | json_query("[?contains(rule_desc, `ssh`)]") == [ports[0]]
|
||||
- >-
|
||||
my_complex_data | json_query('users[?id==`1`]') == [my_complex_data['users'][0]]
|
||||
vars:
|
||||
my_complex_data:
|
||||
users:
|
||||
- id: 1
|
||||
name: Alice
|
||||
roles: ["admin", "dev"]
|
||||
status: active
|
||||
ports:
|
||||
- ports: [22]
|
||||
rule_desc: "ssh"
|
||||
- ports: [80]
|
||||
rule_desc: "http"
|
||||
|
||||
@@ -13,3 +13,4 @@ skip/rhel9.2 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/
|
||||
skip/rhel9.3 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/
|
||||
skip/rhel9.4 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/
|
||||
skip/rhel9.5 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/
|
||||
skip/rhel10.0 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/
|
||||
|
||||
@@ -12,3 +12,4 @@ skip/macos # no iptables/netfilter (Linux specific)
|
||||
skip/aix # no iptables/netfilter (Linux specific)
|
||||
|
||||
skip/ubuntu22.04 # TODO there's a problem here!
|
||||
skip/rhel10.0 # TODO there's a problem here!
|
||||
|
||||
@@ -13,6 +13,7 @@ skip/rhel9.2 # FIXME
|
||||
skip/rhel9.3 # FIXME
|
||||
skip/rhel9.4 # FIXME
|
||||
skip/rhel9.5 # FIXME
|
||||
skip/rhel10.0 # FIXME
|
||||
skip/freebsd12.4 # FIXME
|
||||
skip/freebsd13.2 # FIXME
|
||||
skip/freebsd13.3 # FIXME
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
- name: Assert that the schema output is correct
|
||||
assert:
|
||||
that:
|
||||
- output is not failed
|
||||
- output.results | length >= 1
|
||||
- "{{ 'displayName' in output.results.0.attrs }}"
|
||||
- output is not failed
|
||||
- output.results | length >= 1
|
||||
- >-
|
||||
'displayName' in output.results.0.attrs
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
azp/posix/2
|
||||
destructive
|
||||
skip/aix
|
||||
disabled # TODO: currently broken
|
||||
|
||||
@@ -11,11 +11,18 @@
|
||||
attr2_depr_dict_dt:
|
||||
msg: Attribute attr2 is deprecated
|
||||
version: 9.9.9
|
||||
plugin:
|
||||
requested_name: msimpleda
|
||||
resolved_name: msimpleda
|
||||
type: module
|
||||
collection_name: null # should be "community.general"; this will hopefully change back because this seriously sucks
|
||||
collection_name: community.general
|
||||
deprecator:
|
||||
resolved_name: community.general
|
||||
type: collection
|
||||
# Latest version:
|
||||
attr2_depr_dict_dt2:
|
||||
msg: Attribute attr2 is deprecated
|
||||
version: 9.9.9
|
||||
collection_name: community.general
|
||||
deprecator:
|
||||
resolved_name: community.general
|
||||
type: ~
|
||||
|
||||
- name: test msimpleda 1
|
||||
msimpleda:
|
||||
@@ -27,7 +34,12 @@
|
||||
that:
|
||||
- simple1.a == 1
|
||||
- simple1.attr1 == "abc"
|
||||
- ("deprecations" not in simple1) or (attr2_depr_dict not in simple1.deprecations and attr2_depr_dict_dt not in simple1.deprecations)
|
||||
- >-
|
||||
("deprecations" not in simple1) or (
|
||||
attr2_depr_dict not in simple1.deprecations and
|
||||
attr2_depr_dict_dt not in simple1.deprecations and
|
||||
attr2_depr_dict_dt2 not in simple1.deprecations
|
||||
)
|
||||
|
||||
- name: test msimpleda 2
|
||||
msimpleda:
|
||||
@@ -44,4 +56,7 @@
|
||||
- simple2.a == 2
|
||||
- simple2.attr2 == "def"
|
||||
- '"deprecations" in simple2'
|
||||
- attr2_depr_dict in simple2.deprecations or attr2_depr_dict_dt in simple2.deprecations
|
||||
- >-
|
||||
attr2_depr_dict in simple2.deprecations or
|
||||
attr2_depr_dict_dt in simple2.deprecations or
|
||||
attr2_depr_dict_dt2 in simple2.deprecations
|
||||
|
||||
@@ -13,4 +13,5 @@ skip/rhel9.2
|
||||
skip/rhel9.3
|
||||
skip/rhel9.4
|
||||
skip/rhel9.5
|
||||
skip/rhel10.0
|
||||
skip/freebsd
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
- when:
|
||||
- ansible_os_family != 'Archlinux' # TODO install driver from AUR: https://aur.archlinux.org/packages/psqlodbc
|
||||
- ansible_os_family != 'RedHat' or ansible_distribution_major_version != '7' # CentOS 7 stopped working
|
||||
- ansible_os_family != 'Alpine'
|
||||
block:
|
||||
|
||||
#
|
||||
|
||||
@@ -46,9 +46,11 @@
|
||||
become: true
|
||||
become_user: yaybuilder
|
||||
ansible.builtin.git:
|
||||
repo: https://aur.archlinux.org/yay.git
|
||||
dest: "{{ remote_tmp_dir }}/builder/yay"
|
||||
depth: 1
|
||||
dest: "{{ remote_tmp_dir }}/builder/yay"
|
||||
repo: https://github.com/archlinux/aur.git
|
||||
single_branch: true
|
||||
version: yay
|
||||
|
||||
- name: make package
|
||||
become: true
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
extra_args: --user
|
||||
|
||||
##############################################################################
|
||||
- name: ensure application tox is uninstalled
|
||||
- name: ensure applications are uninstalled
|
||||
community.general.pipx:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
name: tox
|
||||
loop:
|
||||
- tox
|
||||
- pylint
|
||||
|
||||
- name: retrieve applications (empty)
|
||||
community.general.pipx_info: {}
|
||||
|
||||
@@ -6,3 +6,32 @@
|
||||
rundeck_url: http://localhost:4440
|
||||
rundeck_api_version: 39
|
||||
rundeck_job_id: 3b8a6e54-69fb-42b7-b98f-f82e59238478
|
||||
|
||||
system_acl_policy: |
|
||||
description: Test ACL
|
||||
context:
|
||||
application: 'rundeck'
|
||||
for:
|
||||
project:
|
||||
- allow:
|
||||
- read
|
||||
by:
|
||||
group:
|
||||
- users
|
||||
|
||||
project_acl_policy: |
|
||||
description: Test project acl
|
||||
for:
|
||||
resource:
|
||||
- equals:
|
||||
kind: node
|
||||
allow: [read,refresh]
|
||||
- equals:
|
||||
kind: event
|
||||
allow: [read]
|
||||
job:
|
||||
- allow: [run,kill]
|
||||
node:
|
||||
- allow: [read,run]
|
||||
by:
|
||||
group: users
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
RD_USER: admin
|
||||
RD_PASSWORD: admin
|
||||
register: rundeck_api_token
|
||||
retries: 3
|
||||
until: rundeck_api_token.rc == 0
|
||||
changed_when: true
|
||||
|
||||
- name: Create a Rundeck project
|
||||
community.general.rundeck_project:
|
||||
@@ -24,6 +27,71 @@
|
||||
token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
state: present
|
||||
|
||||
- name: Create a system ACL
|
||||
community.general.rundeck_acl_policy:
|
||||
name: test_acl
|
||||
api_version: "{{ rundeck_api_version }}"
|
||||
url: "{{ rundeck_url }}"
|
||||
token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
state: present
|
||||
policy: "{{ system_acl_policy }}"
|
||||
|
||||
- name: Create a project ACL
|
||||
community.general.rundeck_acl_policy:
|
||||
name: test_acl
|
||||
api_version: "{{ rundeck_api_version }}"
|
||||
url: "{{ rundeck_url }}"
|
||||
token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
state: present
|
||||
policy: "{{ project_acl_policy }}"
|
||||
project: test_project
|
||||
|
||||
- name: Retrieve ACLs
|
||||
ansible.builtin.uri:
|
||||
url: "{{ rundeck_url }}/api/{{ rundeck_api_version }}/{{ item }}"
|
||||
headers:
|
||||
accept: application/json
|
||||
x-rundeck-auth-token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
register: acl_policy_check
|
||||
loop:
|
||||
- system/acl/test_acl.aclpolicy
|
||||
- project/test_project/acl/test_acl.aclpolicy
|
||||
|
||||
- name: Assert ACL content is correct
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- acl_policy_check['results'][0]['json']['contents'] == system_acl_policy
|
||||
- acl_policy_check['results'][1]['json']['contents'] == project_acl_policy
|
||||
|
||||
- name: Remove system ACL
|
||||
community.general.rundeck_acl_policy:
|
||||
name: test_acl
|
||||
api_version: "{{ rundeck_api_version }}"
|
||||
url: "{{ rundeck_url }}"
|
||||
token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove project ACL
|
||||
community.general.rundeck_acl_policy:
|
||||
name: test_acl
|
||||
api_version: "{{ rundeck_api_version }}"
|
||||
url: "{{ rundeck_url }}"
|
||||
token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
state: absent
|
||||
project: test_project
|
||||
|
||||
- name: Check that ACLs have been removed
|
||||
ansible.builtin.uri:
|
||||
url: "{{ rundeck_url }}/api/{{ rundeck_api_version }}/{{ item }}"
|
||||
headers:
|
||||
accept: application/json
|
||||
x-rundeck-auth-token: "{{ rundeck_api_token.stdout_lines[-1] }}"
|
||||
status_code:
|
||||
- 404
|
||||
loop:
|
||||
- system/acl/test_acl.aclpolicy
|
||||
- project/test_project/acl/test_acl.aclpolicy
|
||||
|
||||
- name: Copy test_job definition to /tmp
|
||||
copy:
|
||||
src: test_job.yaml
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
|
||||
keytool_package_names:
|
||||
- ca-certificates-java
|
||||
- openjdk-11-jre-headless
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
cryptography_package_name: python-cryptography
|
||||
cryptography_package_name_python3: python3-cryptography
|
||||
openssl_package_name: openssl
|
||||
cryptography_from_pip: false
|
||||
@@ -8,7 +8,7 @@ redis_packages:
|
||||
Alpine:
|
||||
- redis
|
||||
Archlinux:
|
||||
- redis
|
||||
- valkey
|
||||
Debian:
|
||||
- redis-server
|
||||
Ubuntu:
|
||||
@@ -24,7 +24,7 @@ redis_packages:
|
||||
|
||||
redis_user:
|
||||
Alpine: redis
|
||||
Archlinux: redis
|
||||
Archlinux: valkey
|
||||
Debian: redis
|
||||
Ubuntu: redis
|
||||
openSUSE Leap: redis
|
||||
|
||||
@@ -3,5 +3,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
|
||||
|
||||
rundeck_war_url: https://packagecloud.io/pagerduty/rundeck/packages/java/org.rundeck/rundeck-3.4.4-20210920.war/artifacts/rundeck-3.4.4-20210920.war/download
|
||||
rundeck_cli_url: https://github.com/rundeck/rundeck-cli/releases/download/v1.3.10/rundeck-cli-1.3.10-all.jar
|
||||
rundeck_version: 5.11.1-20250415
|
||||
rundeck_cli_version: "2.0.8"
|
||||
|
||||
rundeck_war_url:
|
||||
"https://packagecloud.io/pagerduty/rundeck/packages/java/org.rundeck/\
|
||||
rundeck-{{ rundeck_version }}.war/artifacts/rundeck-{{ rundeck_version }}.war/download"
|
||||
|
||||
rundeck_cli_url:
|
||||
"https://github.com/rundeck/rundeck-cli/releases/download/\
|
||||
v{{ rundeck_cli_version }}/rundeck-cli-{{ rundeck_cli_version }}-all.jar"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# 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
|
||||
|
||||
openjdk_pkg: java-1.8.0-openjdk
|
||||
openjdk_pkg: java-11-openjdk-headless
|
||||
|
||||
1
tests/integration/targets/setup_snap/tasks/D-RedHat-10.yml
Symbolic link
1
tests/integration/targets/setup_snap/tasks/D-RedHat-10.yml
Symbolic link
@@ -0,0 +1 @@
|
||||
nothing.yml
|
||||
@@ -6,7 +6,7 @@
|
||||
- name: Install required libs
|
||||
pip:
|
||||
name:
|
||||
- 'paramiko<3.0.0'
|
||||
- paramiko
|
||||
state: present
|
||||
extra_args: "-c {{ remote_constraints }}"
|
||||
|
||||
|
||||
@@ -7,3 +7,4 @@ destructive
|
||||
skip/aix
|
||||
skip/rhel # TODO executables are installed in /usr/local/bin, which isn't part of $PATH
|
||||
skip/macos # TODO executables are installed in /Library/Frameworks/Python.framework/Versions/3.11/bin, which isn't part of $PATH
|
||||
unstable # TODO fix!
|
||||
|
||||
@@ -141,12 +141,12 @@
|
||||
#
|
||||
# NOTE: currently fails with FreeBSD 12 with minor version less than 4
|
||||
# NOTE: currently fails with FreeBSD 13 with minor version less than 4
|
||||
# NOTE: currently fails with FreeBSD 14 with minor version less than 1
|
||||
# NOTE: currently fails with FreeBSD 14 with minor version less than 2
|
||||
#
|
||||
when: >-
|
||||
ansible_distribution_version is version('12.4', '>=') and ansible_distribution_version is version('13', '<')
|
||||
or ansible_distribution_version is version('13.4', '>=') and ansible_distribution_version is version('14', '<')
|
||||
or ansible_distribution_version is version('14.1', '>=')
|
||||
or ansible_distribution_version is version('14.2', '>=')
|
||||
block:
|
||||
- name: Setup testjail
|
||||
include_tasks: setup-testjail.yml
|
||||
@@ -333,7 +333,44 @@
|
||||
- not sysrc_value_absent_idempotent.changed
|
||||
- "'sysrc_delim=\"t1,t2\"' in sysrc_delim_content.stdout_lines"
|
||||
- "'sysrc_delim_delete' not in sysrc_delim_content.stdout_lines"
|
||||
|
||||
##
|
||||
## sysrc - value contains equals sign
|
||||
##
|
||||
- name: Value contains equals sign
|
||||
vars:
|
||||
value_1: "-u spamd -x --allow-tell --max-spare=1 --listen=*"
|
||||
value_2: "-u spamd -x --allow-tell --max-spare=1 --listen=localhost"
|
||||
block:
|
||||
|
||||
- name: Add spamd_flags
|
||||
sysrc:
|
||||
name: spamd_flags
|
||||
value: "{{ value_1 }}"
|
||||
register: sysrc_equals_sign_1
|
||||
|
||||
- name: Change spamd_flags
|
||||
sysrc:
|
||||
name: spamd_flags
|
||||
value: "{{ value_2 }}"
|
||||
register: sysrc_equals_sign_2
|
||||
|
||||
- name: Get file content
|
||||
command: sysrc -a
|
||||
register: sysrc_content
|
||||
|
||||
- name: Ensure sysrc did as intended with values that contains equals sign
|
||||
vars:
|
||||
conf: "{{ sysrc_content.stdout | from_yaml }}"
|
||||
assert:
|
||||
that:
|
||||
- "value_1 == sysrc_equals_sign_1.value"
|
||||
- sysrc_equals_sign_2.changed
|
||||
- "value_2 == sysrc_equals_sign_2.value"
|
||||
- "value_2 == conf.spamd_flags"
|
||||
|
||||
always:
|
||||
|
||||
- name: Restore /etc/rc.conf
|
||||
copy:
|
||||
content: "{{ cached_etc_rcconf_content }}"
|
||||
|
||||
@@ -15,6 +15,7 @@ skip/rhel9.2 # FIXME
|
||||
skip/rhel9.3 # FIXME
|
||||
skip/rhel9.4 # FIXME
|
||||
skip/rhel9.5 # FIXME
|
||||
skip/rhel10.0 # FIXME
|
||||
skip/docker
|
||||
needs/root
|
||||
needs/target/setup_epel
|
||||
|
||||
@@ -117,14 +117,14 @@ class TestLXCConnectionClass():
|
||||
|
||||
# first call initializes the connection
|
||||
conn._connect()
|
||||
assert conn.container_name is container1_name
|
||||
assert conn.container_name == container1_name
|
||||
assert conn.container is not None
|
||||
assert conn.container.name == container1_name
|
||||
container1 = conn.container
|
||||
|
||||
# second call is basically a no-op
|
||||
conn._connect()
|
||||
assert conn.container_name is container1_name
|
||||
assert conn.container_name == container1_name
|
||||
assert conn.container is container1
|
||||
assert conn.container.name == container1_name
|
||||
|
||||
|
||||
@@ -9,10 +9,9 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible.template import Templar
|
||||
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.unittest import TestCase
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
)
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.utils.trust import make_trusted
|
||||
|
||||
from ansible.plugins.loader import lookup_loader
|
||||
@@ -20,8 +19,7 @@ from ansible.plugins.loader import lookup_loader
|
||||
|
||||
class TestLookupModule(TestCase):
|
||||
def setUp(self):
|
||||
templar = MagicMock()
|
||||
templar._loader = None
|
||||
templar = Templar(loader=None)
|
||||
self.lookup = lookup_loader.get("community.general.dependent", templar=templar)
|
||||
|
||||
def test_empty(self):
|
||||
|
||||
156
tests/unit/plugins/modules/test_rundeck_acl_policy.py
Normal file
156
tests/unit/plugins/modules/test_rundeck_acl_policy.py
Normal file
@@ -0,0 +1,156 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# 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
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
from ansible_collections.community.general.plugins.modules import rundeck_acl_policy
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import (
|
||||
set_module_args,
|
||||
AnsibleExitJson,
|
||||
exit_json,
|
||||
fail_json
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def module():
|
||||
with patch.multiple(
|
||||
"ansible.module_utils.basic.AnsibleModule",
|
||||
exit_json=exit_json,
|
||||
fail_json=fail_json,
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
# define our two table entries: system ACL vs. project ACL
|
||||
PROJECT_TABLE = [
|
||||
(None, "system/acl"),
|
||||
("test_project", "project/test_project/acl"),
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project, prefix", PROJECT_TABLE)
|
||||
@patch.object(rundeck_acl_policy, 'api_request')
|
||||
def test_acl_create(api_request_mock, project, prefix):
|
||||
"""Test creating a new ACL, both system-level and project-level."""
|
||||
name = "my_policy"
|
||||
policy = "test_policy_yaml"
|
||||
# simulate: GET→404, POST→201, final GET→200
|
||||
api_request_mock.side_effect = [
|
||||
(None, {'status': 404}),
|
||||
(None, {'status': 201}),
|
||||
({"contents": policy}, {'status': 200}),
|
||||
]
|
||||
args = {
|
||||
'name': name,
|
||||
'url': "https://rundeck.example.org",
|
||||
'api_token': "mytoken",
|
||||
'policy': policy,
|
||||
}
|
||||
if project:
|
||||
args['project'] = project
|
||||
|
||||
with pytest.raises(AnsibleExitJson):
|
||||
with set_module_args(args):
|
||||
rundeck_acl_policy.main()
|
||||
|
||||
# should have done GET → POST → GET
|
||||
assert api_request_mock.call_count == 3
|
||||
args, kwargs = api_request_mock.call_args_list[1]
|
||||
assert kwargs['endpoint'] == "%s/%s.aclpolicy" % (prefix, name)
|
||||
assert kwargs['method'] == 'POST'
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project, prefix", PROJECT_TABLE)
|
||||
@patch.object(rundeck_acl_policy, 'api_request')
|
||||
def test_acl_unchanged(api_request_mock, project, prefix):
|
||||
"""Test no-op when existing ACL contents match the desired policy."""
|
||||
name = "unchanged_policy"
|
||||
policy = "same_policy_yaml"
|
||||
# first GET returns matching contents
|
||||
api_request_mock.return_value = ({"contents": policy}, {'status': 200})
|
||||
|
||||
args = {
|
||||
'name': name,
|
||||
'url': "https://rundeck.example.org",
|
||||
'api_token': "mytoken",
|
||||
'policy': policy,
|
||||
}
|
||||
if project:
|
||||
args['project'] = project
|
||||
|
||||
with pytest.raises(AnsibleExitJson):
|
||||
with set_module_args(args):
|
||||
rundeck_acl_policy.main()
|
||||
|
||||
# only a single GET
|
||||
assert api_request_mock.call_count == 1
|
||||
args, kwargs = api_request_mock.call_args
|
||||
assert kwargs['endpoint'] == "%s/%s.aclpolicy" % (prefix, name)
|
||||
# default method is GET
|
||||
assert kwargs.get('method', 'GET') == 'GET'
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project, prefix", PROJECT_TABLE)
|
||||
@patch.object(rundeck_acl_policy, 'api_request')
|
||||
def test_acl_remove(api_request_mock, project, prefix):
|
||||
"""Test removing an existing ACL, both system- and project-level."""
|
||||
name = "remove_me"
|
||||
# GET finds it, DELETE removes it
|
||||
api_request_mock.side_effect = [
|
||||
({"contents": "old_yaml"}, {'status': 200}),
|
||||
(None, {'status': 204}),
|
||||
]
|
||||
|
||||
args = {
|
||||
'name': name,
|
||||
'url': "https://rundeck.example.org",
|
||||
'api_token': "mytoken",
|
||||
'state': 'absent',
|
||||
}
|
||||
if project:
|
||||
args['project'] = project
|
||||
|
||||
with pytest.raises(AnsibleExitJson):
|
||||
with set_module_args(args):
|
||||
rundeck_acl_policy.main()
|
||||
|
||||
# GET → DELETE
|
||||
assert api_request_mock.call_count == 2
|
||||
args, kwargs = api_request_mock.call_args_list[1]
|
||||
assert kwargs['endpoint'] == "%s/%s.aclpolicy" % (prefix, name)
|
||||
assert kwargs['method'] == 'DELETE'
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project, prefix", PROJECT_TABLE)
|
||||
@patch.object(rundeck_acl_policy, 'api_request')
|
||||
def test_acl_remove_nonexistent(api_request_mock, project, prefix):
|
||||
"""Test removing a non-existent ACL results in no change."""
|
||||
name = "not_there"
|
||||
# GET returns 404
|
||||
api_request_mock.return_value = (None, {'status': 404})
|
||||
|
||||
args = {
|
||||
'name': name,
|
||||
'url': "https://rundeck.example.org",
|
||||
'api_token': "mytoken",
|
||||
'state': 'absent',
|
||||
}
|
||||
if project:
|
||||
args['project'] = project
|
||||
|
||||
with pytest.raises(AnsibleExitJson):
|
||||
with set_module_args(args):
|
||||
rundeck_acl_policy.main()
|
||||
|
||||
# only the initial GET
|
||||
assert api_request_mock.call_count == 1
|
||||
args, kwargs = api_request_mock.call_args
|
||||
assert kwargs['endpoint'] == "%s/%s.aclpolicy" % (prefix, name)
|
||||
assert kwargs.get('method', 'GET') == 'GET'
|
||||
@@ -1 +0,0 @@
|
||||
remote.sh
|
||||
@@ -1 +0,0 @@
|
||||
remote.sh
|
||||
@@ -1 +0,0 @@
|
||||
remote.sh
|
||||
@@ -1 +0,0 @@
|
||||
remote.sh
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/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
|
||||
|
||||
set -o pipefail -eux
|
||||
|
||||
declare -a args
|
||||
IFS='/:' read -ra args <<< "$1"
|
||||
|
||||
python="${args[1]}"
|
||||
group="${args[2]}"
|
||||
|
||||
target="azp/generic/${group}/"
|
||||
|
||||
stage="${S:-prod}"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
|
||||
--remote-terminate always --remote-stage "${stage}" \
|
||||
--docker --python "${python}"
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/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
|
||||
|
||||
set -o pipefail -eux
|
||||
|
||||
declare -a args
|
||||
IFS='/:' read -ra args <<< "$1"
|
||||
|
||||
image="${args[1]}"
|
||||
python="${args[2]}"
|
||||
|
||||
if [ "${#args[@]}" -gt 3 ]; then
|
||||
target="azp/posix/${args[3]}/"
|
||||
else
|
||||
target="azp/posix/"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
|
||||
--docker "quay.io/ansible-community/test-image:${image}" --python "${python}"
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/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
|
||||
|
||||
set -o pipefail -eux
|
||||
|
||||
declare -a args
|
||||
IFS='/:' read -ra args <<< "$1"
|
||||
|
||||
image="${args[1]}"
|
||||
|
||||
if [ "${#args[@]}" -gt 2 ]; then
|
||||
target="azp/posix/${args[2]}/"
|
||||
else
|
||||
target="azp/posix/"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
|
||||
--docker "${image}"
|
||||
@@ -1 +0,0 @@
|
||||
remote.sh
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user