mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-29 01:46:53 +00:00
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
961f487f5c | ||
|
|
002f9de93f | ||
|
|
c0820bbcb3 | ||
|
|
ecd984be2a | ||
|
|
21dde52d1f | ||
|
|
d94ec28b57 | ||
|
|
3e6c47a7a5 | ||
|
|
0814be718e | ||
|
|
bbaeb5e5be | ||
|
|
75d05206dc | ||
|
|
df635c484e | ||
|
|
1b5d4d7cc1 | ||
|
|
e824cbc6db | ||
|
|
f738042786 | ||
|
|
d19b867d9a | ||
|
|
472c4670d5 | ||
|
|
69b7f68379 | ||
|
|
de8274c360 | ||
|
|
e1a96ba654 | ||
|
|
0c0a49caae | ||
|
|
6cd996ce3c | ||
|
|
0d010e8841 | ||
|
|
ebd4c4146e | ||
|
|
43269c9255 | ||
|
|
847f8b9e21 | ||
|
|
2241db8a74 | ||
|
|
bed6520d27 | ||
|
|
08c3bbe201 | ||
|
|
de58d446f2 | ||
|
|
9e19286a9f | ||
|
|
f4d16549de | ||
|
|
a3c597425d | ||
|
|
56bbbca2ce | ||
|
|
dce582c64c | ||
|
|
ecca4cedea | ||
|
|
dc69b40681 | ||
|
|
1553b77a1d | ||
|
|
c7c39e598d | ||
|
|
c364e66114 | ||
|
|
31d62c5947 | ||
|
|
e4212472e2 | ||
|
|
0ff27c3b44 | ||
|
|
baf23f3ae2 | ||
|
|
c9c535178f | ||
|
|
86ff3eb02e | ||
|
|
2cec7a1779 | ||
|
|
bcebeddb83 | ||
|
|
745da8e325 | ||
|
|
b610b654cc | ||
|
|
6fdeca5709 | ||
|
|
e9900f9a8e | ||
|
|
b475239b4f | ||
|
|
a2f635449b | ||
|
|
44de6b09a7 | ||
|
|
c7eed0f32c | ||
|
|
000b3cee58 | ||
|
|
ba30fc63b7 | ||
|
|
afddbaa857 | ||
|
|
ad9b4ac781 | ||
|
|
0b98534df1 | ||
|
|
da0738badf | ||
|
|
3735ee6df7 | ||
|
|
de602a9b93 | ||
|
|
c64ab70c75 | ||
|
|
bea5a6266c | ||
|
|
a354dd463f | ||
|
|
2414011428 | ||
|
|
5b4bce3f88 | ||
|
|
f21b41d3aa | ||
|
|
01e995abf2 | ||
|
|
760b1e2cad | ||
|
|
276fb08503 | ||
|
|
2d2bbb8fe3 | ||
|
|
f2b71f7874 | ||
|
|
9c36a23a2d | ||
|
|
bc02dc4c44 | ||
|
|
d85908da6e |
@@ -1,3 +0,0 @@
|
||||
## Azure Pipelines Configuration
|
||||
|
||||
Please see the [Documentation](https://github.com/ansible/community/wiki/Testing:-Azure-Pipelines) for more information.
|
||||
@@ -1,410 +0,0 @@
|
||||
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-2
|
||||
- stable-3
|
||||
- cron: 0 11 * * 0
|
||||
displayName: Weekly (old stable branches)
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-1
|
||||
|
||||
variables:
|
||||
- name: checkoutPath
|
||||
value: ansible_collections/community/general
|
||||
- name: coverageBranches
|
||||
value: main
|
||||
- name: pipelinesCoverage
|
||||
value: coverage
|
||||
- name: entryPoint
|
||||
value: tests/utils/shippable/shippable.sh
|
||||
- name: fetchDepth
|
||||
value: 0
|
||||
|
||||
resources:
|
||||
containers:
|
||||
- container: default
|
||||
image: quay.io/ansible/azure-pipelines-test-container:1.9.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
|
||||
- test: extra
|
||||
- stage: Sanity_2_11
|
||||
displayName: Sanity 2.11
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.11/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_10
|
||||
displayName: Sanity 2.10
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.10/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_9
|
||||
displayName: Sanity 2.9
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.9/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: 2.6
|
||||
- test: 2.7
|
||||
- test: 3.5
|
||||
- test: 3.6
|
||||
- test: 3.7
|
||||
- test: 3.8
|
||||
- test: 3.9
|
||||
- test: '3.10'
|
||||
- stage: Units_2_11
|
||||
displayName: Units 2.11
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.11/units/{0}/1
|
||||
targets:
|
||||
- test: 2.6
|
||||
- test: 2.7
|
||||
- test: 3.5
|
||||
- test: 3.6
|
||||
- test: 3.7
|
||||
- test: 3.8
|
||||
- test: 3.9
|
||||
- stage: Units_2_10
|
||||
displayName: Units 2.10
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.10/units/{0}/1
|
||||
targets:
|
||||
- test: 2.6
|
||||
- test: 2.7
|
||||
- test: 3.5
|
||||
- test: 3.6
|
||||
- test: 3.7
|
||||
- test: 3.8
|
||||
- test: 3.9
|
||||
- stage: Units_2_9
|
||||
displayName: Units 2.9
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.9/units/{0}/1
|
||||
targets:
|
||||
- test: 2.6
|
||||
- test: 2.7
|
||||
- test: 3.5
|
||||
- test: 3.6
|
||||
- test: 3.7
|
||||
- test: 3.8
|
||||
|
||||
## Remote
|
||||
- stage: Remote_devel
|
||||
displayName: Remote devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/{0}
|
||||
targets:
|
||||
- name: macOS 11.1
|
||||
test: macos/11.1
|
||||
- name: RHEL 7.9
|
||||
test: rhel/7.9
|
||||
- name: RHEL 8.4
|
||||
test: rhel/8.4
|
||||
- name: FreeBSD 12.2
|
||||
test: freebsd/12.2
|
||||
- name: FreeBSD 13.0
|
||||
test: freebsd/13.0
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Remote_2_11
|
||||
displayName: Remote 2.11
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.11/{0}
|
||||
targets:
|
||||
- name: macOS 11.1
|
||||
test: macos/11.1
|
||||
- name: RHEL 7.9
|
||||
test: rhel/7.9
|
||||
- name: RHEL 8.3
|
||||
test: rhel/8.3
|
||||
- name: FreeBSD 12.2
|
||||
test: freebsd/12.2
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- stage: Remote_2_10
|
||||
displayName: Remote 2.10
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.10/{0}
|
||||
targets:
|
||||
- name: OS X 10.11
|
||||
test: osx/10.11
|
||||
- name: macOS 10.15
|
||||
test: macos/10.15
|
||||
- name: macOS 11.1
|
||||
test: macos/11.1
|
||||
- name: RHEL 7.8
|
||||
test: rhel/7.8
|
||||
- name: RHEL 8.2
|
||||
test: rhel/8.2
|
||||
- name: FreeBSD 12.1
|
||||
test: freebsd/12.1
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- stage: Remote_2_9
|
||||
displayName: Remote 2.9
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.9/{0}
|
||||
targets:
|
||||
- name: RHEL 8.2
|
||||
test: rhel/8.2
|
||||
- name: FreeBSD 12.0
|
||||
test: freebsd/12.0
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
|
||||
### Docker
|
||||
- stage: Docker_devel
|
||||
displayName: Docker devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/linux/{0}
|
||||
targets:
|
||||
- name: CentOS 6
|
||||
test: centos6
|
||||
- name: CentOS 7
|
||||
test: centos7
|
||||
- name: CentOS 8
|
||||
test: centos8
|
||||
- name: Fedora 33
|
||||
test: fedora33
|
||||
- name: Fedora 34
|
||||
test: fedora34
|
||||
- name: openSUSE 15 py2
|
||||
test: opensuse15py2
|
||||
- name: openSUSE 15 py3
|
||||
test: opensuse15
|
||||
- name: Ubuntu 18.04
|
||||
test: ubuntu1804
|
||||
- name: Ubuntu 20.04
|
||||
test: ubuntu2004
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_11
|
||||
displayName: Docker 2.11
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.11/linux/{0}
|
||||
targets:
|
||||
- name: CentOS 8
|
||||
test: centos8
|
||||
- name: Fedora 33
|
||||
test: fedora33
|
||||
- name: openSUSE 15 py3
|
||||
test: opensuse15
|
||||
- name: Ubuntu 20.04
|
||||
test: ubuntu2004
|
||||
groups:
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_10
|
||||
displayName: Docker 2.10
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.10/linux/{0}
|
||||
targets:
|
||||
- name: CentOS 8
|
||||
test: centos8
|
||||
- name: Fedora 32
|
||||
test: fedora32
|
||||
- name: openSUSE 15 py3
|
||||
test: opensuse15
|
||||
- name: Ubuntu 16.04
|
||||
test: ubuntu1604
|
||||
groups:
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_9
|
||||
displayName: Docker 2.9
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.9/linux/{0}
|
||||
targets:
|
||||
- name: CentOS 8
|
||||
test: centos8
|
||||
- name: Fedora 31
|
||||
test: fedora31
|
||||
- name: openSUSE 15 py3
|
||||
test: opensuse15
|
||||
groups:
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Cloud
|
||||
- stage: Cloud_devel
|
||||
displayName: Cloud devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: devel/cloud/{0}/1
|
||||
targets:
|
||||
- test: 3.8
|
||||
- stage: Cloud_2_11
|
||||
displayName: Cloud 2.11
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.11/cloud/{0}/1
|
||||
targets:
|
||||
- test: 2.7
|
||||
- test: 3.6
|
||||
- stage: Cloud_2_10
|
||||
displayName: Cloud 2.10
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.10/cloud/{0}/1
|
||||
targets:
|
||||
- test: 3.6
|
||||
- stage: Cloud_2_9
|
||||
displayName: Cloud 2.9
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.9/cloud/{0}/1
|
||||
targets:
|
||||
- test: 3.6
|
||||
- stage: Summary
|
||||
condition: succeededOrFailed()
|
||||
dependsOn:
|
||||
- Sanity_devel
|
||||
- Sanity_2_9
|
||||
- Sanity_2_10
|
||||
- Sanity_2_11
|
||||
- Units_devel
|
||||
- Units_2_9
|
||||
- Units_2_10
|
||||
- Units_2_11
|
||||
- Remote_devel
|
||||
- Remote_2_9
|
||||
- Remote_2_10
|
||||
- Remote_2_11
|
||||
- Docker_devel
|
||||
- Docker_2_9
|
||||
- Docker_2_10
|
||||
- Docker_2_11
|
||||
- Cloud_devel
|
||||
- Cloud_2_9
|
||||
- Cloud_2_10
|
||||
- Cloud_2_11
|
||||
jobs:
|
||||
- template: templates/coverage.yml
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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 --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,60 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
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,24 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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,27 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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.
|
||||
|
||||
set -o pipefail -eu
|
||||
|
||||
output_path="$1"
|
||||
|
||||
curl --silent --show-error https://ansible-ci-files.s3.us-east-1.amazonaws.com/codecov/codecov.sh > codecov.sh
|
||||
|
||||
for file in "${output_path}"/reports/coverage*.xml; do
|
||||
name="${file}"
|
||||
name="${name##*/}" # remove path
|
||||
name="${name##coverage=}" # remove 'coverage=' prefix if present
|
||||
name="${name%.xml}" # remove '.xml' suffix
|
||||
|
||||
bash codecov.sh \
|
||||
-f "${file}" \
|
||||
-n "${name}" \
|
||||
-X coveragepy \
|
||||
-X gcov \
|
||||
-X fix \
|
||||
-X search \
|
||||
-X xcode \
|
||||
|| echo "Failed to upload code coverage report to codecov.io: ${file}"
|
||||
done
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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 --stub --venv --venv-system-site-packages --color -v
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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,25 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""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,39 +0,0 @@
|
||||
# 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)
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
# Azure Pipelines only accepts a single coverage data file.
|
||||
# That means only Python or PowerShell coverage can be uploaded, but not both.
|
||||
# Set the "pipelinesCoverage" variable to determine which type is uploaded.
|
||||
# Use "coverage" for Python and "coverage-powershell" for PowerShell.
|
||||
summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml"
|
||||
displayName: Publish to Azure Pipelines
|
||||
condition: gt(variables.coverageFileCount, 0)
|
||||
- bash: .azure-pipelines/scripts/publish-codecov.sh "$(outputPath)"
|
||||
displayName: Publish to codecov.io
|
||||
condition: gt(variables.coverageFileCount, 0)
|
||||
continueOnError: true
|
||||
@@ -1,55 +0,0 @@
|
||||
# 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,45 +0,0 @@
|
||||
# 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)"
|
||||
9
.github/BOTMETA.yml
vendored
9
.github/BOTMETA.yml
vendored
@@ -1,7 +1,8 @@
|
||||
notifications: true
|
||||
automerge: true
|
||||
files:
|
||||
plugins/:
|
||||
supershipit: quidame Ajpantuso
|
||||
supershipit: quidame
|
||||
changelogs/fragments/:
|
||||
support: community
|
||||
$actions:
|
||||
@@ -957,11 +958,13 @@ files:
|
||||
$modules/web_infrastructure/apache2_mod_proxy.py:
|
||||
maintainers: oboukili
|
||||
$modules/web_infrastructure/apache2_module.py:
|
||||
maintainers: berendt n0trax robinro
|
||||
maintainers: berendt n0trax
|
||||
ignore: robinro
|
||||
$modules/web_infrastructure/deploy_helper.py:
|
||||
maintainers: ramondelafuente
|
||||
$modules/web_infrastructure/django_manage.py:
|
||||
maintainers: scottanderson42 russoz tastychutney
|
||||
maintainers: russoz
|
||||
ignore: scottanderson42 tastychutney
|
||||
labels: django_manage
|
||||
$modules/web_infrastructure/ejabberd_user.py:
|
||||
maintainers: privateip
|
||||
|
||||
49
.github/workflows/codeql-analysis.yml
vendored
49
.github/workflows/codeql-analysis.yml
vendored
@@ -1,49 +0,0 @@
|
||||
name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '26 19 * * 1'
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
# languages: go, javascript, csharp, python, cpp, java
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
@@ -6,6 +6,95 @@ Community General Release Notes
|
||||
|
||||
This changelog describes changes after version 1.0.0.
|
||||
|
||||
v2.5.9
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Final maintenance release of community.general major version 2.
|
||||
|
||||
|
||||
Major Changes
|
||||
-------------
|
||||
|
||||
- The community.general 2.x.y release stream is now effectively **End of Life**. No more releases will be made, and regular CI runs will stop.
|
||||
|
||||
v2.5.8
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Announcement release.
|
||||
|
||||
Major Changes
|
||||
-------------
|
||||
|
||||
- The community.general 2.x.y release stream will be **End of Life** on 2022-05-23, which coincides with the latest day that community.general 5.0.0 must be released (see `the Roadmap for Ansible 6 <https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/COLLECTIONS_6.rst#release-schedule>`_). At this point, community.general 2.0.0 has been released almost 1.5 years ago. It received new features for half a year, bugfixes for another half a year, and has only been receiving major bugfixes or security fixes until then. Please note that we `recently decided to shorten this last period from one year to roughly six months <https://github.com/ansible-community/community-topics/issues/55>`_. Thank you very much to everyone who contributed to the 2.x.y releases!
|
||||
|
||||
v2.5.7
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release. Please note that this is the last regular bugfix release, from now on only security fixes and major bugfixes will be accepted for the ``stable-2`` branch.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- gitlab_deploy_key - fix idempotency on projects with multiple deploy keys (https://github.com/ansible-collections/community.general/pull/3473).
|
||||
- gitlab_group_members - ``get_group_id`` return the group ID by matching ``full_path``, ``path`` or ``name`` (https://github.com/ansible-collections/community.general/pull/3400).
|
||||
- gitlab_project_members - ``get_project_id`` return the project id by matching ``full_path`` or ``name`` (https://github.com/ansible-collections/community.general/pull/3602).
|
||||
- ipa_* modules - fix environment fallback for ``ipa_host`` option (https://github.com/ansible-collections/community.general/issues/3560).
|
||||
- jboss - fix the deployment file permission issue when Jboss server is running under non-root user. The deployment file is copied with file content only. The file permission is set to ``440`` and belongs to root user. When the JBoss ``WildFly`` server is running under non-root user, it is unable to read the deployment file (https://github.com/ansible-collections/community.general/pull/3426).
|
||||
- logstash callback plugin - replace ``_option`` with ``context.CLIARGS`` to fix the plugin on ansible-base and ansible-core (https://github.com/ansible-collections/community.general/issues/2692).
|
||||
- proxmox_group_info - fix module crash if a ``group`` parameter is used (https://github.com/ansible-collections/community.general/pull/3649).
|
||||
- redfish_utils module utils - if a manager network property is not specified in the service, attempt to change the requested settings (https://github.com/ansible-collections/community.general/issues/3404/).
|
||||
- xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError`` due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673).
|
||||
- yaml callback plugin - avoid modifying PyYAML so that other plugins using it on the controller, like the ``to_yaml`` filter, do not produce different output (https://github.com/ansible-collections/community.general/issues/3471, https://github.com/ansible-collections/community.general/pull/3478).
|
||||
|
||||
v2.5.6
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- pamd - minor refactorings (https://github.com/ansible-collections/community.general/pull/3285).
|
||||
- vdo - minor refactoring of the code (https://github.com/ansible-collections/community.general/pull/3191).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- copr - fix chroot naming issues, ``centos-stream`` changed naming to ``centos-stream-<number>`` (for exmaple ``centos-stream-8``) (https://github.com/ansible-collections/community.general/issues/2084, https://github.com/ansible-collections/community.general/pull/3237).
|
||||
- launchd - use private attribute to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- logdns callback plugin - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- maven_artifact - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- memcached cache plugin - change function argument names to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- netapp module utils - remove always-true conditional to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- nmcli - added ip4/ip6 configuration arguments for ``sit`` and ``ipip`` tunnels (https://github.com/ansible-collections/community.general/issues/3238, https://github.com/ansible-collections/community.general/pull/3239).
|
||||
- one_template - change function argument name to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- online inventory plugin - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- online module utils - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- openbsd_pkg - fix crash from ``KeyError`` exception when package installs, but ``pkg_add`` returns with a non-zero exit code (https://github.com/ansible-collections/community.general/pull/3336).
|
||||
- packet_device - use generator to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- packet_sshkey - use generator to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- pamd - code for ``state=updated`` when dealing with the pam module arguments, made no distinction between ``None`` and an empty list (https://github.com/ansible-collections/community.general/issues/3260).
|
||||
- proxmox_kvm - clone operation should return the VMID of the target VM and not that of the source VM. This was failing when the target VM with the chosen name already existed (https://github.com/ansible-collections/community.general/pull/3266).
|
||||
- saltstack connection plugin - fix function signature (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- scaleway inventory script - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3195).
|
||||
- scaleway module utils - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- udm_dns_record - fixed managing of PTR records, which can never have worked before (https://github.com/ansible-collections/community.general/pull/3256).
|
||||
- ufw - use generator to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- vbox inventory script - change function argument name to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3195).
|
||||
- vdo - boolean arguments now compared with proper ``true`` and ``false`` values instead of string representations like ``"yes"`` or ``"no"`` (https://github.com/ansible-collections/community.general/pull/3191).
|
||||
|
||||
v2.5.5
|
||||
======
|
||||
|
||||
@@ -469,7 +558,7 @@ Deprecated Features
|
||||
- puppet - deprecated undocumented parameter ``show_diff``, will be removed in 7.0.0. (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).
|
||||
- slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- urmpi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- urpmi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- xbps - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
|
||||
Bugfixes
|
||||
|
||||
33
README.md
33
README.md
@@ -17,7 +17,7 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https:
|
||||
|
||||
## Tested with Ansible
|
||||
|
||||
Tested with the current Ansible 2.9, ansible-base 2.10 and ansible-core 2.11 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported.
|
||||
Tested with the current Ansible 2.9, ansible-base 2.10, ansible-core 2.11 and ansible-core 2.12 releases. Ansible versions before 2.9.10 are not supported.
|
||||
|
||||
## External requirements
|
||||
|
||||
@@ -76,7 +76,21 @@ Also for some notes specific to this collection see [our CONTRIBUTING documentat
|
||||
|
||||
See [here](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#testing-collections).
|
||||
|
||||
### Communication
|
||||
## Collection maintenance
|
||||
|
||||
To learn how to maintain / become a maintainer of this collection, refer to:
|
||||
|
||||
* [Committer guidelines](https://github.com/ansible-collections/community.general/blob/main/commit-rights.md).
|
||||
* [Maintainer guidelines](https://github.com/ansible/community-docs/blob/main/maintaining.rst).
|
||||
|
||||
It is necessary for maintainers of this collection to be subscribed to:
|
||||
|
||||
* The collection itself (the `Watch` button → `All Activity` in the upper right corner of the repository's homepage).
|
||||
* The "Changes Impacting Collection Contributors and Maintainers" [issue](https://github.com/ansible-collections/overview/issues/45).
|
||||
|
||||
They also should be subscribed to Ansible's [The Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn).
|
||||
|
||||
## Communication
|
||||
|
||||
We announce important development changes and releases through Ansible's [The Bullhorn newsletter](https://eepurl.com/gZmiEP). If you are a collection developer, be sure you are subscribed.
|
||||
|
||||
@@ -86,16 +100,11 @@ We take part in the global quarterly [Ansible Contributor Summit](https://github
|
||||
|
||||
For more information about communities, meetings and agendas see [Community Wiki](https://github.com/ansible/community/wiki/Community).
|
||||
|
||||
For more information about communication, refer to the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
|
||||
For more information about communication, refer to Ansible's the [Communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
|
||||
|
||||
### Publishing New Version
|
||||
## Publishing New Version
|
||||
|
||||
Basic instructions without release branches:
|
||||
|
||||
1. Create `changelogs/fragments/<version>.yml` with `release_summary:` section (which must be a string, not a list).
|
||||
2. Run `antsibull-changelog release --collection-flatmap yes`
|
||||
3. Make sure `CHANGELOG.rst` and `changelogs/changelog.yaml` are added to git, and the deleted fragments have been removed.
|
||||
4. Tag the commit with `<version>`. Push changes and tag to the main repository.
|
||||
See the [Releasing guidelines](https://github.com/ansible/community-docs/blob/main/releasing_collections.rst) to learn how to release this collection.
|
||||
|
||||
## Release notes
|
||||
|
||||
@@ -103,10 +112,10 @@ See the [changelog](https://github.com/ansible-collections/community.general/blo
|
||||
|
||||
## Roadmap
|
||||
|
||||
See [this issue](https://github.com/ansible-collections/community.general/issues/582) for information on releasing, versioning and deprecation.
|
||||
|
||||
In general, we plan to release a major version every six months, and minor versions every two months. Major versions can contain breaking changes, while minor versions only contain new features and bugfixes.
|
||||
|
||||
See [this issue](https://github.com/ansible-collections/community.general/issues/582) for information on releasing, versioning, and deprecation.
|
||||
|
||||
## More information
|
||||
|
||||
- [Ansible Collection overview](https://github.com/ansible-collections/overview)
|
||||
|
||||
@@ -1446,7 +1446,7 @@ releases:
|
||||
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).
|
||||
- slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed
|
||||
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- urmpi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``,
|
||||
- urpmi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``,
|
||||
will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- xbps - deprecated invalid parameter alias ``update-cache``, will be removed
|
||||
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
@@ -2105,3 +2105,126 @@ releases:
|
||||
- 3139-tss-lookup-plugin-update-to-make-compatible-with-sdk-v1.yml
|
||||
- 3161-openbsd-pkg-fix-regexp-matching-crash.yml
|
||||
release_date: '2021-08-10'
|
||||
2.5.6:
|
||||
changes:
|
||||
bugfixes:
|
||||
- copr - fix chroot naming issues, ``centos-stream`` changed naming to ``centos-stream-<number>``
|
||||
(for exmaple ``centos-stream-8``) (https://github.com/ansible-collections/community.general/issues/2084,
|
||||
https://github.com/ansible-collections/community.general/pull/3237).
|
||||
- launchd - use private attribute to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- logdns callback plugin - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- maven_artifact - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- memcached cache plugin - change function argument names to fix sanity errors
|
||||
(https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- netapp module utils - remove always-true conditional to fix sanity errors
|
||||
(https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- nmcli - added ip4/ip6 configuration arguments for ``sit`` and ``ipip`` tunnels
|
||||
(https://github.com/ansible-collections/community.general/issues/3238, https://github.com/ansible-collections/community.general/pull/3239).
|
||||
- one_template - change function argument name to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- online inventory plugin - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- online module utils - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- openbsd_pkg - fix crash from ``KeyError`` exception when package installs,
|
||||
but ``pkg_add`` returns with a non-zero exit code (https://github.com/ansible-collections/community.general/pull/3336).
|
||||
- packet_device - use generator to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- packet_sshkey - use generator to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- pamd - code for ``state=updated`` when dealing with the pam module arguments,
|
||||
made no distinction between ``None`` and an empty list (https://github.com/ansible-collections/community.general/issues/3260).
|
||||
- proxmox_kvm - clone operation should return the VMID of the target VM and
|
||||
not that of the source VM. This was failing when the target VM with the chosen
|
||||
name already existed (https://github.com/ansible-collections/community.general/pull/3266).
|
||||
- saltstack connection plugin - fix function signature (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- scaleway inventory script - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3195).
|
||||
- scaleway module utils - improve split call to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- udm_dns_record - fixed managing of PTR records, which can never have worked
|
||||
before (https://github.com/ansible-collections/community.general/pull/3256).
|
||||
- ufw - use generator to fix sanity errors (https://github.com/ansible-collections/community.general/pull/3194).
|
||||
- vbox inventory script - change function argument name to fix sanity errors
|
||||
(https://github.com/ansible-collections/community.general/pull/3195).
|
||||
- vdo - boolean arguments now compared with proper ``true`` and ``false`` values
|
||||
instead of string representations like ``"yes"`` or ``"no"`` (https://github.com/ansible-collections/community.general/pull/3191).
|
||||
minor_changes:
|
||||
- pamd - minor refactorings (https://github.com/ansible-collections/community.general/pull/3285).
|
||||
- vdo - minor refactoring of the code (https://github.com/ansible-collections/community.general/pull/3191).
|
||||
release_summary: Regular bugfix release.
|
||||
fragments:
|
||||
- 2.5.6.yml
|
||||
- 3191-vdo-refactor.yml
|
||||
- 3194-sanity.yml
|
||||
- 3237-copr-fix_chroot_naming.yml
|
||||
- 3239-nmcli-sit-ipip-config-bugfix.yaml
|
||||
- 3256-fix-ptr-handling-in-udm_dns_record.yml
|
||||
- 3266-vmid-existing-target-clone.yml
|
||||
- 3285-pamd-updated-with-empty-args.yaml
|
||||
- 3336-openbsd_pkg-fix-KeyError.yml
|
||||
release_date: '2021-09-21'
|
||||
2.5.7:
|
||||
changes:
|
||||
bugfixes:
|
||||
- gitlab_deploy_key - fix idempotency on projects with multiple deploy keys
|
||||
(https://github.com/ansible-collections/community.general/pull/3473).
|
||||
- gitlab_group_members - ``get_group_id`` return the group ID by matching ``full_path``,
|
||||
``path`` or ``name`` (https://github.com/ansible-collections/community.general/pull/3400).
|
||||
- gitlab_project_members - ``get_project_id`` return the project id by matching
|
||||
``full_path`` or ``name`` (https://github.com/ansible-collections/community.general/pull/3602).
|
||||
- ipa_* modules - fix environment fallback for ``ipa_host`` option (https://github.com/ansible-collections/community.general/issues/3560).
|
||||
- jboss - fix the deployment file permission issue when Jboss server is running
|
||||
under non-root user. The deployment file is copied with file content only.
|
||||
The file permission is set to ``440`` and belongs to root user. When the JBoss
|
||||
``WildFly`` server is running under non-root user, it is unable to read the
|
||||
deployment file (https://github.com/ansible-collections/community.general/pull/3426).
|
||||
- logstash callback plugin - replace ``_option`` with ``context.CLIARGS`` to
|
||||
fix the plugin on ansible-base and ansible-core (https://github.com/ansible-collections/community.general/issues/2692).
|
||||
- proxmox_group_info - fix module crash if a ``group`` parameter is used (https://github.com/ansible-collections/community.general/pull/3649).
|
||||
- redfish_utils module utils - if a manager network property is not specified
|
||||
in the service, attempt to change the requested settings (https://github.com/ansible-collections/community.general/issues/3404/).
|
||||
- xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError``
|
||||
due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673).
|
||||
- yaml callback plugin - avoid modifying PyYAML so that other plugins using
|
||||
it on the controller, like the ``to_yaml`` filter, do not produce different
|
||||
output (https://github.com/ansible-collections/community.general/issues/3471,
|
||||
https://github.com/ansible-collections/community.general/pull/3478).
|
||||
release_summary: Regular bugfix release. Please note that this is the last regular
|
||||
bugfix release, from now on only security fixes and major bugfixes will be
|
||||
accepted for the ``stable-2`` branch.
|
||||
fragments:
|
||||
- 2.5.7.yml
|
||||
- 2692-logstash-callback-plugin-replacing_options.yml
|
||||
- 3400-fix-gitLab-api-searches-always-return-first-found-match-3386.yml
|
||||
- 3404-redfish_utils-skip-manager-network-check.yml
|
||||
- 3426-copy-permissions-along-with-file-for-jboss-module.yml
|
||||
- 3473-gitlab_deploy_key-fix_idempotency.yml
|
||||
- 3478-yaml-callback.yml
|
||||
- 3561-fix-ipa-host-var-detection.yml
|
||||
- 3602-fix-gitlab_project_members-improve-search-method.yml
|
||||
- 3649-proxmox_group_info_TypeError.yml
|
||||
- 3675-xattr-handle-base64-values.yml
|
||||
release_date: '2021-11-09'
|
||||
2.5.8:
|
||||
changes:
|
||||
major_changes:
|
||||
- The community.general 2.x.y release stream will be **End of Life** on 2022-05-23,
|
||||
which coincides with the latest day that community.general 5.0.0 must be released
|
||||
(see `the Roadmap for Ansible 6 <https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/COLLECTIONS_6.rst#release-schedule>`_).
|
||||
At this point, community.general 2.0.0 has been released almost 1.5 years
|
||||
ago. It received new features for half a year, bugfixes for another half a
|
||||
year, and has only been receiving major bugfixes or security fixes until then.
|
||||
Please note that we `recently decided to shorten this last period from one
|
||||
year to roughly six months <https://github.com/ansible-community/community-topics/issues/55>`_.
|
||||
Thank you very much to everyone who contributed to the 2.x.y releases!
|
||||
release_summary: Announcement release.
|
||||
fragments:
|
||||
- 2.5.8.yml
|
||||
- eol.yml
|
||||
release_date: '2022-01-31'
|
||||
2.5.9:
|
||||
changes:
|
||||
major_changes:
|
||||
- The community.general 2.x.y release stream is now effectively **End of Life**.
|
||||
No more releases will be made, and regular CI runs will stop.
|
||||
release_summary: 'Final maintenance release of community.general major version
|
||||
2.
|
||||
|
||||
'
|
||||
fragments:
|
||||
- 2.5.9.yml
|
||||
release_date: '2022-05-16'
|
||||
|
||||
2
changelogs/fragments/simplified-bsd-license.yml
Normal file
2
changelogs/fragments/simplified-bsd-license.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- Include ``simplified_bsd.txt`` license file for various module utils, the ``lxca_common`` docs fragment, and the ``utm_utils`` unit tests.
|
||||
@@ -69,5 +69,6 @@ Individuals who have been asked to become a part of this group have generally be
|
||||
| ------------------- | -------------------- | ------------------ | -------------------- |
|
||||
| Alexei Znamensky | russoz | russoz | |
|
||||
| Andrew Klychkov | andersson007 | andersson007_ | |
|
||||
| Andrew Pantuso | Ajpantuso | ajpantuso | |
|
||||
| Felix Fontein | felixfontein | felixfontein | |
|
||||
| John R Barker | gundalow | gundalow | |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace: community
|
||||
name: general
|
||||
version: 2.5.5
|
||||
version: 2.5.9
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
|
||||
8
plugins/cache/memcached.py
vendored
8
plugins/cache/memcached.py
vendored
@@ -154,12 +154,12 @@ class CacheModuleKeys(MutableSet):
|
||||
def __len__(self):
|
||||
return len(self._keyset)
|
||||
|
||||
def add(self, key):
|
||||
self._keyset[key] = time.time()
|
||||
def add(self, value):
|
||||
self._keyset[value] = time.time()
|
||||
self._cache.set(self.PREFIX, self._keyset)
|
||||
|
||||
def discard(self, key):
|
||||
del self._keyset[key]
|
||||
def discard(self, value):
|
||||
del self._keyset[value]
|
||||
self._cache.set(self.PREFIX, self._keyset)
|
||||
|
||||
def remove_by_timerange(self, s_min, s_max):
|
||||
|
||||
@@ -78,7 +78,7 @@ def get_mac():
|
||||
|
||||
# Getting hostname of system:
|
||||
def get_hostname():
|
||||
return str(socket.gethostname()).split('.local')[0]
|
||||
return str(socket.gethostname()).split('.local', 1)[0]
|
||||
|
||||
|
||||
# Getting IP of system:
|
||||
|
||||
@@ -94,6 +94,7 @@ ansible.cfg: |
|
||||
|
||||
import os
|
||||
import json
|
||||
from ansible import context
|
||||
import socket
|
||||
import uuid
|
||||
import logging
|
||||
@@ -152,11 +153,11 @@ class CallbackModule(CallbackBase):
|
||||
self.base_data['ansible_pre_command_output'] = os.popen(
|
||||
self.ls_pre_command).read()
|
||||
|
||||
if self._options is not None:
|
||||
self.base_data['ansible_checkmode'] = self._options.check
|
||||
self.base_data['ansible_tags'] = self._options.tags
|
||||
self.base_data['ansible_skip_tags'] = self._options.skip_tags
|
||||
self.base_data['inventory'] = self._options.inventory
|
||||
if context.CLIARGS is not None:
|
||||
self.base_data['ansible_checkmode'] = context.CLIARGS.get('check')
|
||||
self.base_data['ansible_tags'] = context.CLIARGS.get('tags')
|
||||
self.base_data['ansible_skip_tags'] = context.CLIARGS.get('skip_tags')
|
||||
self.base_data['inventory'] = context.CLIARGS.get('inventory')
|
||||
|
||||
def set_options(self, task_keys=None, var_options=None, direct=None):
|
||||
super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct)
|
||||
|
||||
@@ -42,28 +42,29 @@ def should_use_block(value):
|
||||
return False
|
||||
|
||||
|
||||
def my_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
|
||||
class MyDumper(AnsibleDumper):
|
||||
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
|
||||
|
||||
|
||||
class CallbackModule(Default):
|
||||
@@ -79,7 +80,6 @@ class CallbackModule(Default):
|
||||
|
||||
def __init__(self):
|
||||
super(CallbackModule, self).__init__()
|
||||
yaml.representer.BaseRepresenter.represent_scalar = my_represent_scalar
|
||||
|
||||
def _dump_results(self, result, indent=None, sort_keys=True, keep_invocation=False):
|
||||
if result.get('_ansible_no_log', False):
|
||||
@@ -121,7 +121,7 @@ class CallbackModule(Default):
|
||||
|
||||
if abridged_result:
|
||||
dumped += '\n'
|
||||
dumped += to_text(yaml.dump(abridged_result, allow_unicode=True, width=1000, Dumper=AnsibleDumper, default_flow_style=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
|
||||
dumped = '\n '.join(dumped.split('\n')).rstrip()
|
||||
|
||||
@@ -58,7 +58,7 @@ class Connection(ConnectionBase):
|
||||
self._connected = True
|
||||
return self
|
||||
|
||||
def exec_command(self, cmd, sudoable=False, in_data=None):
|
||||
def exec_command(self, cmd, in_data=None, sudoable=False):
|
||||
''' run a command on the remote minion '''
|
||||
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2017 Lenovo, Inc.
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -22,7 +22,7 @@ DOCUMENTATION = r'''
|
||||
- constructed
|
||||
options:
|
||||
plugin:
|
||||
description: marks this as an instance of the 'linode' plugin
|
||||
description: Marks this as an instance of the 'linode' plugin.
|
||||
required: true
|
||||
choices: ['linode', 'community.general.linode']
|
||||
access_token:
|
||||
@@ -77,6 +77,10 @@ groups:
|
||||
webservers: "'web' in (tags|list)"
|
||||
mailservers: "'mail' in (tags|list)"
|
||||
compose:
|
||||
# By default, Ansible tries to connect to the label of the instance.
|
||||
# Since that might not be a valid name to connect to, you can
|
||||
# replace it with the first IPv4 address of the linode as follows:
|
||||
ansible_ssh_host: ipv4[0]
|
||||
ansible_port: 2222
|
||||
'''
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
|
||||
self.headers = {
|
||||
'Authorization': "Bearer %s" % token,
|
||||
'User-Agent': "ansible %s Python %s" % (ansible_version, python_version.split(' ')[0]),
|
||||
'User-Agent': "ansible %s Python %s" % (ansible_version, python_version.split(' ', 1)[0]),
|
||||
'Content-type': 'application/json'
|
||||
}
|
||||
|
||||
|
||||
@@ -81,13 +81,24 @@ DOCUMENTATION = '''
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Minimal example which will not gather additional facts for QEMU/LXC guests
|
||||
# By not specifying a URL the plugin will attempt to connect to the controller host on port 8006
|
||||
# my.proxmox.yml
|
||||
plugin: community.general.proxmox
|
||||
url: http://localhost:8006
|
||||
user: ansible@pve
|
||||
password: secure
|
||||
validate_certs: no
|
||||
|
||||
# More complete example demonstrating the use of 'want_facts' and the constructed options
|
||||
# Note that using facts returned by 'want_facts' in constructed options requires 'want_facts=true'
|
||||
# my.proxmox.yml
|
||||
plugin: community.general.proxmox
|
||||
url: http://pve.domain.com:8006
|
||||
user: ansible@pve
|
||||
password: secure
|
||||
validate_certs: false
|
||||
want_facts: true
|
||||
keyed_groups:
|
||||
# proxmox_tags_parsed is an example of a fact only returned when 'want_facts=true'
|
||||
- key: proxmox_tags_parsed
|
||||
separator: ""
|
||||
prefix: group
|
||||
|
||||
@@ -383,8 +383,8 @@ class NetAppESeriesModule(object):
|
||||
path = path[1:]
|
||||
request_url = self.url + self.DEFAULT_REST_API_PATH + path
|
||||
|
||||
if self.log_requests or True:
|
||||
self.module.log(pformat(dict(url=request_url, data=data, method=method)))
|
||||
# if self.log_requests:
|
||||
self.module.log(pformat(dict(url=request_url, data=data, method=method)))
|
||||
|
||||
return request(url=request_url, data=data, method=method, headers=headers, use_proxy=True, force=False, last_mod_time=None,
|
||||
timeout=self.DEFAULT_TIMEOUT, http_agent=self.HTTP_AGENT, force_basic_auth=True, ignore_errors=ignore_errors, **self.creds)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright: (c) 2019 Gregory Thiemonge <gregory.thiemonge@gmail.com>
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright: (c) 2018, Ansible Project
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c), Google Inc, 2017
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or
|
||||
# Simplified BSD License (see simplified_bsd.txt or
|
||||
# https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2018 IBM CORPORATION
|
||||
# Author(s): Tzur Eliyahu <tzure@il.ibm.com>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2017, Ansible Project
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Copyright (c) 2016 Thomas Krahn (@Nosmoht)
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
@@ -31,6 +31,7 @@ def _env_then_dns_fallback(*args, **kwargs):
|
||||
result = env_fallback(*args, **kwargs)
|
||||
if result == '':
|
||||
raise AnsibleFallbackNotFound
|
||||
return result
|
||||
except AnsibleFallbackNotFound:
|
||||
# If no host was given, we try to guess it from IPA.
|
||||
# The ipa-ca entry is a standard entry that IPA will have set for
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c), Luke Murphy @decentral1se
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# still belong to the author of the module, and may assign their own license
|
||||
# to the complete work.
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# still belong to the author of the module, and may assign their own license
|
||||
# to the complete work.
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||
# Copyright: (c) 2020, Ansible Project
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# (c) 2018 Red Hat Inc.
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# still belong to the author of the module, and may assign their own license
|
||||
# to the complete work.
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
@@ -100,7 +100,7 @@ class Online(object):
|
||||
|
||||
@staticmethod
|
||||
def get_user_agent_string(module):
|
||||
return "ansible %s Python %s" % (module.ansible_version, sys.version.split(' ')[0])
|
||||
return "ansible %s Python %s" % (module.ansible_version, sys.version.split(' ', 1)[0])
|
||||
|
||||
def get(self, path, data=None, headers=None):
|
||||
return self.send('GET', path, data, headers)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Copyright 2018 www.privaz.io Valletech AB
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# to the complete work.
|
||||
#
|
||||
# Copyright (c), Simon Dodsley <simon@purestorage.com>,2017
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -2740,7 +2740,9 @@ class RedfishUtils(object):
|
||||
if isinstance(set_value, dict):
|
||||
for subprop in payload[property].keys():
|
||||
if subprop not in target_ethernet_current_setting[property]:
|
||||
return {'ret': False, 'msg': "Sub-property %s in nic_config is invalid" % subprop}
|
||||
# Not configured already; need to apply the request
|
||||
need_change = True
|
||||
break
|
||||
sub_set_value = payload[property][subprop]
|
||||
sub_cur_value = target_ethernet_current_setting[property][subprop]
|
||||
if sub_set_value != sub_cur_value:
|
||||
@@ -2754,7 +2756,9 @@ class RedfishUtils(object):
|
||||
for i in range(len(set_value)):
|
||||
for subprop in payload[property][i].keys():
|
||||
if subprop not in target_ethernet_current_setting[property][i]:
|
||||
return {'ret': False, 'msg': "Sub-property %s in nic_config is invalid" % subprop}
|
||||
# Not configured already; need to apply the request
|
||||
need_change = True
|
||||
break
|
||||
sub_set_value = payload[property][i][subprop]
|
||||
sub_cur_value = target_ethernet_current_setting[property][i][subprop]
|
||||
if sub_set_value != sub_cur_value:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright (c), James Laska
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Version 1.3
|
||||
# Copyright (C) 2019 Dell Inc. or its subsidiaries. All Rights Reserved.
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# own license to the complete work.
|
||||
#
|
||||
# Copyright (C) 2017 Lenovo, Inc.
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
#
|
||||
# Contains LXCA common class
|
||||
# Lenovo xClarity Administrator (LXCA)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
# Copyright: (c) 2020, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -141,7 +141,7 @@ class Scaleway(object):
|
||||
|
||||
@staticmethod
|
||||
def get_user_agent_string(module):
|
||||
return "ansible %s Python %s" % (module.ansible_version, sys.version.split(' ')[0])
|
||||
return "ansible %s Python %s" % (module.ansible_version, sys.version.split(' ', 1)[0])
|
||||
|
||||
def get(self, path, data=None, headers=None, params=None):
|
||||
return self.send(method='GET', path=path, data=data, headers=headers, params=params)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# (c) 2018 Luca 'remix_tj' Lorenzetto
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# Copyright (c) 2016, Adfinis SyGroup AG
|
||||
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.com>
|
||||
#
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright: (c) 2019, Sandeep Kasargod <sandeep@vexata.com>
|
||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
@@ -31,7 +31,14 @@ options:
|
||||
type: str
|
||||
disk:
|
||||
description:
|
||||
- hard disk size in GB for instance
|
||||
- This option was previously described as "hard disk size in GB for instance" however several formats describing
|
||||
a lxc mount are permitted.
|
||||
- Older versions of Proxmox will accept a numeric value for size using the I(storage) parameter to automatically
|
||||
choose which storage to allocate from, however new versions enforce the C(<STORAGE>:<SIZE>) syntax.
|
||||
- "Additional options are available by using some combination of the following key-value pairs as a
|
||||
comma-delimited list C([volume=]<volume> [,acl=<1|0>] [,mountoptions=<opt[;opt...]>] [,quota=<1|0>]
|
||||
[,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>])."
|
||||
- See U(https://pve.proxmox.com/wiki/Linux_Container) for a full description.
|
||||
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
|
||||
option has a default of C(3). Note that the default value of I(proxmox_default_behavior)
|
||||
changes in community.general 4.0.0.
|
||||
|
||||
@@ -131,7 +131,7 @@ def main():
|
||||
group = module.params['group']
|
||||
|
||||
if group:
|
||||
groups = [proxmox.get_group(group=group)]
|
||||
groups = [proxmox.get_group(groupid=group)]
|
||||
else:
|
||||
groups = proxmox.get_groups()
|
||||
result['proxmox_groups'] = [group.group for group in groups]
|
||||
|
||||
@@ -1201,8 +1201,9 @@ def main():
|
||||
module.fail_json(vmid=vmid, msg='VM with vmid = %s does not exist in cluster' % vmid)
|
||||
|
||||
# Ensure the choosen VM name doesn't already exist when cloning
|
||||
if get_vmid(proxmox, name):
|
||||
module.exit_json(changed=False, vmid=vmid, msg="VM with name <%s> already exists" % name)
|
||||
existing_vmid = get_vmid(proxmox, name)
|
||||
if existing_vmid:
|
||||
module.exit_json(changed=False, vmid=existing_vmid[0], msg="VM with name <%s> already exists" % name)
|
||||
|
||||
# Ensure the choosen VM id doesn't already exist when cloning
|
||||
if get_vm(proxmox, newid):
|
||||
|
||||
@@ -212,8 +212,8 @@ class TemplateModule(OpenNebulaModule):
|
||||
def get_template_by_id(self, template_id):
|
||||
return self.get_template(lambda template: (template.ID == template_id))
|
||||
|
||||
def get_template_by_name(self, template_name):
|
||||
return self.get_template(lambda template: (template.NAME == template_name))
|
||||
def get_template_by_name(self, name):
|
||||
return self.get_template(lambda template: (template.NAME == name))
|
||||
|
||||
def get_template_instance(self, requested_id, requested_name):
|
||||
if requested_id:
|
||||
|
||||
@@ -508,11 +508,10 @@ def wait_for_devices_active(module, packet_conn, watched_devices):
|
||||
def wait_for_public_IPv(module, packet_conn, created_devices):
|
||||
|
||||
def has_public_ip(addr_list, ip_v):
|
||||
return any([a['public'] and a['address_family'] == ip_v and
|
||||
a['address'] for a in addr_list])
|
||||
return any(a['public'] and a['address_family'] == ip_v and a['address'] for a in addr_list)
|
||||
|
||||
def all_have_public_ip(ds, ip_v):
|
||||
return all([has_public_ip(d.ip_addresses, ip_v) for d in ds])
|
||||
return all(has_public_ip(d.ip_addresses, ip_v) for d in ds)
|
||||
|
||||
address_family = module.params.get('wait_for_public_IPv')
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ def get_sshkey_selector(module):
|
||||
return k.key == select_dict['key']
|
||||
else:
|
||||
# if key string not specified, all the fields must match
|
||||
return all([select_dict[f] == getattr(k, f) for f in select_dict])
|
||||
return all(select_dict[f] == getattr(k, f) for f in select_dict)
|
||||
return selector
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ description:
|
||||
requirements:
|
||||
- Python >= 2.6
|
||||
- Univention
|
||||
- ipaddress (for I(type=ptr_record))
|
||||
options:
|
||||
state:
|
||||
required: false
|
||||
@@ -33,10 +34,12 @@ options:
|
||||
description:
|
||||
- "Name of the record, this is also the DNS record. E.g. www for
|
||||
www.example.com."
|
||||
- For PTR records this has to be the IP address.
|
||||
zone:
|
||||
required: true
|
||||
description:
|
||||
- Corresponding DNS zone for this record, e.g. example.com.
|
||||
- For PTR records this has to be the full reverse zone (for example C(1.1.192.in-addr.arpa)).
|
||||
type:
|
||||
required: true
|
||||
description:
|
||||
@@ -63,12 +66,29 @@ EXAMPLES = '''
|
||||
a:
|
||||
- 192.0.2.1
|
||||
- 2001:0db8::42
|
||||
|
||||
- name: Create a DNS v4 PTR record on a UCS
|
||||
community.general.udm_dns_record:
|
||||
name: 192.0.2.1
|
||||
zone: 2.0.192.in-addr.arpa
|
||||
type: ptr_record
|
||||
data:
|
||||
ptr_record: "www.example.com."
|
||||
|
||||
- name: Create a DNS v6 PTR record on a UCS
|
||||
community.general.udm_dns_record:
|
||||
name: 2001:db8:0:0:0:ff00:42:8329
|
||||
zone: 2.4.0.0.0.0.f.f.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa
|
||||
type: ptr_record
|
||||
data:
|
||||
ptr_record: "www.example.com."
|
||||
'''
|
||||
|
||||
|
||||
RETURN = '''#'''
|
||||
|
||||
HAVE_UNIVENTION = False
|
||||
HAVE_IPADDRESS = False
|
||||
try:
|
||||
from univention.admin.handlers.dns import (
|
||||
forward_zone,
|
||||
@@ -79,6 +99,7 @@ except ImportError:
|
||||
pass
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible_collections.community.general.plugins.module_utils.univention_umc import (
|
||||
umc_module_for_add,
|
||||
umc_module_for_edit,
|
||||
@@ -87,6 +108,11 @@ from ansible_collections.community.general.plugins.module_utils.univention_umc i
|
||||
config,
|
||||
uldap,
|
||||
)
|
||||
try:
|
||||
import ipaddress
|
||||
HAVE_IPADDRESS = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
@@ -121,14 +147,30 @@ def main():
|
||||
changed = False
|
||||
diff = None
|
||||
|
||||
workname = name
|
||||
if type == 'ptr_record':
|
||||
if not HAVE_IPADDRESS:
|
||||
module.fail_json(msg=missing_required_lib('ipaddress'))
|
||||
try:
|
||||
if 'arpa' not in zone:
|
||||
raise Exception("Zone must be reversed zone for ptr_record. (e.g. 1.1.192.in-addr.arpa)")
|
||||
ipaddr_rev = ipaddress.ip_address(name).reverse_pointer
|
||||
subnet_offset = ipaddr_rev.find(zone)
|
||||
if subnet_offset == -1:
|
||||
raise Exception("reversed IP address {0} is not part of zone.".format(ipaddr_rev))
|
||||
workname = ipaddr_rev[0:subnet_offset - 1]
|
||||
except Exception as e:
|
||||
module.fail_json(
|
||||
msg='handling PTR record for {0} in zone {1} failed: {2}'.format(name, zone, e)
|
||||
)
|
||||
|
||||
obj = list(ldap_search(
|
||||
'(&(objectClass=dNSZone)(zoneName={0})(relativeDomainName={1}))'.format(zone, name),
|
||||
'(&(objectClass=dNSZone)(zoneName={0})(relativeDomainName={1}))'.format(zone, workname),
|
||||
attr=['dNSZone']
|
||||
))
|
||||
|
||||
exists = bool(len(obj))
|
||||
container = 'zoneName={0},cn=dns,{1}'.format(zone, base_dn())
|
||||
dn = 'relativeDomainName={0},{1}'.format(name, container)
|
||||
dn = 'relativeDomainName={0},{1}'.format(workname, container)
|
||||
|
||||
if state == 'present':
|
||||
try:
|
||||
@@ -141,13 +183,21 @@ def main():
|
||||
) or reverse_zone.lookup(
|
||||
config(),
|
||||
uldap(),
|
||||
'(zone={0})'.format(zone),
|
||||
'(zoneName={0})'.format(zone),
|
||||
scope='domain',
|
||||
)
|
||||
if len(so) == 0:
|
||||
raise Exception("Did not find zone '{0}' in Univention".format(zone))
|
||||
obj = umc_module_for_add('dns/{0}'.format(type), container, superordinate=so[0])
|
||||
else:
|
||||
obj = umc_module_for_edit('dns/{0}'.format(type), dn)
|
||||
obj['name'] = name
|
||||
|
||||
if type == 'ptr_record':
|
||||
obj['ip'] = name
|
||||
obj['address'] = workname
|
||||
else:
|
||||
obj['name'] = name
|
||||
|
||||
for k, v in data.items():
|
||||
obj[k] = v
|
||||
diff = obj.diff()
|
||||
|
||||
@@ -157,7 +157,7 @@ def _run_xattr(module, cmd, check_rc=True):
|
||||
if line.startswith('#') or line == '':
|
||||
pass
|
||||
elif '=' in line:
|
||||
(key, val) = line.split('=')
|
||||
(key, val) = line.split('=', 1)
|
||||
result[key] = val.strip('"')
|
||||
else:
|
||||
result[line] = ''
|
||||
|
||||
@@ -84,13 +84,6 @@ EXAMPLES = '''
|
||||
account_api_token: dummyapitoken
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Fetch my.com domain records
|
||||
community.general.dnsimple:
|
||||
domain: my.com
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
register: records
|
||||
|
||||
- name: Delete a domain
|
||||
community.general.dnsimple:
|
||||
domain: my.com
|
||||
|
||||
@@ -811,6 +811,8 @@ class Nmcli(object):
|
||||
'ethernet',
|
||||
'generic',
|
||||
'infiniband',
|
||||
'ipip',
|
||||
'sit',
|
||||
'team',
|
||||
'vlan',
|
||||
)
|
||||
|
||||
@@ -556,7 +556,7 @@ class MavenDownloader:
|
||||
return "Cannot find md5 from " + remote_url
|
||||
try:
|
||||
# Check if remote md5 only contains md5 or md5 + filename
|
||||
_remote_md5 = remote_md5.split(None)[0]
|
||||
_remote_md5 = remote_md5.split(None, 1)[0]
|
||||
remote_md5 = _remote_md5
|
||||
# remote_md5 is empty so we continue and keep original md5 string
|
||||
# This should not happen since we check for remote_md5 before
|
||||
|
||||
@@ -120,8 +120,7 @@ class CoprModule(object):
|
||||
@property
|
||||
def short_chroot(self):
|
||||
"""str: Chroot (distribution-version-architecture) shorten to distribution-version."""
|
||||
chroot_parts = self.chroot.split("-")
|
||||
return "{0}-{1}".format(chroot_parts[0], chroot_parts[1])
|
||||
return self.chroot.rsplit('-', 1)[0]
|
||||
|
||||
@property
|
||||
def arch(self):
|
||||
@@ -193,18 +192,20 @@ class CoprModule(object):
|
||||
Returns:
|
||||
Information about the repository.
|
||||
"""
|
||||
distribution, version = self.short_chroot.split("-")
|
||||
distribution, version = self.short_chroot.split('-', 1)
|
||||
chroot = self.short_chroot
|
||||
while True:
|
||||
repo_info, status_code = self._get(chroot)
|
||||
if repo_info:
|
||||
return repo_info
|
||||
if distribution == "rhel":
|
||||
chroot = "centos-stream"
|
||||
chroot = "centos-stream-8"
|
||||
distribution = "centos"
|
||||
elif distribution == "centos":
|
||||
if version == "stream":
|
||||
if version == "stream-8":
|
||||
version = "8"
|
||||
elif version == "stream-9":
|
||||
version = "9"
|
||||
chroot = "epel-{0}".format(version)
|
||||
distribution = "epel"
|
||||
else:
|
||||
|
||||
@@ -132,10 +132,10 @@ EXAMPLES = '''
|
||||
name: homebrew/cask/foo
|
||||
state: present
|
||||
|
||||
- name: Use ignored-pinned option while upgrading all
|
||||
- name: Use ignore-pinned option while upgrading all
|
||||
community.general.homebrew:
|
||||
upgrade_all: yes
|
||||
upgrade_options: ignored-pinned
|
||||
upgrade_options: ignore-pinned
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
||||
@@ -246,6 +246,7 @@ def package_present(names, pkg_spec, module):
|
||||
if match:
|
||||
# It turns out we were able to install the package.
|
||||
module.debug("package_present(): we were able to install package for name '%s'" % name)
|
||||
pkg_spec[name]['changed'] = True
|
||||
else:
|
||||
# We really did fail, fake the return code.
|
||||
module.debug("package_present(): we really did fail for name '%s'" % name)
|
||||
|
||||
@@ -168,7 +168,9 @@ EXAMPLES = '''
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Managers/1/NetworkProtocol/Oem/Lenovo/DNS"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data }}"
|
||||
|
||||
- name: Get Lenovo FoD key collection resource via GetCollectionResource command
|
||||
@@ -180,7 +182,9 @@ EXAMPLES = '''
|
||||
password: "{{ password }}"
|
||||
resource_uri: "/redfish/v1/Managers/1/Oem/Lenovo/FoD/Keys"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.data_list }}"
|
||||
|
||||
- name: Update ComputeSystem property AssetTag via PatchResource command
|
||||
|
||||
@@ -46,7 +46,9 @@ EXAMPLES = '''
|
||||
api_version: 500
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Data Centers
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Data Centers
|
||||
@@ -61,7 +63,9 @@ EXAMPLES = '''
|
||||
sort: 'name:descending'
|
||||
filter: 'state=Unmanaged'
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about paginated, filtered and sorted list of Data Centers
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
|
||||
- name: Gather information about a Data Center by name
|
||||
@@ -73,7 +77,9 @@ EXAMPLES = '''
|
||||
name: "My Data Center"
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Data Center found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
|
||||
- name: Gather information about the Data Center Visual Content
|
||||
@@ -87,9 +93,13 @@ EXAMPLES = '''
|
||||
- visualContent
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Data Center found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Data Center Visual Content
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.datacenter_visual_content }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -49,7 +49,9 @@ EXAMPLES = '''
|
||||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosures
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Enclosures
|
||||
@@ -66,7 +68,9 @@ EXAMPLES = '''
|
||||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about paginated, filtered ans sorted list of Enclosures
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
|
||||
- name: Gather information about an Enclosure by name
|
||||
@@ -79,7 +83,9 @@ EXAMPLES = '''
|
||||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
|
||||
- name: Gather information about an Enclosure by name with options
|
||||
@@ -96,13 +102,21 @@ EXAMPLES = '''
|
||||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure Script
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_script }}"
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure Environmental Configuration
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_environmental_configuration }}"
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure Utilization
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_utilization }}"
|
||||
|
||||
- name: "Gather information about an Enclosure with temperature data at a resolution of one sample per day, between two
|
||||
@@ -124,9 +138,13 @@ EXAMPLES = '''
|
||||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Enclosure Utilization
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_utilization }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Ethernet Networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ethernet_networks }}"
|
||||
|
||||
- name: Gather paginated and filtered information about Ethernet Networks
|
||||
@@ -57,7 +58,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about paginated and filtered list of Ethernet Networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ethernet_networks }}"
|
||||
|
||||
- name: Gather information about an Ethernet Network by name
|
||||
@@ -67,7 +69,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Ethernet Network found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ethernet_networks }}"
|
||||
|
||||
- name: Gather information about an Ethernet Network by name with options
|
||||
@@ -80,9 +83,12 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Ethernet Network Associated Profiles
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enet_associated_profiles }}"
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about Ethernet Network Associated Uplink Groups
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.enet_associated_uplink_groups }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Fibre Channel Networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.fc_networks }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Fibre Channel Networks
|
||||
@@ -51,7 +52,9 @@ EXAMPLES = '''
|
||||
filter: 'fabricType=FabricAttach'
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information about paginated, filtered and sorted list of Fibre Channel Networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.fc_networks }}"
|
||||
|
||||
- name: Gather information about a Fibre Channel Network by name
|
||||
@@ -61,7 +64,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Fibre Channel Network found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.fc_networks }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -37,7 +37,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about FCoE Networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.fcoe_networks }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about FCoE Networks
|
||||
@@ -51,7 +52,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about paginated, filtered and sorted list of FCoE Networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.fcoe_networks }}"
|
||||
|
||||
- name: Gather information about a FCoE Network by name
|
||||
@@ -61,7 +63,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about FCoE Network found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.fcoe_networks }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Logical Interconnect Groups
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.logical_interconnect_groups }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Logical Interconnect Groups
|
||||
@@ -60,7 +61,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about paginated, filtered and sorted list of Logical Interconnect Groups
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.logical_interconnect_groups }}"
|
||||
|
||||
- name: Gather information about a Logical Interconnect Group by name
|
||||
@@ -74,7 +76,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Logical Interconnect Group found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.logical_interconnect_groups }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -50,10 +50,11 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Network Sets
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather paginated, filtered, and sorted information about Network Sets
|
||||
- name: Gather paginated, filtered and sorted information about Network Sets
|
||||
community.general.oneview_network_set_info:
|
||||
hostname: 172.16.101.48
|
||||
username: administrator
|
||||
@@ -68,7 +69,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about paginated, filtered and sorted list of Network Sets
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather information about all Network Sets, excluding Ethernet networks
|
||||
@@ -83,7 +85,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Network Sets, excluding Ethernet networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather information about a Network Set by name
|
||||
@@ -97,7 +100,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Network Set found by name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather information about a Network Set by name, excluding Ethernet networks
|
||||
@@ -113,7 +117,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about Network Set found by name, excluding Ethernet networks
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about SAN Managers
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.san_managers }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about SAN Managers
|
||||
@@ -59,7 +60,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about paginated, filtered and sorted list of SAN Managers
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.san_managers }}"
|
||||
|
||||
- name: Gather information about a SAN Manager by provider display name
|
||||
@@ -69,7 +71,8 @@ EXAMPLES = '''
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information about SAN Manager found by provider display name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.san_managers }}"
|
||||
'''
|
||||
|
||||
|
||||
@@ -67,7 +67,9 @@ EXAMPLES = '''
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.cpu.entries | to_nice_json }}"
|
||||
|
||||
- name: Get CPU model
|
||||
@@ -78,7 +80,9 @@ EXAMPLES = '''
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.cpu.entries.0.Model }}"
|
||||
|
||||
- name: Get memory inventory
|
||||
@@ -108,7 +112,9 @@ EXAMPLES = '''
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}"
|
||||
|
||||
- name: Get Volume Inventory
|
||||
@@ -119,7 +125,8 @@ EXAMPLES = '''
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.volume.entries | to_nice_json }}"
|
||||
|
||||
- name: Get Session information
|
||||
@@ -130,7 +137,9 @@ EXAMPLES = '''
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.session.entries | to_nice_json }}"
|
||||
|
||||
- name: Get default inventory information
|
||||
@@ -139,7 +148,8 @@ EXAMPLES = '''
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- ansible.builtin.debug:
|
||||
- name: Print fetched information
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts | to_nice_json }}"
|
||||
|
||||
- name: Get several inventories
|
||||
|
||||
@@ -96,7 +96,7 @@ author:
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: create a new webhook that triggers on push (password auth)
|
||||
- name: Create a new webhook that triggers on push (password auth)
|
||||
community.general.github_webhook:
|
||||
repository: ansible/ansible
|
||||
url: https://www.example.com/hooks/
|
||||
|
||||
@@ -204,7 +204,7 @@ class GitLabDeployKey(object):
|
||||
@param key_title Title of the key
|
||||
'''
|
||||
def findDeployKey(self, project, key_title):
|
||||
deployKeys = project.keys.list()
|
||||
deployKeys = project.keys.list(all=True)
|
||||
for deployKey in deployKeys:
|
||||
if (deployKey.title == key_title):
|
||||
return deployKey
|
||||
|
||||
@@ -102,9 +102,13 @@ class GitLabGroup(object):
|
||||
|
||||
# get group id if group exists
|
||||
def get_group_id(self, gitlab_group):
|
||||
group_exists = self._gitlab.groups.list(search=gitlab_group)
|
||||
if group_exists:
|
||||
return group_exists[0].id
|
||||
groups = self._gitlab.groups.list(search=gitlab_group)
|
||||
for group in groups:
|
||||
if group.full_path == gitlab_group:
|
||||
return group.id
|
||||
for group in groups:
|
||||
if group.path == gitlab_group or group.name == gitlab_group:
|
||||
return group.id
|
||||
|
||||
# get all members in a group
|
||||
def get_members_in_a_group(self, gitlab_group_id):
|
||||
|
||||
@@ -48,7 +48,7 @@ options:
|
||||
type: str
|
||||
project:
|
||||
description:
|
||||
- The name of the GitLab project the member is added to/removed from.
|
||||
- The name (or full path) of the GitLab project the member is added to/removed from.
|
||||
required: true
|
||||
type: str
|
||||
gitlab_user:
|
||||
@@ -118,9 +118,13 @@ class GitLabProjectMembers(object):
|
||||
self._gitlab = gl
|
||||
|
||||
def get_project(self, project_name):
|
||||
project_exists = self._gitlab.projects.list(search=project_name)
|
||||
if project_exists:
|
||||
return project_exists[0].id
|
||||
try:
|
||||
project_exists = self._gitlab.projects.get(project_name)
|
||||
return project_exists.id
|
||||
except gitlab.exceptions.GitlabGetError as e:
|
||||
project_exists = self._gitlab.projects.list(search=project_name)
|
||||
if project_exists:
|
||||
return project_exists[0].id
|
||||
|
||||
def get_user_id(self, gitlab_user):
|
||||
user_exists = self._gitlab.users.list(username=gitlab_user)
|
||||
|
||||
@@ -86,7 +86,7 @@ options:
|
||||
type: str
|
||||
maximum_timeout:
|
||||
description:
|
||||
- The maximum timeout that a runner has to pick up a specific job.
|
||||
- The maximum time that a runner has to complete a specific job.
|
||||
required: False
|
||||
default: 3600
|
||||
type: int
|
||||
|
||||
@@ -141,14 +141,14 @@ class Plist:
|
||||
self.__changed = False
|
||||
self.__service = service
|
||||
|
||||
state, pid, dummy, dummy = LaunchCtlList(module, service).run()
|
||||
state, pid, dummy, dummy = LaunchCtlList(module, self.__service).run()
|
||||
|
||||
# Check if readPlist is available or not
|
||||
self.old_plistlib = hasattr(plistlib, 'readPlist')
|
||||
|
||||
self.__file = self.__find_service_plist(service)
|
||||
self.__file = self.__find_service_plist(self.__service)
|
||||
if self.__file is None:
|
||||
msg = 'Unable to infer the path of %s service plist file' % service
|
||||
msg = 'Unable to infer the path of %s service plist file' % self.__service
|
||||
if pid is None and state == ServiceState.UNLOADED:
|
||||
msg += ' and it was not found among active services'
|
||||
module.fail_json(msg=msg)
|
||||
|
||||
@@ -274,8 +274,7 @@ RULE_REGEX = re.compile(r"""(?P<rule_type>-?(?:auth|account|session|password))\s
|
||||
(?P<control>\[.*\]|\S*)\s+
|
||||
(?P<path>\S*)\s*
|
||||
(?P<args>.*)\s*""", re.X)
|
||||
|
||||
RULE_ARG_REGEX = re.compile(r"""(\[.*\]|\S*)""")
|
||||
RULE_ARG_REGEX = re.compile(r"(\[.*\]|\S*)")
|
||||
|
||||
VALID_TYPES = ['account', '-account', 'auth', '-auth', 'password', '-password', 'session', '-session']
|
||||
|
||||
@@ -358,11 +357,9 @@ class PamdRule(PamdLine):
|
||||
|
||||
# Method to check if a rule matches the type, control and path.
|
||||
def matches(self, rule_type, rule_control, rule_path, rule_args=None):
|
||||
if (rule_type == self.rule_type and
|
||||
return (rule_type == self.rule_type and
|
||||
rule_control == self.rule_control and
|
||||
rule_path == self.rule_path):
|
||||
return True
|
||||
return False
|
||||
rule_path == self.rule_path)
|
||||
|
||||
@classmethod
|
||||
def rule_from_string(cls, line):
|
||||
@@ -507,25 +504,25 @@ class PamdService(object):
|
||||
# Get a list of rules we want to change
|
||||
rules_to_find = self.get(rule_type, rule_control, rule_path)
|
||||
|
||||
new_args = parse_module_arguments(new_args)
|
||||
new_args = parse_module_arguments(new_args, return_none=True)
|
||||
|
||||
changes = 0
|
||||
for current_rule in rules_to_find:
|
||||
rule_changed = False
|
||||
if new_type:
|
||||
if(current_rule.rule_type != new_type):
|
||||
if current_rule.rule_type != new_type:
|
||||
rule_changed = True
|
||||
current_rule.rule_type = new_type
|
||||
if new_control:
|
||||
if(current_rule.rule_control != new_control):
|
||||
if current_rule.rule_control != new_control:
|
||||
rule_changed = True
|
||||
current_rule.rule_control = new_control
|
||||
if new_path:
|
||||
if(current_rule.rule_path != new_path):
|
||||
if current_rule.rule_path != new_path:
|
||||
rule_changed = True
|
||||
current_rule.rule_path = new_path
|
||||
if new_args:
|
||||
if(current_rule.rule_args != new_args):
|
||||
if new_args is not None:
|
||||
if current_rule.rule_args != new_args:
|
||||
rule_changed = True
|
||||
current_rule.rule_args = new_args
|
||||
|
||||
@@ -724,8 +721,9 @@ class PamdService(object):
|
||||
current_line = self._head
|
||||
|
||||
while current_line is not None:
|
||||
if not current_line.validate()[0]:
|
||||
return current_line.validate()
|
||||
curr_validate = current_line.validate()
|
||||
if not curr_validate[0]:
|
||||
return curr_validate
|
||||
current_line = current_line.next
|
||||
return True, "Module is valid"
|
||||
|
||||
@@ -750,22 +748,25 @@ class PamdService(object):
|
||||
return '\n'.join(lines) + '\n'
|
||||
|
||||
|
||||
def parse_module_arguments(module_arguments):
|
||||
# Return empty list if we have no args to parse
|
||||
if not module_arguments:
|
||||
return []
|
||||
elif isinstance(module_arguments, list) and len(module_arguments) == 1 and not module_arguments[0]:
|
||||
def parse_module_arguments(module_arguments, return_none=False):
|
||||
# If args is None, return empty list by default.
|
||||
# But if return_none is True, then return None
|
||||
if module_arguments is None:
|
||||
return None if return_none else []
|
||||
if isinstance(module_arguments, list) and len(module_arguments) == 1 and not module_arguments[0]:
|
||||
return []
|
||||
|
||||
if not isinstance(module_arguments, list):
|
||||
module_arguments = [module_arguments]
|
||||
|
||||
parsed_args = list()
|
||||
# From this point on, module_arguments is guaranteed to be a list, empty or not
|
||||
parsed_args = []
|
||||
|
||||
re_clear_spaces = re.compile(r"\s*=\s*")
|
||||
for arg in module_arguments:
|
||||
for item in filter(None, RULE_ARG_REGEX.findall(arg)):
|
||||
if not item.startswith("["):
|
||||
re.sub("\\s*=\\s*", "=", item)
|
||||
re_clear_spaces.sub("=", item)
|
||||
parsed_args.append(item)
|
||||
|
||||
return parsed_args
|
||||
@@ -861,8 +862,7 @@ def main():
|
||||
fd.write(str(service))
|
||||
|
||||
except IOError:
|
||||
module.fail_json(msg='Unable to create temporary \
|
||||
file %s' % temp_file)
|
||||
module.fail_json(msg='Unable to create temporary file %s' % temp_file)
|
||||
|
||||
module.atomic_move(temp_file.name, os.path.realpath(fname))
|
||||
|
||||
|
||||
@@ -526,8 +526,8 @@ def main():
|
||||
lines = [(numbered_line_re.match(line), '(v6)' in line) for line in numbered_state.splitlines()]
|
||||
lines = [(int(matcher.group(1)), ipv6) for (matcher, ipv6) in lines if matcher]
|
||||
last_number = max([no for (no, ipv6) in lines]) if lines else 0
|
||||
has_ipv4 = any([not ipv6 for (no, ipv6) in lines])
|
||||
has_ipv6 = any([ipv6 for (no, ipv6) in lines])
|
||||
has_ipv4 = any(not ipv6 for (no, ipv6) in lines)
|
||||
has_ipv6 = any(ipv6 for (no, ipv6) in lines)
|
||||
if relative_to_cmd == 'first-ipv4':
|
||||
relative_to = 1
|
||||
elif relative_to_cmd == 'last-ipv4':
|
||||
|
||||
@@ -314,7 +314,7 @@ except ImportError:
|
||||
#
|
||||
# @return vdolist A list of currently created VDO volumes.
|
||||
def inventory_vdos(module, vdocmd):
|
||||
rc, vdostatusout, err = module.run_command("%s status" % (vdocmd))
|
||||
rc, vdostatusout, err = module.run_command([vdocmd, "status"])
|
||||
|
||||
# if rc != 0:
|
||||
# module.fail_json(msg="Inventorying VDOs failed: %s"
|
||||
@@ -322,15 +322,13 @@ def inventory_vdos(module, vdocmd):
|
||||
|
||||
vdolist = []
|
||||
|
||||
if (rc == 2 and
|
||||
re.findall(r"vdoconf.yml does not exist", err, re.MULTILINE)):
|
||||
if rc == 2 and re.findall(r"vdoconf\.yml does not exist", err, re.MULTILINE):
|
||||
# If there is no /etc/vdoconf.yml file, assume there are no
|
||||
# VDO volumes. Return an empty list of VDO volumes.
|
||||
return vdolist
|
||||
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Inventorying VDOs failed: %s"
|
||||
% vdostatusout, rc=rc, err=err)
|
||||
module.fail_json(msg="Inventorying VDOs failed: %s" % vdostatusout, rc=rc, err=err)
|
||||
|
||||
vdostatusyaml = yaml.load(vdostatusout)
|
||||
if vdostatusyaml is None:
|
||||
@@ -345,7 +343,7 @@ def inventory_vdos(module, vdocmd):
|
||||
|
||||
|
||||
def list_running_vdos(module, vdocmd):
|
||||
rc, vdolistout, err = module.run_command("%s list" % (vdocmd))
|
||||
rc, vdolistout, err = module.run_command([vdocmd, "list"])
|
||||
runningvdolist = filter(None, vdolistout.split('\n'))
|
||||
return runningvdolist
|
||||
|
||||
@@ -359,36 +357,30 @@ def list_running_vdos(module, vdocmd):
|
||||
#
|
||||
# @return vdocmdoptions A string to be used in a 'vdo <action>' command.
|
||||
def start_vdo(module, vdoname, vdocmd):
|
||||
rc, out, err = module.run_command("%s start --name=%s" % (vdocmd, vdoname))
|
||||
rc, out, err = module.run_command([vdocmd, "start", "--name=%s" % vdoname])
|
||||
if rc == 0:
|
||||
module.log("started VDO volume %s" % vdoname)
|
||||
|
||||
return rc
|
||||
|
||||
|
||||
def stop_vdo(module, vdoname, vdocmd):
|
||||
rc, out, err = module.run_command("%s stop --name=%s" % (vdocmd, vdoname))
|
||||
rc, out, err = module.run_command([vdocmd, "stop", "--name=%s" % vdoname])
|
||||
if rc == 0:
|
||||
module.log("stopped VDO volume %s" % vdoname)
|
||||
|
||||
return rc
|
||||
|
||||
|
||||
def activate_vdo(module, vdoname, vdocmd):
|
||||
rc, out, err = module.run_command("%s activate --name=%s"
|
||||
% (vdocmd, vdoname))
|
||||
rc, out, err = module.run_command([vdocmd, "activate", "--name=%s" % vdoname])
|
||||
if rc == 0:
|
||||
module.log("activated VDO volume %s" % vdoname)
|
||||
|
||||
return rc
|
||||
|
||||
|
||||
def deactivate_vdo(module, vdoname, vdocmd):
|
||||
rc, out, err = module.run_command("%s deactivate --name=%s"
|
||||
% (vdocmd, vdoname))
|
||||
rc, out, err = module.run_command([vdocmd, "deactivate", "--name=%s" % vdoname])
|
||||
if rc == 0:
|
||||
module.log("deactivated VDO volume %s" % vdoname)
|
||||
|
||||
return rc
|
||||
|
||||
|
||||
@@ -396,32 +388,31 @@ def add_vdooptions(params):
|
||||
vdocmdoptions = ""
|
||||
options = []
|
||||
|
||||
if ('logicalsize' in params) and (params['logicalsize'] is not None):
|
||||
if params.get('logicalsize') is not None:
|
||||
options.append("--vdoLogicalSize=" + params['logicalsize'])
|
||||
|
||||
if (('blockmapcachesize' in params) and
|
||||
(params['blockmapcachesize'] is not None)):
|
||||
if params.get('blockmapcachesize') is not None:
|
||||
options.append("--blockMapCacheSize=" + params['blockmapcachesize'])
|
||||
|
||||
if ('readcache' in params) and (params['readcache'] == 'enabled'):
|
||||
if params.get('readcache') == 'enabled':
|
||||
options.append("--readCache=enabled")
|
||||
|
||||
if ('readcachesize' in params) and (params['readcachesize'] is not None):
|
||||
if params.get('readcachesize') is not None:
|
||||
options.append("--readCacheSize=" + params['readcachesize'])
|
||||
|
||||
if ('slabsize' in params) and (params['slabsize'] is not None):
|
||||
if params.get('slabsize') is not None:
|
||||
options.append("--vdoSlabSize=" + params['slabsize'])
|
||||
|
||||
if ('emulate512' in params) and (params['emulate512']):
|
||||
if params.get('emulate512'):
|
||||
options.append("--emulate512=enabled")
|
||||
|
||||
if ('indexmem' in params) and (params['indexmem'] is not None):
|
||||
if params.get('indexmem') is not None:
|
||||
options.append("--indexMem=" + params['indexmem'])
|
||||
|
||||
if ('indexmode' in params) and (params['indexmode'] == 'sparse'):
|
||||
if params.get('indexmode') == 'sparse':
|
||||
options.append("--sparseIndex=enabled")
|
||||
|
||||
if ('force' in params) and (params['force']):
|
||||
if params.get('force'):
|
||||
options.append("--force")
|
||||
|
||||
# Entering an invalid thread config results in a cryptic
|
||||
@@ -430,23 +421,21 @@ def add_vdooptions(params):
|
||||
# output a more helpful message, but one would have to log
|
||||
# onto that system to read the error. For now, heed the thread
|
||||
# limit warnings in the DOCUMENTATION section above.
|
||||
if ('ackthreads' in params) and (params['ackthreads'] is not None):
|
||||
if params.get('ackthreads') is not None:
|
||||
options.append("--vdoAckThreads=" + params['ackthreads'])
|
||||
|
||||
if ('biothreads' in params) and (params['biothreads'] is not None):
|
||||
if params.get('biothreads') is not None:
|
||||
options.append("--vdoBioThreads=" + params['biothreads'])
|
||||
|
||||
if ('cputhreads' in params) and (params['cputhreads'] is not None):
|
||||
if params.get('cputhreads') is not None:
|
||||
options.append("--vdoCpuThreads=" + params['cputhreads'])
|
||||
|
||||
if ('logicalthreads' in params) and (params['logicalthreads'] is not None):
|
||||
if params.get('logicalthreads') is not None:
|
||||
options.append("--vdoLogicalThreads=" + params['logicalthreads'])
|
||||
|
||||
if (('physicalthreads' in params) and
|
||||
(params['physicalthreads'] is not None)):
|
||||
if params.get('physicalthreads') is not None:
|
||||
options.append("--vdoPhysicalThreads=" + params['physicalthreads'])
|
||||
|
||||
vdocmdoptions = ' '.join(options)
|
||||
return vdocmdoptions
|
||||
|
||||
|
||||
@@ -530,31 +519,24 @@ def run_module():
|
||||
# Since this is a creation of a new VDO volume, it will contain all
|
||||
# all of the parameters given by the playbook; the rest will
|
||||
# assume default values.
|
||||
options = module.params
|
||||
vdocmdoptions = add_vdooptions(options)
|
||||
rc, out, err = module.run_command("%s create --name=%s --device=%s %s"
|
||||
% (vdocmd, desiredvdo, device,
|
||||
vdocmdoptions))
|
||||
vdocmdoptions = add_vdooptions(module.params)
|
||||
rc, out, err = module.run_command(
|
||||
[vdocmd, "create", "--name=%s" % desiredvdo, "--device=%s" % device] + vdocmdoptions)
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Creating VDO %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
module.fail_json(msg="Creating VDO %s failed." % desiredvdo, rc=rc, err=err)
|
||||
|
||||
if (module.params['compression'] == 'disabled'):
|
||||
rc, out, err = module.run_command("%s disableCompression --name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
if module.params['compression'] == 'disabled':
|
||||
rc, out, err = module.run_command([vdocmd, "disableCompression", "--name=%s" % desiredvdo])
|
||||
|
||||
if ((module.params['deduplication'] is not None) and
|
||||
module.params['deduplication'] == 'disabled'):
|
||||
rc, out, err = module.run_command("%s disableDeduplication "
|
||||
"--name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
if module.params['deduplication'] == 'disabled':
|
||||
rc, out, err = module.run_command([vdocmd, "disableDeduplication", "--name=%s" % desiredvdo])
|
||||
|
||||
if module.params['activated'] == 'no':
|
||||
if module.params['activated'] is False:
|
||||
deactivate_vdo(module, desiredvdo, vdocmd)
|
||||
|
||||
if module.params['running'] == 'no':
|
||||
if module.params['running'] is False:
|
||||
stop_vdo(module, desiredvdo, vdocmd)
|
||||
|
||||
# Print a post-run list of VDO volumes in the result object.
|
||||
@@ -563,8 +545,8 @@ def run_module():
|
||||
module.exit_json(**result)
|
||||
|
||||
# Modify the current parameters of a VDO that exists.
|
||||
if (desiredvdo in vdolist) and (state == 'present'):
|
||||
rc, vdostatusoutput, err = module.run_command("%s status" % (vdocmd))
|
||||
if desiredvdo in vdolist and state == 'present':
|
||||
rc, vdostatusoutput, err = module.run_command([vdocmd, "status"])
|
||||
vdostatusyaml = yaml.load(vdostatusoutput)
|
||||
|
||||
# An empty dictionary to contain dictionaries of VDO statistics
|
||||
@@ -629,7 +611,7 @@ def run_module():
|
||||
diffparams = {}
|
||||
|
||||
# Check for differences between the playbook parameters and the
|
||||
# current parameters. This will need a comparison function;
|
||||
# current parameters. This will need a comparison function;
|
||||
# since AnsibleModule params are all strings, compare them as
|
||||
# strings (but if it's None; skip).
|
||||
for key in currentparams.keys():
|
||||
@@ -640,10 +622,7 @@ def run_module():
|
||||
if diffparams:
|
||||
vdocmdoptions = add_vdooptions(diffparams)
|
||||
if vdocmdoptions:
|
||||
rc, out, err = module.run_command("%s modify --name=%s %s"
|
||||
% (vdocmd,
|
||||
desiredvdo,
|
||||
vdocmdoptions))
|
||||
rc, out, err = module.run_command([vdocmd, "modify", "--name=%s" % desiredvdo] + vdocmdoptions)
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
@@ -652,107 +631,36 @@ def run_module():
|
||||
|
||||
if 'deduplication' in diffparams.keys():
|
||||
dedupemod = diffparams['deduplication']
|
||||
if dedupemod == 'disabled':
|
||||
rc, out, err = module.run_command("%s "
|
||||
"disableDeduplication "
|
||||
"--name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
dedupeparam = "disableDeduplication" if dedupemod == 'disabled' else "enableDeduplication"
|
||||
rc, out, err = module.run_command([vdocmd, dedupeparam, "--name=%s" % desiredvdo])
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing deduplication on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
|
||||
if dedupemod == 'enabled':
|
||||
rc, out, err = module.run_command("%s "
|
||||
"enableDeduplication "
|
||||
"--name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing deduplication on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing deduplication on VDO volume %s failed." % desiredvdo, rc=rc, err=err)
|
||||
|
||||
if 'compression' in diffparams.keys():
|
||||
compressmod = diffparams['compression']
|
||||
if compressmod == 'disabled':
|
||||
rc, out, err = module.run_command("%s disableCompression "
|
||||
"--name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing compression on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
|
||||
if compressmod == 'enabled':
|
||||
rc, out, err = module.run_command("%s enableCompression "
|
||||
"--name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing compression on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
compressparam = "disableCompression" if compressmod == 'disabled' else "enableCompression"
|
||||
rc, out, err = module.run_command([vdocmd, compressparam, "--name=%s" % desiredvdo])
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing compression on VDO volume %s failed." % desiredvdo, rc=rc, err=err)
|
||||
|
||||
if 'writepolicy' in diffparams.keys():
|
||||
writepolmod = diffparams['writepolicy']
|
||||
if writepolmod == 'auto':
|
||||
rc, out, err = module.run_command("%s "
|
||||
"changeWritePolicy "
|
||||
"--name=%s "
|
||||
"--writePolicy=%s"
|
||||
% (vdocmd,
|
||||
desiredvdo,
|
||||
writepolmod))
|
||||
rc, out, err = module.run_command([
|
||||
vdocmd,
|
||||
"changeWritePolicy",
|
||||
"--name=%s" % desiredvdo,
|
||||
"--writePolicy=%s" % writepolmod,
|
||||
])
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing write policy on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
|
||||
if writepolmod == 'sync':
|
||||
rc, out, err = module.run_command("%s "
|
||||
"changeWritePolicy "
|
||||
"--name=%s "
|
||||
"--writePolicy=%s"
|
||||
% (vdocmd,
|
||||
desiredvdo,
|
||||
writepolmod))
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing write policy on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
|
||||
if writepolmod == 'async':
|
||||
rc, out, err = module.run_command("%s "
|
||||
"changeWritePolicy "
|
||||
"--name=%s "
|
||||
"--writePolicy=%s"
|
||||
% (vdocmd,
|
||||
desiredvdo,
|
||||
writepolmod))
|
||||
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing write policy on "
|
||||
"VDO volume %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Changing write policy on VDO volume %s failed." % desiredvdo, rc=rc, err=err)
|
||||
|
||||
# Process the size parameters, to determine of a growPhysical or
|
||||
# growLogical operation needs to occur.
|
||||
@@ -770,19 +678,15 @@ def run_module():
|
||||
|
||||
diffsizeparams = {}
|
||||
for key in sizeparams.keys():
|
||||
if module.params[key] is not None:
|
||||
if str(sizeparams[key]) != module.params[key]:
|
||||
diffsizeparams[key] = module.params[key]
|
||||
if module.params[key] is not None and str(sizeparams[key]) != module.params[key]:
|
||||
diffsizeparams[key] = module.params[key]
|
||||
|
||||
if module.params['growphysical']:
|
||||
physdevice = module.params['device']
|
||||
rc, devsectors, err = module.run_command("blockdev --getsz %s"
|
||||
% (physdevice))
|
||||
rc, devsectors, err = module.run_command([module.get_bin_path("blockdev"), "--getsz", physdevice])
|
||||
devblocks = (int(devsectors) / 8)
|
||||
dmvdoname = ('/dev/mapper/' + desiredvdo)
|
||||
currentvdostats = (processedvdos[desiredvdo]
|
||||
['VDO statistics']
|
||||
[dmvdoname])
|
||||
currentvdostats = processedvdos[desiredvdo]['VDO statistics'][dmvdoname]
|
||||
currentphysblocks = currentvdostats['physical blocks']
|
||||
|
||||
# Set a growPhysical threshold to grow only when there is
|
||||
@@ -794,34 +698,25 @@ def run_module():
|
||||
|
||||
if currentphysblocks > growthresh:
|
||||
result['changed'] = True
|
||||
rc, out, err = module.run_command("%s growPhysical --name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
rc, out, err = module.run_command([vdocmd, "growPhysical", "--name=%s" % desiredvdo])
|
||||
|
||||
if 'logicalsize' in diffsizeparams.keys():
|
||||
result['changed'] = True
|
||||
vdocmdoptions = ("--vdoLogicalSize=" +
|
||||
diffsizeparams['logicalsize'])
|
||||
rc, out, err = module.run_command("%s growLogical --name=%s %s"
|
||||
% (vdocmd,
|
||||
desiredvdo,
|
||||
vdocmdoptions))
|
||||
rc, out, err = module.run_command([vdocmd, "growLogical", "--name=%s" % desiredvdo, "--vdoLogicalSize=%s" % diffsizeparams['logicalsize']])
|
||||
|
||||
vdoactivatestatus = processedvdos[desiredvdo]['Activate']
|
||||
|
||||
if ((module.params['activated'] == 'no') and
|
||||
(vdoactivatestatus == 'enabled')):
|
||||
if module.params['activated'] is False and vdoactivatestatus == 'enabled':
|
||||
deactivate_vdo(module, desiredvdo, vdocmd)
|
||||
if not result['changed']:
|
||||
result['changed'] = True
|
||||
|
||||
if ((module.params['activated'] == 'yes') and
|
||||
(vdoactivatestatus == 'disabled')):
|
||||
if module.params['activated'] and vdoactivatestatus == 'disabled':
|
||||
activate_vdo(module, desiredvdo, vdocmd)
|
||||
if not result['changed']:
|
||||
result['changed'] = True
|
||||
|
||||
if ((module.params['running'] == 'no') and
|
||||
(desiredvdo in runningvdolist)):
|
||||
if module.params['running'] is False and desiredvdo in runningvdolist:
|
||||
stop_vdo(module, desiredvdo, vdocmd)
|
||||
if not result['changed']:
|
||||
result['changed'] = True
|
||||
@@ -833,10 +728,7 @@ def run_module():
|
||||
# the activate_vdo() operation succeeded, as 'vdoactivatestatus'
|
||||
# will have the activated status prior to the activate_vdo()
|
||||
# call.
|
||||
if (((vdoactivatestatus == 'enabled') or
|
||||
(module.params['activated'] == 'yes')) and
|
||||
(module.params['running'] == 'yes') and
|
||||
(desiredvdo not in runningvdolist)):
|
||||
if (vdoactivatestatus == 'enabled' or module.params['activated']) and module.params['running'] and desiredvdo not in runningvdolist:
|
||||
start_vdo(module, desiredvdo, vdocmd)
|
||||
if not result['changed']:
|
||||
result['changed'] = True
|
||||
@@ -849,14 +741,12 @@ def run_module():
|
||||
module.exit_json(**result)
|
||||
|
||||
# Remove a desired VDO that currently exists.
|
||||
if (desiredvdo in vdolist) and (state == 'absent'):
|
||||
rc, out, err = module.run_command("%s remove --name=%s"
|
||||
% (vdocmd, desiredvdo))
|
||||
if desiredvdo in vdolist and state == 'absent':
|
||||
rc, out, err = module.run_command([vdocmd, "remove", "--name=%s" % desiredvdo])
|
||||
if rc == 0:
|
||||
result['changed'] = True
|
||||
else:
|
||||
module.fail_json(msg="Removing VDO %s failed."
|
||||
% desiredvdo, rc=rc, err=err)
|
||||
module.fail_json(msg="Removing VDO %s failed." % desiredvdo, rc=rc, err=err)
|
||||
|
||||
# Print a post-run list of VDO volumes in the result object.
|
||||
vdolist = inventory_vdos(module, vdocmd)
|
||||
@@ -868,8 +758,7 @@ def run_module():
|
||||
# not exist. Print a post-run list of VDO volumes in the result
|
||||
# object.
|
||||
vdolist = inventory_vdos(module, vdocmd)
|
||||
module.log("received request to remove non-existent VDO volume %s"
|
||||
% desiredvdo)
|
||||
module.log("received request to remove non-existent VDO volume %s" % desiredvdo)
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ def main():
|
||||
# Clean up old failed deployment
|
||||
os.remove(os.path.join(deploy_path, "%s.failed" % deployment))
|
||||
|
||||
shutil.copyfile(src, os.path.join(deploy_path, deployment))
|
||||
module.preserved_copy(src, os.path.join(deploy_path, deployment))
|
||||
while not deployed:
|
||||
deployed = is_deployed(deploy_path, deployment)
|
||||
if is_failed(deploy_path, deployment):
|
||||
@@ -153,7 +153,7 @@ def main():
|
||||
if state == 'present' and deployed:
|
||||
if module.sha1(src) != module.sha1(os.path.join(deploy_path, deployment)):
|
||||
os.remove(os.path.join(deploy_path, "%s.deployed" % deployment))
|
||||
shutil.copyfile(src, os.path.join(deploy_path, deployment))
|
||||
module.preserved_copy(src, os.path.join(deploy_path, deployment))
|
||||
deployed = False
|
||||
while not deployed:
|
||||
deployed = is_deployed(deploy_path, deployment)
|
||||
|
||||
@@ -51,7 +51,7 @@ class ScalewayAPI:
|
||||
def __init__(self, auth_token, region):
|
||||
self.session = requests.session()
|
||||
self.session.headers.update({
|
||||
'User-Agent': 'Ansible Python/%s' % (sys.version.split(' ')[0])
|
||||
'User-Agent': 'Ansible Python/%s' % (sys.version.split(' ', 1)[0])
|
||||
})
|
||||
self.session.headers.update({
|
||||
'X-Auth-Token': auth_token.encode('latin1')
|
||||
|
||||
@@ -12,10 +12,10 @@ import json
|
||||
|
||||
|
||||
class SetEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
if isinstance(obj, set):
|
||||
return list(obj)
|
||||
return json.JSONEncoder.default(self, obj)
|
||||
def default(self, o):
|
||||
if isinstance(o, set):
|
||||
return list(o)
|
||||
return json.JSONEncoder.default(self, o)
|
||||
|
||||
|
||||
VBOX = "VBoxManage"
|
||||
|
||||
8
simplified_bsd.txt
Normal file
8
simplified_bsd.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user