Compare commits

...

34 Commits
3.8.1 ... 3.8.3

Author SHA1 Message Date
Felix Fontein
27c094a095 Release 3.8.3. 2021-12-14 07:06:14 +01:00
patchback[bot]
86a5b4f28c proxmox - fixing onboot parameter causing module failure when not defined (#3874) (#3901)
* fixing onboot parameter when not supplied

* adding changelog fragment

(cherry picked from commit 00a1152bb1)

Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
2021-12-14 07:00:27 +01:00
patchback[bot]
4e14c429c7 Pass missing vlan-related options (flags, ingress, egress) to nmcli (#3896) (#3898)
* Pass missing vlan-related options (flags, ingress, egress) to nmcli

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* Follow style: comma on last parameter

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* PEP8 code style fix

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* add missing changelog fragment

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
(cherry picked from commit 6cec2e2f58)

Co-authored-by: Jean-Francois Panisset <32653482+jfpanisset@users.noreply.github.com>
2021-12-13 21:59:32 +01:00
Felix Fontein
c34fb01462 Docs improvements. (#3893) (#3895)
(cherry picked from commit 59bbaeed77)
2021-12-12 11:46:34 +01:00
patchback[bot]
2086977af6 Update lxd connection to use all documented vars for options (#3798) (#3880)
* Update lxd connection to use documented vars

* Add a changelog fragment

* Add clarification to changelog description

* Shorten changelog fragment description

(cherry picked from commit 8f6866dba6)

Co-authored-by: Conner Crosby <conner@cavcrosby.tech>
2021-12-09 21:58:02 +01:00
patchback[bot]
587d221376 small docs update for timezone module (#3876) (#3877)
* small docs update for timezone module
fixes #3242

* Update plugins/modules/system/timezone.py

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

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

Co-authored-by: Anatoly Pugachev <matorola@gmail.com>
2021-12-09 21:19:00 +01:00
Felix Fontein
5ed6b38477 Prepare 3.8.3 release. 2021-12-08 20:22:31 +01:00
patchback[bot]
2c0cfe4d16 update scaleway maintainers (#3472) (#3872)
* update scaleway maintainers

* Fix

* Fix sieben -> remyleone

Co-authored-by: scaleway-bot <github@scaleway.com>
(cherry picked from commit 80d650f60a)

Co-authored-by: Rémy Léone <remy.leone@gmail.com>
2021-12-08 20:21:02 +01:00
patchback[bot]
c344d20a9a interfaces_file: unit tests improved (#3863) (#3868)
* interfaces_file: fixed unit tests and added README, added test cases for #3862

* typo fix for interfaces_file unit tests README.md

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

* typo fix for interfaces_file unit tests README.md

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

* typo fix for interfaces_file unit tests README.md

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

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

Co-authored-by: Roman Belyakovsky <ihryamzik@gmail.com>
2021-12-08 12:51:21 +01:00
patchback[bot]
53480b25c8 interfaces_file - fixed dup options bug (#3862) (#3865)
* interfaces_file - fixed dup options bug

* added changelog fragment

(cherry picked from commit 3dd5b0d343)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-12-08 05:54:44 +00:00
patchback[bot]
cfffaa5b6f Add stable-4 to nightly CI jobs; make stable-2 weekly. (#3852) (#3856)
(cherry picked from commit 727c9a4032)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-12-05 17:41:08 +01:00
patchback[bot]
726918930b opentelemetry: honour ignore errors (#3837) (#3846)
* opentelemetry: honour the ignore_errors

* fix-encoding-pragma

* Add changelog fragment

* opentelemetry: ignore produces unset span status

(cherry picked from commit ce6d0a749e)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
2021-12-04 19:55:20 +01:00
patchback[bot]
614a84d0f2 pipx - fixed --include-apps bug (#3800) (#3817)
* pipx - fixed --include-apps bug

* added changelog fragment

* skipped freebsd for the last test

(cherry picked from commit bc619bcefc)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-11-30 08:32:48 +01:00
patchback[bot]
a11022e896 ansible_galaxy_install - minor documentation fix (#3804) (#3813)
* ansible_galaxy_install - minor documentation fix

* further adjustments

(cherry picked from commit 49bdc0f218)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-11-30 06:52:55 +01:00
Andrew Pantuso
491196937d Fixing ip address without mask bug (#3784) (#3810)
* change ip6 type to list of str and fix problem with setting addresses without netmask

* change ip6 type to list of str and fix problem with setting addresses without netmask

* Add changelog fragment

* add suggestions

* fix no mask using bug

* Make change independed from feature branch

(cherry picked from commit aae3ae1a8e)

Co-authored-by: Alex Groshev <38885591+haddystuff@users.noreply.github.com>
2021-11-30 06:07:32 +01:00
Felix Fontein
af7a6dc29f Next release will be 3.8.3. 2021-11-23 07:10:11 +01:00
Felix Fontein
16ffb4ba10 Release 3.8.2. 2021-11-23 05:54:00 +01:00
Felix Fontein
31c3865251 Prepare 3.8.2 release. 2021-11-23 05:53:21 +01:00
patchback[bot]
53e0bf8297 terraform: ensuring command options are applied during build_plan (#3726) (#3777)
* Fixes parameters missing in planned state

* Added new line at end of file

* Added changelog fragment for pr 3726

* Added changes mentioned by felixfontein

* Removed blank space for pep8 validation

* Update changelogs/fragments/3726-terraform-missing-parameters-planned-fix.yml

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

* Update plugins/modules/cloud/misc/terraform.py

extend needs to be a list

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

Co-authored-by: Thomas Arringe <thomas.arringe@fouredge.se>
Co-authored-by: Thomas Arringe <Thomas.Arringe@ica.se>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 946430e1fb)

Co-authored-by: egnirra <37709886+egnirra@users.noreply.github.com>
2021-11-23 05:51:17 +01:00
patchback[bot]
9b80b14956 Fix collection dependency installation in CI. (#3753) (#3755)
(cherry picked from commit 17b4c6972f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-19 06:59:47 +01:00
patchback[bot]
be763e6ed2 CI: Replace RHEL 8.4 by RHEL 8.5 for devel (#3747) (#3748)
* Replace RHEL 8.4 by RHEL 8.5 for devel.

* Install virtualenv.

* Revert "Install virtualenv."

This reverts commit 22ba0d074e.

* Just do another skip...

(cherry picked from commit 26c7995c82)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-17 22:30:00 +01:00
patchback[bot]
4375280497 Restrict redis version. (#3733) (#3735)
(cherry picked from commit bf7a954f00)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-16 07:31:25 +01:00
patchback[bot]
ebda14ba41 Enable counter_enabled.py to support batch mode (#3709) (#3731)
* Enable counter_enabled.py to support serial mode

Enable counter_enabled.py to support batch playbook executions using the serial tag in plays. Currently, the host counter gets reset at the beginning of every task. However, during batch executions we want it to keep track of the previous batch executions and print the host counter based on the previous runs. This proposal keeps track of how many servers have been updated in previous batches and starts the host counter at that tracked value.

```
- hosts: allthethings
  gather_facts: no
  serial:
    - 3
    - 15%
    - 20%
    - 35%
    - 55%
    - 90%
    - 100%
  tasks:
    - name: Ping Hello!
      ping:
        data: "Hello!!!!"
```

* Reset task counter on play start

Reset task counter on play start for batch mode playbook executions.

* Add changelog fragment

* change changelog fragment after feedback

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

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

Co-authored-by: Nabheet Sandhu <nabheet@users.noreply.github.com>
2021-11-15 22:13:12 +01:00
patchback[bot]
c16a5f3780 Allow LDAP search to run in check mode (#3667) (#3724)
* Allow ldap search to run in check mode always

* Fix indentions

* Remove Comments and Chg Fragment

* Update changelogs/fragments/3667-ldap_search.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

Co-authored-by: Sebastian Trupiano <sebastian.trupiano@srpnet.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 115d435d2d)

Co-authored-by: sabman3 <sabman3@aol.com>
2021-11-13 15:27:43 +01:00
patchback[bot]
f6c1566924 Example command has wrong arg in redfish_command (#3711) (#3721)
Example command arg `boot_next` missing the underscore

(cherry picked from commit 4fe5d54b9e)

Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2021-11-13 14:58:49 +01:00
patchback[bot]
bffed2fda5 Rework safety check on size arguments for when LV doesn't exist (#3681) (#3719)
* Rework safety check on size arguments for when LV doesn't exist

* Update changelogs/fragments/3681-lvol-fix-create.yml

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

Co-authored-by: Jake Reynolds <jake.reynolds@bidfx.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 352047314b)

Co-authored-by: jake2184 <jake2184@users.noreply.github.com>
2021-11-13 14:34:31 +01:00
Felix Fontein
440804fd62 Replace Bash codecov uploader by new Python codecov uploader. (#3713) (#3715)
ci_coverage

(cherry picked from commit 5948809162)
2021-11-13 13:22:11 +01:00
patchback[bot]
a915a4b7c5 BOTMETA.yml: add new maintainer to gitlab team (#3696) (#3704)
(cherry picked from commit 18a17acaa4)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-11-13 10:37:08 +01:00
patchback[bot]
ed69bde7a9 Fix dummy interface returning changed (#3625) (#3687)
* fix dummy interface bug

* fix dummy interface bug

* Update nmcli.py

* Update nmcli.py

* Update nmcli.py

* Update nmcli.py

* adding tests and requested conditional

* Fix pylint problems and remove 2 lines from previous version of bugfix

* Fix pep8 issue

* add changelog

* Update changelogs/fragments/3625-nmcli_false_changed_mtu_fix.yml

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

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

Co-authored-by: Alex Groshev <38885591+haddystuff@users.noreply.github.com>
2021-11-10 08:00:30 +01:00
patchback[bot]
77700e7110 Fix docs issues. (#3682) (#3683)
(cherry picked from commit 146af089e9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-09 20:27:28 +01:00
patchback[bot]
91d445ab35 Replace Fedora 33 with Fedora 35 for devel tests (#3674) (#3679)
* Replace Fedora 33 with Fedora 35 for devel tests.

* Skip Fedora 35 for reiserfs tests.

(cherry picked from commit fc99893f10)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-09 07:05:06 +01:00
patchback[bot]
19c2af03b7 Better handling of base64-encoded values in xattr module (#3675) (#3677)
* Fix exception in xattr module when existing extended attribute's value contains non-printable characters and the base64-encoded string contains a '=' sign

* Added changelog fragment for #3675

* Apply suggestions from code review

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

Co-authored-by: sc-anssi <sc-anssi@users.noreply.github.com>
2021-11-09 06:29:01 +01:00
David Moreau Simard
58a5463ddb Fix urpmi typo in changelog (#3659)
The module is urpmi, not urmpi.
2021-11-02 19:06:49 +01:00
Felix Fontein
84941d0a7f Next expected release is 3.8.2. 2021-11-02 06:49:01 +01:00
128 changed files with 1767 additions and 123 deletions

View File

@@ -24,14 +24,15 @@ schedules:
always: true always: true
branches: branches:
include: include:
- stable-2
- stable-3 - stable-3
- stable-4
- cron: 0 11 * * 0 - cron: 0 11 * * 0
displayName: Weekly (old stable branches) displayName: Weekly (old stable branches)
always: true always: true
branches: branches:
include: include:
- stable-1 - stable-1
- stable-2
variables: variables:
- name: checkoutPath - name: checkoutPath
@@ -209,8 +210,8 @@ stages:
test: macos/11.1 test: macos/11.1
- name: RHEL 7.9 - name: RHEL 7.9
test: rhel/7.9 test: rhel/7.9
- name: RHEL 8.4 - name: RHEL 8.5
test: rhel/8.4 test: rhel/8.5
- name: FreeBSD 12.2 - name: FreeBSD 12.2
test: freebsd/12.2 test: freebsd/12.2
- name: FreeBSD 13.0 - name: FreeBSD 13.0
@@ -297,10 +298,10 @@ stages:
targets: targets:
- name: CentOS 7 - name: CentOS 7
test: centos7 test: centos7
- name: Fedora 33
test: fedora33
- name: Fedora 34 - name: Fedora 34
test: fedora34 test: fedora34
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py2 - name: openSUSE 15 py2
test: opensuse15py2 test: opensuse15py2
- name: openSUSE 15 py3 - name: openSUSE 15 py3

View File

@@ -11,7 +11,7 @@ mkdir "${agent_temp_directory}/coverage/"
options=(--venv --venv-system-site-packages --color -v) options=(--venv --venv-system-site-packages --color -v)
ansible-test coverage combine --export "${agent_temp_directory}/coverage/" "${options[@]}" ansible-test coverage combine --group-by command --export "${agent_temp_directory}/coverage/" "${options[@]}"
if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then 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. # Only analyze coverage if the installed version of ansible-test supports it.

View File

@@ -0,0 +1,101 @@
#!/usr/bin/env python
"""
Upload code coverage reports to codecov.io.
Multiple coverage files from multiple languages are accepted and aggregated after upload.
Python coverage, as well as PowerShell and Python stubs can all be uploaded.
"""
import argparse
import dataclasses
import pathlib
import shutil
import subprocess
import tempfile
import typing as t
import urllib.request
@dataclasses.dataclass(frozen=True)
class CoverageFile:
name: str
path: pathlib.Path
flags: t.List[str]
@dataclasses.dataclass(frozen=True)
class Args:
dry_run: bool
path: pathlib.Path
def parse_args() -> Args:
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--dry-run', action='store_true')
parser.add_argument('path', type=pathlib.Path)
args = parser.parse_args()
# Store arguments in a typed dataclass
fields = dataclasses.fields(Args)
kwargs = {field.name: getattr(args, field.name) for field in fields}
return Args(**kwargs)
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
processed = []
for file in directory.joinpath('reports').glob('coverage*.xml'):
name = file.stem.replace('coverage=', '')
# Get flags from name
flags = name.replace('-powershell', '').split('=') # Drop '-powershell' suffix
flags = [flag if not flag.startswith('stub') else flag.split('-')[0] for flag in flags] # Remove "-01" from stub files
processed.append(CoverageFile(name, file, flags))
return tuple(processed)
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
for file in files:
cmd = [
str(codecov_bin),
'--name', file.name,
'--file', str(file.path),
]
for flag in file.flags:
cmd.extend(['--flags', flag])
if dry_run:
print(f'DRY-RUN: Would run command: {cmd}')
continue
subprocess.run(cmd, check=True)
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None:
if dry_run:
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
return
with urllib.request.urlopen(url) as resp:
with dest.open('w+b') as f:
# Read data in chunks rather than all at once
shutil.copyfileobj(resp, f, 64 * 1024)
dest.chmod(flags)
def main():
args = parse_args()
url = 'https://ansible-ci-files.s3.amazonaws.com/codecov/linux/codecov'
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
download_file(url, codecov_bin, 0o755, args.dry_run)
files = process_files(args.path)
upload_files(codecov_bin, files, args.dry_run)
if __name__ == '__main__':
main()

View File

@@ -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

View File

@@ -12,4 +12,4 @@ if ! ansible-test --help >/dev/null 2>&1; then
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
fi fi
ansible-test coverage xml --stub --venv --venv-system-site-packages --color -v ansible-test coverage xml --group-by command --stub --venv --venv-system-site-packages --color -v

View File

@@ -33,7 +33,7 @@ jobs:
summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml" summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml"
displayName: Publish to Azure Pipelines displayName: Publish to Azure Pipelines
condition: gt(variables.coverageFileCount, 0) condition: gt(variables.coverageFileCount, 0)
- bash: .azure-pipelines/scripts/publish-codecov.sh "$(outputPath)" - bash: .azure-pipelines/scripts/publish-codecov.py "$(outputPath)"
displayName: Publish to codecov.io displayName: Publish to codecov.io
condition: gt(variables.coverageFileCount, 0) condition: gt(variables.coverageFileCount, 0)
continueOnError: true continueOnError: true

12
.github/BOTMETA.yml vendored
View File

@@ -156,7 +156,7 @@ files:
maintainers: conloos maintainers: conloos
$inventories/nmap.py: {} $inventories/nmap.py: {}
$inventories/online.py: $inventories/online.py:
maintainers: sieben maintainers: remyleone
$inventories/opennebula.py: $inventories/opennebula.py:
maintainers: feldsam maintainers: feldsam
labels: cloud opennebula labels: cloud opennebula
@@ -339,7 +339,7 @@ files:
$modules/cloud/oneandone/: $modules/cloud/oneandone/:
maintainers: aajdinov edevenport maintainers: aajdinov edevenport
$modules/cloud/online/: $modules/cloud/online/:
maintainers: sieben maintainers: remyleone
$modules/cloud/opennebula/: $modules/cloud/opennebula/:
maintainers: $team_opennebula maintainers: $team_opennebula
$modules/cloud/opennebula/one_host.py: $modules/cloud/opennebula/one_host.py:
@@ -409,11 +409,11 @@ files:
$modules/cloud/scaleway/scaleway_ip_info.py: $modules/cloud/scaleway/scaleway_ip_info.py:
maintainers: Spredzy maintainers: Spredzy
$modules/cloud/scaleway/scaleway_organization_info.py: $modules/cloud/scaleway/scaleway_organization_info.py:
maintainers: sieben Spredzy maintainers: Spredzy
$modules/cloud/scaleway/scaleway_security_group.py: $modules/cloud/scaleway/scaleway_security_group.py:
maintainers: DenBeke maintainers: DenBeke
$modules/cloud/scaleway/scaleway_security_group_info.py: $modules/cloud/scaleway/scaleway_security_group_info.py:
maintainers: sieben Spredzy maintainers: Spredzy
$modules/cloud/scaleway/scaleway_security_group_rule.py: $modules/cloud/scaleway/scaleway_security_group_rule.py:
maintainers: DenBeke maintainers: DenBeke
$modules/cloud/scaleway/scaleway_server_info.py: $modules/cloud/scaleway/scaleway_server_info.py:
@@ -1221,7 +1221,7 @@ macros:
team_cyberark_conjur: jvanderhoof ryanprior team_cyberark_conjur: jvanderhoof ryanprior
team_e_spirit: MatrixCrawler getjack team_e_spirit: MatrixCrawler getjack
team_flatpak: JayKayy oolongbrothers team_flatpak: JayKayy oolongbrothers
team_gitlab: Lunik Shaps dj-wasabi marwatk waheedi zanssa scodeman metanovii team_gitlab: Lunik Shaps dj-wasabi marwatk waheedi zanssa scodeman metanovii sh0shin
team_hpux: bcoca davx8342 team_hpux: bcoca davx8342
team_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2 team_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2
team_ipa: Akasurde Nosmoht fxfitz justchris1 team_ipa: Akasurde Nosmoht fxfitz justchris1
@@ -1236,7 +1236,7 @@ macros:
team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16 team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16
team_redfish: mraineri tomasg2012 xmadsen renxulei team_redfish: mraineri tomasg2012 xmadsen renxulei
team_rhn: FlossWare alikins barnabycourt vritant team_rhn: FlossWare alikins barnabycourt vritant
team_scaleway: QuentinBrosse abarbare jerome-quere kindermoumoute remyleone sieben team_scaleway: remyleone abarbare
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor
team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso

View File

@@ -6,6 +6,47 @@ Community General Release Notes
This changelog describes changes after version 2.0.0. This changelog describes changes after version 2.0.0.
v3.8.3
======
Release Summary
---------------
Regular bugfix release.
Minor Changes
-------------
- lxd connection plugin - make sure that ``ansible_lxd_host``, ``ansible_executable``, and ``ansible_lxd_executable`` work (https://github.com/ansible-collections/community.general/pull/3798).
Bugfixes
--------
- interfaces_file - fixed the check for existing option in interface (https://github.com/ansible-collections/community.general/issues/3841).
- nmcli - fix returning "changed" when no mask set for IPv4 or IPv6 addresses on task rerun (https://github.com/ansible-collections/community.general/issues/3768).
- nmcli - pass ``flags``, ``ingress``, ``egress`` params to ``nmcli`` (https://github.com/ansible-collections/community.general/issues/1086).
- opentelemetry_plugin - honour ``ignore_errors`` when a task has failed instead of reporting an error (https://github.com/ansible-collections/community.general/pull/3837).
- pipx - passes the correct command line option ``--include-apps`` (https://github.com/ansible-collections/community.general/issues/3791).
- proxmox - fixed ``onboot`` parameter causing module failures when undefined (https://github.com/ansible-collections/community.general/issues/3844).
v3.8.2
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- counter_enabled callback plugin - fix output to correctly display host and task counters in serial mode (https://github.com/ansible-collections/community.general/pull/3709).
- ldap_search - allow it to be used even in check mode (https://github.com/ansible-collections/community.general/issues/3619).
- lvol - allows logical volumes to be created with certain size arguments prefixed with ``+`` to preserve behavior of older versions of this module (https://github.com/ansible-collections/community.general/issues/3665).
- nmcli - fixed falsely reported changed status when ``mtu`` is omitted with ``dummy`` connections (https://github.com/ansible-collections/community.general/issues/3612, https://github.com/ansible-collections/community.general/pull/3625).
- terraform - fix command options being ignored during planned/plan in function ``build_plan`` such as ``lock`` or ``lock_timeout`` (https://github.com/ansible-collections/community.general/issues/3707, https://github.com/ansible-collections/community.general/pull/3726).
- 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).
v3.8.1 v3.8.1
====== ======
@@ -899,7 +940,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). - 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). - 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). - 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). - xbps - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
- xfconf - returning output as facts is deprecated, this will be removed in community.general 4.0.0. Please register the task output in a variable and use it instead. You can already switch to the new behavior now by using the new ``disable_facts`` option (https://github.com/ansible-collections/community.general/pull/1747). - xfconf - returning output as facts is deprecated, this will be removed in community.general 4.0.0. Please register the task output in a variable and use it instead. You can already switch to the new behavior now by using the new ``disable_facts`` option (https://github.com/ansible-collections/community.general/pull/1747).

View File

@@ -286,7 +286,7 @@ releases:
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830). - 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 - slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). 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). 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 - xbps - deprecated invalid parameter alias ``update-cache``, will be removed
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
@@ -1978,3 +1978,55 @@ releases:
- 3626-fix-one_image-error.yml - 3626-fix-one_image-error.yml
- 3649-proxmox_group_info_TypeError.yml - 3649-proxmox_group_info_TypeError.yml
release_date: '2021-11-02' release_date: '2021-11-02'
3.8.2:
changes:
bugfixes:
- counter_enabled callback plugin - fix output to correctly display host and
task counters in serial mode (https://github.com/ansible-collections/community.general/pull/3709).
- ldap_search - allow it to be used even in check mode (https://github.com/ansible-collections/community.general/issues/3619).
- lvol - allows logical volumes to be created with certain size arguments prefixed
with ``+`` to preserve behavior of older versions of this module (https://github.com/ansible-collections/community.general/issues/3665).
- nmcli - fixed falsely reported changed status when ``mtu`` is omitted with
``dummy`` connections (https://github.com/ansible-collections/community.general/issues/3612,
https://github.com/ansible-collections/community.general/pull/3625).
- terraform - fix command options being ignored during planned/plan in function
``build_plan`` such as ``lock`` or ``lock_timeout`` (https://github.com/ansible-collections/community.general/issues/3707,
https://github.com/ansible-collections/community.general/pull/3726).
- 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).
release_summary: Regular bugfix release.
fragments:
- 3.8.2.yml
- 3625-nmcli_false_changed_mtu_fix.yml
- 3667-ldap_search.yml
- 3675-xattr-handle-base64-values.yml
- 3681-lvol-fix-create.yml
- 3709-support-batch-mode.yml
- 3726-terraform-missing-parameters-planned-fix.yml
release_date: '2021-11-23'
3.8.3:
changes:
bugfixes:
- interfaces_file - fixed the check for existing option in interface (https://github.com/ansible-collections/community.general/issues/3841).
- nmcli - fix returning "changed" when no mask set for IPv4 or IPv6 addresses
on task rerun (https://github.com/ansible-collections/community.general/issues/3768).
- nmcli - pass ``flags``, ``ingress``, ``egress`` params to ``nmcli`` (https://github.com/ansible-collections/community.general/issues/1086).
- opentelemetry_plugin - honour ``ignore_errors`` when a task has failed instead
of reporting an error (https://github.com/ansible-collections/community.general/pull/3837).
- pipx - passes the correct command line option ``--include-apps`` (https://github.com/ansible-collections/community.general/issues/3791).
- proxmox - fixed ``onboot`` parameter causing module failures when undefined
(https://github.com/ansible-collections/community.general/issues/3844).
minor_changes:
- lxd connection plugin - make sure that ``ansible_lxd_host``, ``ansible_executable``,
and ``ansible_lxd_executable`` work (https://github.com/ansible-collections/community.general/pull/3798).
release_summary: Regular bugfix release.
fragments:
- 3.8.3.yml
- 3768-nmcli_fix_changed_when_no_mask_set.yml
- 3798-fix-lxd-connection-option-vars-support.yml
- 3800-pipx-include-apps.yaml
- 3837-opentelemetry_plugin-honour_ignore_errors.yaml
- 3862-interfaces-file-fix-dup-option.yaml
- 3874-proxmox-fix-onboot-param.yml
- 3896-nmcli_vlan_missing_options.yaml
release_date: '2021-12-14'

View File

@@ -1,6 +1,6 @@
namespace: community namespace: community
name: general name: general
version: 3.8.1 version: 3.8.3
readme: README.md readme: README.md
authors: authors:
- Ansible (https://github.com/ansible) - Ansible (https://github.com/ansible)

View File

@@ -45,6 +45,8 @@ class CallbackModule(CallbackBase):
_task_total = 0 _task_total = 0
_host_counter = 1 _host_counter = 1
_host_total = 0 _host_total = 0
_current_batch_total = 0
_previous_batch_total = 0
def __init__(self): def __init__(self):
super(CallbackModule, self).__init__() super(CallbackModule, self).__init__()
@@ -76,8 +78,11 @@ class CallbackModule(CallbackBase):
self._display.banner(msg) self._display.banner(msg)
self._play = play self._play = play
self._previous_batch_total = self._current_batch_total
self._current_batch_total = self._previous_batch_total + len(self._all_vars()['vars']['ansible_play_batch'])
self._host_total = len(self._all_vars()['vars']['ansible_play_hosts_all']) self._host_total = len(self._all_vars()['vars']['ansible_play_hosts_all'])
self._task_total = len(self._play.get_tasks()[0]) self._task_total = len(self._play.get_tasks()[0])
self._task_counter = 1
def v2_playbook_on_stats(self, stats): def v2_playbook_on_stats(self, stats):
self._display.banner("PLAY RECAP") self._display.banner("PLAY RECAP")
@@ -145,7 +150,7 @@ class CallbackModule(CallbackBase):
path = task.get_path() path = task.get_path()
if path: if path:
self._display.display("task path: %s" % path, color=C.COLOR_DEBUG) self._display.display("task path: %s" % path, color=C.COLOR_DEBUG)
self._host_counter = 0 self._host_counter = self._previous_batch_total
self._task_counter += 1 self._task_counter += 1
def v2_runner_on_ok(self, result): def v2_runner_on_ok(self, result):

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# (C) 2021, Victor Martinez <VictorMartinezRubio@gmail.com> # (C) 2021, Victor Martinez <VictorMartinezRubio@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -263,6 +264,8 @@ class OpenTelemetrySource(object):
else: else:
message = 'skipped' message = 'skipped'
status = Status(status_code=StatusCode.UNSET) status = Status(status_code=StatusCode.UNSET)
elif host_data.status == 'ignored':
status = Status(status_code=StatusCode.UNSET)
span.set_status(status) span.set_status(status)
self.set_span_attribute(span, "ansible.task.args", task_data.args) self.set_span_attribute(span, "ansible.task.args", task_data.args)
@@ -392,10 +395,15 @@ class CallbackModule(CallbackBase):
) )
def v2_runner_on_failed(self, result, ignore_errors=False): def v2_runner_on_failed(self, result, ignore_errors=False):
self.errors += 1 if ignore_errors:
status = 'ignored'
else:
status = 'failed'
self.errors += 1
self.opentelemetry.finish_task( self.opentelemetry.finish_task(
self.tasks_data, self.tasks_data,
'failed', status,
result result
) )

View File

@@ -89,9 +89,9 @@ class Connection(ConnectionBase):
local_cmd.extend(["--project", self.get_option("project")]) local_cmd.extend(["--project", self.get_option("project")])
local_cmd.extend([ local_cmd.extend([
"exec", "exec",
"%s:%s" % (self.get_option("remote"), self._host), "%s:%s" % (self.get_option("remote"), self.get_option("remote_addr")),
"--", "--",
self._play_context.executable, "-c", cmd self.get_option("executable"), "-c", cmd
]) ])
local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd] local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
@@ -126,7 +126,7 @@ class Connection(ConnectionBase):
local_cmd.extend([ local_cmd.extend([
"file", "push", "file", "push",
in_path, in_path,
"%s:%s/%s" % (self.get_option("remote"), self._host, out_path) "%s:%s/%s" % (self.get_option("remote"), self.get_option("remote_addr"), out_path)
]) ])
local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd] local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
@@ -145,7 +145,7 @@ class Connection(ConnectionBase):
local_cmd.extend(["--project", self.get_option("project")]) local_cmd.extend(["--project", self.get_option("project")])
local_cmd.extend([ local_cmd.extend([
"file", "pull", "file", "pull",
"%s:%s/%s" % (self.get_option("remote"), self._host, in_path), "%s:%s/%s" % (self.get_option("remote"), self.get_option("remote_addr"), in_path),
out_path out_path
]) ])

View File

@@ -8,7 +8,7 @@ __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r'''
name: online name: online
author: author:
- Remy Leone (@sieben) - Remy Leone (@remyleone)
short_description: Scaleway (previously Online SAS or Online.net) inventory source short_description: Scaleway (previously Online SAS or Online.net) inventory source
description: description:
- Get inventory hosts from Scaleway (previously Online SAS or Online.net). - Get inventory hosts from Scaleway (previously Online SAS or Online.net).

View File

@@ -9,7 +9,7 @@ __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r'''
name: scaleway name: scaleway
author: author:
- Remy Leone (@sieben) - Remy Leone (@remyleone)
short_description: Scaleway inventory source short_description: Scaleway inventory source
description: description:
- Get inventory hosts from Scaleway. - Get inventory hosts from Scaleway.

View File

@@ -93,7 +93,7 @@ DOCUMENTATION = '''
environment variable and keep I(endpoints), I(host), and I(port) unused. environment variable and keep I(endpoints), I(host), and I(port) unused.
seealso: seealso:
- module: community.general.etcd3 - module: community.general.etcd3
- ref: etcd_lookup - ref: ansible_collections.community.general.etcd_lookup
description: The etcd v2 lookup. description: The etcd v2 lookup.
requirements: requirements:

View File

@@ -54,6 +54,17 @@ def proxmox_to_ansible_bool(value):
return True if value == 1 else False return True if value == 1 else False
def ansible_to_proxmox_bool(value):
'''Convert Ansible representation of a boolean to be proxmox-friendly'''
if value is None:
return None
if not isinstance(value, bool):
raise ValueError("%s must be of type bool not %s" % (value, type(value)))
return 1 if value else 0
class ProxmoxAnsible(object): class ProxmoxAnsible(object):
"""Base class for Proxmox modules""" """Base class for Proxmox modules"""
def __init__(self, module): def __init__(self, module):

View File

@@ -374,6 +374,10 @@ except ImportError:
from ansible.module_utils.basic import AnsibleModule, env_fallback from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.general.plugins.module_utils.proxmox import (
ansible_to_proxmox_bool
)
VZ_TYPE = None VZ_TYPE = None
@@ -627,14 +631,14 @@ def main():
netif=module.params['netif'], netif=module.params['netif'],
mounts=module.params['mounts'], mounts=module.params['mounts'],
ip_address=module.params['ip_address'], ip_address=module.params['ip_address'],
onboot=int(module.params['onboot']), onboot=ansible_to_proxmox_bool(module.params['onboot']),
cpuunits=module.params['cpuunits'], cpuunits=module.params['cpuunits'],
nameserver=module.params['nameserver'], nameserver=module.params['nameserver'],
searchdomain=module.params['searchdomain'], searchdomain=module.params['searchdomain'],
force=int(module.params['force']), force=ansible_to_proxmox_bool(module.params['force']),
pubkey=module.params['pubkey'], pubkey=module.params['pubkey'],
features=",".join(module.params['features']) if module.params['features'] is not None else None, features=",".join(module.params['features']) if module.params['features'] is not None else None,
unprivileged=int(module.params['unprivileged']), unprivileged=ansible_to_proxmox_bool(module.params['unprivileged']),
description=module.params['description'], description=module.params['description'],
hookscript=module.params['hookscript']) hookscript=module.params['hookscript'])

View File

@@ -319,11 +319,25 @@ def remove_workspace(bin_path, project_path, workspace):
_workspace_cmd(bin_path, project_path, 'delete', workspace) _workspace_cmd(bin_path, project_path, 'delete', workspace)
def build_plan(command, project_path, variables_args, state_file, targets, state, plan_path=None): def build_plan(command, project_path, variables_args, state_file, targets, state, apply_args, plan_path=None):
if plan_path is None: if plan_path is None:
f, plan_path = tempfile.mkstemp(suffix='.tfplan') f, plan_path = tempfile.mkstemp(suffix='.tfplan')
plan_command = [command[0], 'plan', '-input=false', '-no-color', '-detailed-exitcode', '-out', plan_path] local_command = command.copy()
plan_command = [command[0], 'plan']
if state == "planned":
for c in local_command[1:]:
plan_command.append(c)
if state == "present":
for a in apply_args:
local_command.remove(a)
for c in local_command[1:]:
plan_command.append(c)
plan_command.extend(['-input=false', '-no-color', '-detailed-exitcode', '-out', plan_path])
for t in targets: for t in targets:
plan_command.extend(['-target', t]) plan_command.extend(['-target', t])
@@ -461,7 +475,7 @@ def main():
module.fail_json(msg='Could not find plan_file "{0}", check the path and try again.'.format(plan_file)) module.fail_json(msg='Could not find plan_file "{0}", check the path and try again.'.format(plan_file))
else: else:
plan_file, needs_application, out, err, command = build_plan(command, project_path, variables_args, state_file, plan_file, needs_application, out, err, command = build_plan(command, project_path, variables_args, state_file,
module.params.get('targets'), state, plan_file) module.params.get('targets'), state, APPLY_ARGS, plan_file)
if state == 'present' and check_destroy and '- destroy' in out: if state == 'present' and check_destroy and '- destroy' in out:
module.fail_json(msg="Aborting command because it would destroy some resources. " module.fail_json(msg="Aborting command because it would destroy some resources. "
"Consider switching the 'check_destroy' to false to suppress this error") "Consider switching the 'check_destroy' to false to suppress this error")

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the servers. - Gather information about the servers.
- U(https://www.online.net/en/dedicated-server) - U(https://www.online.net/en/dedicated-server)
author: author:
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.online - community.general.online

View File

@@ -12,7 +12,7 @@ short_description: Gather information about Online user.
description: description:
- Gather information about the user. - Gather information about the user.
author: author:
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.online - community.general.online
''' '''

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_compute module: scaleway_compute
short_description: Scaleway compute management module short_description: Scaleway compute management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- "This module manages compute instances on Scaleway." - "This module manages compute instances on Scaleway."
extends_documentation_fragment: extends_documentation_fragment:

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway images available. - Gather information about the Scaleway images available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -13,7 +13,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_ip module: scaleway_ip
short_description: Scaleway IP management module short_description: Scaleway IP management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- This module manages IP on Scaleway account - This module manages IP on Scaleway account
U(https://developer.scaleway.com) U(https://developer.scaleway.com)

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway ips available. - Gather information about the Scaleway ips available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_lb module: scaleway_lb
short_description: Scaleway load-balancer management module short_description: Scaleway load-balancer management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- "This module manages load-balancers on Scaleway." - "This module manages load-balancers on Scaleway."
extends_documentation_fragment: extends_documentation_fragment:

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway organizations available. - Gather information about the Scaleway organizations available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
options: options:
api_url: api_url:
description: description:

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway security groups available. - Gather information about the Scaleway security groups available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
options: options:
region: region:
type: str type: str

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway servers available. - Gather information about the Scaleway servers available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway snapshot available. - Gather information about the Scaleway snapshot available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_sshkey module: scaleway_sshkey
short_description: Scaleway SSH keys management module short_description: Scaleway SSH keys management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- This module manages SSH keys on Scaleway account - This module manages SSH keys on Scaleway account
U(https://developer.scaleway.com) U(https://developer.scaleway.com)

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_user_data module: scaleway_user_data
short_description: Scaleway user_data management module short_description: Scaleway user_data management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- "This module manages user_data on compute instances on Scaleway." - "This module manages user_data on compute instances on Scaleway."
- "It can be used to configure cloud-init for instance" - "It can be used to configure cloud-init for instance"

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway volumes available. - Gather information about the Scaleway volumes available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -84,7 +84,7 @@ options:
description: description:
- the address to advertise that the service will be listening on. - the address to advertise that the service will be listening on.
This value will be passed as the I(address) parameter to Consul's This value will be passed as the I(address) parameter to Consul's
U(/v1/agent/service/register) API method, so refer to the Consul API C(/v1/agent/service/register) API method, so refer to the Consul API
documentation for further details. documentation for further details.
tags: tags:
type: list type: list

View File

@@ -26,6 +26,7 @@ extends_documentation_fragment:
- community.general.redis - community.general.redis
seealso: seealso:
- module: community.general.redis_data
- module: community.general.redis_info - module: community.general.redis_info
- module: community.general.redis - module: community.general.redis
''' '''

View File

@@ -158,7 +158,7 @@ def _run_xattr(module, cmd, check_rc=True):
if line.startswith('#') or line == '': if line.startswith('#') or line == '':
pass pass
elif '=' in line: elif '=' in line:
(key, val) = line.split('=') (key, val) = line.split('=', 1)
result[key] = val.strip('"') result[key] = val.strip('"')
else: else:
result[line] = '' result[line] = ''

View File

@@ -106,11 +106,10 @@ def main():
module.fail_json(msg=missing_required_lib('python-ldap'), module.fail_json(msg=missing_required_lib('python-ldap'),
exception=LDAP_IMP_ERR) exception=LDAP_IMP_ERR)
if not module.check_mode: try:
try: LdapSearch(module).main()
LdapSearch(module).main() except Exception as exception:
except Exception as exception: module.fail_json(msg="Attribute action failed.", details=to_native(exception))
module.fail_json(msg="Attribute action failed.", details=to_native(exception))
module.exit_json(changed=False) module.exit_json(changed=False)

View File

@@ -70,7 +70,7 @@ options:
ip4: ip4:
description: description:
- The IPv4 address to this interface. - The IPv4 address to this interface.
- Use the format C(192.0.2.24/24). - Use the format C(192.0.2.24/24) or C(192.0.2.24).
- If defined and I(method4) is not specified, automatically set C(ipv4.method) to C(manual). - If defined and I(method4) is not specified, automatically set C(ipv4.method) to C(manual).
type: str type: str
gw4: gw4:
@@ -143,7 +143,7 @@ options:
ip6: ip6:
description: description:
- The IPv6 address to this interface. - The IPv6 address to this interface.
- Use the format C(abbe::cafe). - Use the format C(abbe::cafe/128 or abbe::cafe).
- If defined and I(method6) is not specified, automatically set C(ipv6.method) to C(manual). - If defined and I(method6) is not specified, automatically set C(ipv6.method) to C(manual).
type: str type: str
gw6: gw6:
@@ -1241,7 +1241,7 @@ class Nmcli(object):
# IP address options. # IP address options.
if self.ip_conn_type and not self.master: if self.ip_conn_type and not self.master:
options.update({ options.update({
'ipv4.addresses': self.ip4, 'ipv4.addresses': self.enforce_ipv4_cidr_notation(self.ip4),
'ipv4.dhcp-client-id': self.dhcp_client_id, 'ipv4.dhcp-client-id': self.dhcp_client_id,
'ipv4.dns': self.dns4, 'ipv4.dns': self.dns4,
'ipv4.dns-search': self.dns4_search, 'ipv4.dns-search': self.dns4_search,
@@ -1254,7 +1254,7 @@ class Nmcli(object):
'ipv4.never-default': self.never_default4, 'ipv4.never-default': self.never_default4,
'ipv4.method': self.ipv4_method, 'ipv4.method': self.ipv4_method,
'ipv4.may-fail': self.may_fail4, 'ipv4.may-fail': self.may_fail4,
'ipv6.addresses': self.ip6, 'ipv6.addresses': self.enforce_ipv6_cidr_notation(self.ip6),
'ipv6.dns': self.dns6, 'ipv6.dns': self.dns6,
'ipv6.dns-search': self.dns6_search, 'ipv6.dns-search': self.dns6_search,
'ipv6.ignore-auto-dns': self.dns6_ignore_auto, 'ipv6.ignore-auto-dns': self.dns6_ignore_auto,
@@ -1332,6 +1332,9 @@ class Nmcli(object):
options.update({ options.update({
'vlan.id': self.vlanid, 'vlan.id': self.vlanid,
'vlan.parent': self.vlandev, 'vlan.parent': self.vlandev,
'vlan.flags': self.flags,
'vlan.ingress': self.ingress,
'vlan.egress': self.egress,
}) })
elif self.type == 'vxlan': elif self.type == 'vxlan':
options.update({ options.update({
@@ -1444,6 +1447,22 @@ class Nmcli(object):
'sit', 'sit',
) )
@staticmethod
def enforce_ipv4_cidr_notation(ip4_address):
if ip4_address is None or '/' in ip4_address:
return ip4_address
return ip4_address + '/32'
@staticmethod
def enforce_ipv6_cidr_notation(ip6_address):
if ip6_address is None:
return None
elif '/' in ip6_address:
return ip6_address
else:
return ip6_address + '/128'
@staticmethod @staticmethod
def bool_to_string(boolean): def bool_to_string(boolean):
if boolean: if boolean:
@@ -1695,6 +1714,8 @@ class Nmcli(object):
# Depending on version nmcli adds double-qoutes to gsm.apn # Depending on version nmcli adds double-qoutes to gsm.apn
# Need to strip them in order to compare both # Need to strip them in order to compare both
current_value = current_value.strip('"') current_value = current_value.strip('"')
if key == self.mtu_setting and self.mtu is None:
self.mtu = 0
else: else:
# parameter does not exist # parameter does not exist
current_value = None current_value = None
@@ -1703,6 +1724,8 @@ class Nmcli(object):
# compare values between two lists # compare values between two lists
if sorted(current_value) != sorted(value): if sorted(current_value) != sorted(value):
changed = True changed = True
elif all([key == self.mtu_setting, self.type == 'dummy', current_value is None, value == 'auto', self.mtu is None]):
value = None
else: else:
if current_value != to_text(value): if current_value != to_text(value):
changed = True changed = True

View File

@@ -127,7 +127,7 @@ ansible_sysname:
type: str type: str
sample: ubuntu-user sample: ubuntu-user
ansible_syslocation: ansible_syslocation:
description: The physical location of this node (e.g., `telephone closet, 3rd floor'). description: The physical location of this node (e.g., C(telephone closet, 3rd floor)).
returned: success returned: success
type: str type: str
sample: Sitting on the Dock of the Bay sample: Sitting on the Dock of the Bay

View File

@@ -10,7 +10,7 @@ __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = """
module: ansible_galaxy_install module: ansible_galaxy_install
author: author:
- "Alexei Znamensky (@russoz)" - "Alexei Znamensky (@russoz)"
short_description: Install Ansible roles or collections using ansible-galaxy short_description: Install Ansible roles or collections using ansible-galaxy
version_added: 3.5.0 version_added: 3.5.0
description: description:
@@ -24,44 +24,46 @@ requirements:
options: options:
type: type:
description: description:
- The type of installation performed by C(ansible-galaxy). - The type of installation performed by C(ansible-galaxy).
- If I(type) is C(both), then I(requirements_file) must be passed and it may contain both roles and collections. - If I(type) is C(both), then I(requirements_file) must be passed and it may contain both roles and collections.
- "Note however that the opposite is not true: if using a I(requirements_file), then I(type) can be any of the three choices." - "Note however that the opposite is not true: if using a I(requirements_file), then I(type) can be any of the three choices."
- "B(Ansible 2.9): The option C(both) will have the same effect as C(role)." - "B(Ansible 2.9): The option C(both) will have the same effect as C(role)."
type: str type: str
choices: [collection, role, both] choices: [collection, role, both]
required: true required: true
name: name:
description: description:
- Name of the collection or role being installed. - Name of the collection or role being installed.
- Versions can be specified with C(ansible-galaxy) usual formats. For example, C(community.docker:1.6.1) or C(ansistrano.deploy,3.8.0). - >
- I(name) and I(requirements_file) are mutually exclusive. Versions can be specified with C(ansible-galaxy) usual formats.
For example, the collection C(community.docker:1.6.1) or the role C(ansistrano.deploy,3.8.0).
- I(name) and I(requirements_file) are mutually exclusive.
type: str type: str
requirements_file: requirements_file:
description: description:
- Path to a file containing a list of requirements to be installed. - Path to a file containing a list of requirements to be installed.
- It works for I(type) equals to C(collection) and C(role). - It works for I(type) equals to C(collection) and C(role).
- I(name) and I(requirements_file) are mutually exclusive. - I(name) and I(requirements_file) are mutually exclusive.
- "B(Ansible 2.9): It can only be used to install either I(type=role) or I(type=collection), but not both at the same run." - "B(Ansible 2.9): It can only be used to install either I(type=role) or I(type=collection), but not both at the same run."
type: path type: path
dest: dest:
description: description:
- The path to the directory containing your collections or roles, according to the value of I(type). - The path to the directory containing your collections or roles, according to the value of I(type).
- > - >
Please notice that C(ansible-galaxy) will not install collections with I(type=both), when I(requirements_file) Please notice that C(ansible-galaxy) will not install collections with I(type=both), when I(requirements_file)
contains both roles and collections and I(dest) is specified. contains both roles and collections and I(dest) is specified.
type: path type: path
force: force:
description: description:
- Force overwriting an existing role or collection. - Force overwriting an existing role or collection.
- Using I(force=true) is mandatory when downgrading. - Using I(force=true) is mandatory when downgrading.
- "B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections." - "B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections."
type: bool type: bool
default: false default: false
ack_ansible29: ack_ansible29:
description: description:
- Acknowledge using Ansible 2.9 with its limitations, and prevents the module from generating warnings about them. - Acknowledge using Ansible 2.9 with its limitations, and prevents the module from generating warnings about them.
- This option is completely ignored if using a version Ansible greater than C(2.9.x). - This option is completely ignored if using a version of Ansible greater than C(2.9.x).
type: bool type: bool
default: false default: false
""" """
@@ -114,9 +116,9 @@ RETURN = """
returned: always returned: always
installed_roles: installed_roles:
description: description:
- If I(requirements_file) is specified instead, returns dictionary with all the roles installed per path. - If I(requirements_file) is specified instead, returns dictionary with all the roles installed per path.
- If I(name) is specified, returns that role name and the version installed per path. - If I(name) is specified, returns that role name and the version installed per path.
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand." - "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
type: dict type: dict
returned: always when installing roles returned: always when installing roles
contains: contains:
@@ -131,9 +133,9 @@ RETURN = """
ansistrano.deploy: 3.8.0 ansistrano.deploy: 3.8.0
installed_collections: installed_collections:
description: description:
- If I(requirements_file) is specified instead, returns dictionary with all the collections installed per path. - If I(requirements_file) is specified instead, returns dictionary with all the collections installed per path.
- If I(name) is specified, returns that collection name and the version installed per path. - If I(name) is specified, returns that collection name and the version installed per path.
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand." - "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
type: dict type: dict
returned: always when installing collections returned: always when installing collections
contains: contains:

View File

@@ -167,7 +167,7 @@ class PipX(CmdStateModuleHelper):
command_args_formats = dict( command_args_formats = dict(
state=dict(fmt=lambda v: [_state_map.get(v, v)]), state=dict(fmt=lambda v: [_state_map.get(v, v)]),
name_source=dict(fmt=lambda n, s: [s] if s else [n], stars=1), name_source=dict(fmt=lambda n, s: [s] if s else [n], stars=1),
install_deps=dict(fmt="--install-deps", style=ArgFormat.BOOLEAN), install_deps=dict(fmt="--include-deps", style=ArgFormat.BOOLEAN),
inject_packages=dict(fmt=lambda v: v), inject_packages=dict(fmt=lambda v: v),
force=dict(fmt="--force", style=ArgFormat.BOOLEAN), force=dict(fmt="--force", style=ArgFormat.BOOLEAN),
include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN), include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN),

View File

@@ -307,7 +307,7 @@ EXAMPLES = '''
community.general.redfish_command: community.general.redfish_command:
category: Systems category: Systems
command: SetOneTimeBoot command: SetOneTimeBoot
bootnext: BiosSetup boot_next: BiosSetup
boot_override_mode: Legacy boot_override_mode: Legacy
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"

View File

@@ -253,7 +253,7 @@ def set_interface_option(module, lines, iface, option, raw_value, state, address
last_line_dict = iface_lines[-1] last_line_dict = iface_lines[-1]
return add_option_after_line(option, value, iface, lines, last_line_dict, iface_options, address_family) return add_option_after_line(option, value, iface, lines, last_line_dict, iface_options, address_family)
if option in ["pre-up", "up", "down", "post-up"] and all(ito for ito in target_options if ito['value'] != value): if option in ["pre-up", "up", "down", "post-up"] and all(ito['value'] != value for ito in target_options):
return add_option_after_line(option, value, iface, lines, target_options[-1], iface_options, address_family) return add_option_after_line(option, value, iface, lines, target_options[-1], iface_options, address_family)
# if more than one option found edit the last one # if more than one option found edit the last one

View File

@@ -451,7 +451,8 @@ def main():
if this_lv is None: if this_lv is None:
if state == 'present': if state == 'present':
if size_operator is not None: if size_operator is not None:
module.fail_json(msg="Bad size specification of '%s%s' for creating LV" % (size_operator, size)) if size_operator == "-" or (size_whole not in ["VG", "PVS", "FREE", "ORIGIN", None]):
module.fail_json(msg="Bad size specification of '%s%s' for creating LV" % (size_operator, size))
# Require size argument except for snapshot of thin volumes # Require size argument except for snapshot of thin volumes
if (lv or thinpool) and not size: if (lv or thinpool) and not size:
for test_lv in lvs: for test_lv in lvs:

View File

@@ -45,7 +45,7 @@ options:
required: false required: false
type: bool type: bool
description: description:
- Enable or disable the service according to local preferences in *.preset files. - Enable or disable the service according to local preferences in C(*.preset) files.
Mutually exclusive with I(enabled). Only has an effect if set to true. Will take Mutually exclusive with I(enabled). Only has an effect if set to true. Will take
effect prior to I(state=reset). effect prior to I(state=reset).
user: user:

View File

@@ -19,6 +19,8 @@ description:
For Linux it can use C(timedatectl) or edit C(/etc/sysconfig/clock) or C(/etc/timezone) and C(hwclock). For Linux it can use C(timedatectl) or edit C(/etc/sysconfig/clock) or C(/etc/timezone) and C(hwclock).
On SmartOS, C(sm-set-timezone), for macOS, C(systemsetup), for BSD, C(/etc/localtime) is modified. On SmartOS, C(sm-set-timezone), for macOS, C(systemsetup), for BSD, C(/etc/localtime) is modified.
On AIX, C(chtz) is used. On AIX, C(chtz) is used.
- Make sure that the zoneinfo files are installed with the appropriate OS package, like C(tzdata) (usually always installed,
when not using a minimal installation like Alpine Linux).
- As of Ansible 2.3 support was added for SmartOS and BSDs. - As of Ansible 2.3 support was added for SmartOS and BSDs.
- As of Ansible 2.4 support was added for macOS. - As of Ansible 2.4 support was added for macOS.
- As of Ansible 2.9 support was added for AIX 6.1+ - As of Ansible 2.9 support was added for AIX 6.1+

View File

@@ -6,3 +6,4 @@ skip/osx
skip/rhel8.2 skip/rhel8.2
skip/rhel8.3 skip/rhel8.3
skip/rhel8.4 skip/rhel8.4
skip/rhel8.5

View File

@@ -45,6 +45,9 @@
- 'not (ansible_distribution in ["CentOS", "RedHat"] and item.0.key in ["f2fs", "reiserfs"])' - 'not (ansible_distribution in ["CentOS", "RedHat"] and item.0.key in ["f2fs", "reiserfs"])'
- 'not (ansible_os_family == "RedHat" and ansible_distribution_major_version is version("8", ">=") and - 'not (ansible_os_family == "RedHat" and ansible_distribution_major_version is version("8", ">=") and
item.0.key == "btrfs")' item.0.key == "btrfs")'
# reiserfs-utils package not available with Fedora 35 on CI
- 'not (ansible_distribution == "Fedora" and (ansible_facts.distribution_major_version | int >= 35) and
item.0.key == "reiserfs")'
# ocfs2 only available on Debian based distributions # ocfs2 only available on Debian based distributions
- 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")' - 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")'
# Tests use losetup which can not be used inside unprivileged container # Tests use losetup which can not be used inside unprivileged container

View File

@@ -44,7 +44,7 @@
name: reiserfs-utils name: reiserfs-utils
state: present state: present
when: when:
- ansible_distribution == 'Fedora' - ansible_distribution == 'Fedora' and (ansible_facts.distribution_major_version | int < 35)
- name: "Install reiserfs (OpenSuse)" - name: "Install reiserfs (OpenSuse)"
ansible.builtin.package: ansible.builtin.package:

View File

@@ -0,0 +1,7 @@
iface eth0 inet static
address 1.2.3.4
netmask 255.255.255.0
gateway 1.2.3.1
up route add -net 1.2.3.4 netmask 255.255.255.0 gw 1.2.3.1 eth0
up ip addr add 4.3.2.1/32 dev eth0
down ip addr add 4.3.2.1/32 dev eth0

View File

@@ -2,6 +2,7 @@
- name: - name:
set_fact: set_fact:
interfaces_testfile: '{{ remote_tmp_dir }}/interfaces' interfaces_testfile: '{{ remote_tmp_dir }}/interfaces'
interfaces_testfile_3841: '{{ remote_tmp_dir }}/interfaces_3841'
- name: Copy interfaces file - name: Copy interfaces file
copy: copy:
@@ -31,3 +32,32 @@
- assert: - assert:
that: that:
- ifile_2 is not changed - ifile_2 is not changed
- name: 3841 - copy interfaces file
copy:
src: 'files/interfaces_ff_3841'
dest: '{{ interfaces_testfile_3841 }}'
- name: 3841 - floating_ip_interface_up_ip 2a01:a:b:c::1/64 dev eth0
interfaces_file:
option: up
iface: eth0
dest: "{{ interfaces_testfile_3841 }}"
value: 'ip addr add 2a01:a:b:c::1/64 dev eth0'
state: present
register: ifile_3841_a
- name: 3841 - floating_ip_interface_up_ip 2a01:a:b:c::1/64 dev eth0 (again)
interfaces_file:
option: up
iface: eth0
dest: "{{ interfaces_testfile_3841 }}"
value: 'ip addr add 2a01:a:b:c::1/64 dev eth0'
state: present
register: ifile_3841_b
- name: 3841 - check assertions
assert:
that:
- ifile_3841_a is changed
- ifile_3841_b is not changed

View File

@@ -124,3 +124,29 @@
- '"ansible-lint" in inject_pkgs_ansible_lint.application' - '"ansible-lint" in inject_pkgs_ansible_lint.application'
- '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]' - '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]'
- uninstall_ansible_lint is changed - uninstall_ansible_lint is changed
##############################################################################
- name: install jupyter - not working smoothly in freebsd
block:
- name: ensure application jupyter is uninstalled
community.general.pipx:
name: jupyter
state: absent
- name: install application jupyter
community.general.pipx:
name: jupyter
install_deps: true
register: install_jupyter
- name: cleanup jupyter
community.general.pipx:
state: absent
name: jupyter
- name: check assertions
assert:
that:
- install_jupyter is changed
- '"ipython" in install_jupyter.stdout'
when: ansible_system != 'FreeBSD'

View File

@@ -18,7 +18,7 @@ redis_bin:
CentOS: /usr/bin/redis-server CentOS: /usr/bin/redis-server
FreeBSD: /usr/local/bin/redis-server FreeBSD: /usr/local/bin/redis-server
redis_module: "{{ (ansible_python_version is version('2.7', '>=')) | ternary('redis', 'redis==2.10.6') }}" redis_module: redis
redis_password: PASS redis_password: PASS

View File

@@ -1,2 +1,3 @@
dependencies: dependencies:
- setup_pkg_mgr - setup_pkg_mgr
- setup_remote_constraints

View File

@@ -44,6 +44,7 @@
- name: Install redis module - name: Install redis module
pip: pip:
name: "{{ redis_module }}" name: "{{ redis_module }}"
extra_args: "-c {{ remote_constraints }}"
state: present state: present
notify: cleanup redis notify: cleanup redis

View File

@@ -1,3 +1,9 @@
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate
.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate
plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals

View File

@@ -1,3 +1,9 @@
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate
.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path

View File

@@ -1,3 +1,4 @@
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path

View File

@@ -1,3 +1,4 @@
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path

View File

@@ -1,3 +1,9 @@
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax
.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate
.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate
plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals

View File

@@ -563,6 +563,26 @@ ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no ipv6.ignore-auto-routes: no
""" """
TESTCASE_ETHERNET_STATIC_IP6_ADDRESS_SHOW_OUTPUT = """\
connection.id: non_existent_nw_device
connection.interface-name: ethernet_non_existant
connection.autoconnect: yes
802-3-ethernet.mtu: auto
ipv6.method: manual
ipv6.addresses: 2001:db8::cafe/128
ipv6.gateway: 2001:db8::cafa
ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.dns: 2001:4860:4860::8888,2001:4860:4860::8844
ipv4.method: disabled
ipv4.ignore-auto-dns: no
ipv4.ignore-auto-routes: no
ipv4.never-default: no
ipv4.may-fail: yes
"""
TESTCASE_WIRELESS = [ TESTCASE_WIRELESS = [
{ {
'type': 'wifi', 'type': 'wifi',
@@ -668,6 +688,44 @@ ipv4.ignore-auto-routes: no
ipv4.never-default: no ipv4.never-default: no
ipv4.may-fail: yes ipv4.may-fail: yes
ipv4.dns: 1.1.1.1,8.8.8.8 ipv4.dns: 1.1.1.1,8.8.8.8
ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no
ipv6.method: manual
ipv6.addresses: 2001:db8::1/128
"""
TESTCASE_DUMMY_STATIC_WITHOUT_MTU_SHOW_OUTPUT = """\
connection.id: non_existent_nw_device
connection.interface-name: dummy_non_existant
connection.autoconnect: yes
ipv4.method: manual
ipv4.addresses: 10.10.10.10/24
ipv4.gateway: 10.10.10.1
ipv4.ignore-auto-dns: no
ipv4.ignore-auto-routes: no
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dns: 1.1.1.1,8.8.8.8
ipv6.method: auto
ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no
ipv6.method: manual
ipv6.addresses: 2001:db8::1/128
"""
TESTCASE_DUMMY_STATIC_WITH_CUSTOM_MTU_SHOW_OUTPUT = """\
connection.id: non_existent_nw_device
connection.interface-name: dummy_non_existant
connection.autoconnect: yes
802-3-ethernet.mtu: 1500
ipv4.method: manual
ipv4.addresses: 10.10.10.10/24
ipv4.gateway: 10.10.10.1
ipv4.ignore-auto-dns: no
ipv4.ignore-auto-routes: no
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dns: 1.1.1.1,8.8.8.8
ipv6.method: auto ipv6.method: auto
ipv6.ignore-auto-dns: no ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no ipv6.ignore-auto-routes: no
@@ -881,6 +939,17 @@ def mocked_ethernet_connection_static_unchanged(mocker):
execute_return=(0, TESTCASE_ETHERNET_STATIC_SHOW_OUTPUT, "")) execute_return=(0, TESTCASE_ETHERNET_STATIC_SHOW_OUTPUT, ""))
@pytest.fixture
def mocked_ethernet_connection_with_ipv6_address_static_modify(mocker):
mocker_set(mocker,
connection_exists=True,
execute_return=None,
execute_side_effect=(
(0, TESTCASE_ETHERNET_STATIC_IP6_ADDRESS_SHOW_OUTPUT, ""),
(0, "", ""),
))
@pytest.fixture @pytest.fixture
def mocked_ethernet_connection_dhcp_to_static(mocker): def mocked_ethernet_connection_dhcp_to_static(mocker):
mocker_set(mocker, mocker_set(mocker,
@@ -955,6 +1024,24 @@ def mocked_dummy_connection_static_unchanged(mocker):
execute_return=(0, TESTCASE_DUMMY_STATIC_SHOW_OUTPUT, "")) execute_return=(0, TESTCASE_DUMMY_STATIC_SHOW_OUTPUT, ""))
@pytest.fixture
def mocked_dummy_connection_static_without_mtu_unchanged(mocker):
mocker_set(mocker,
connection_exists=True,
execute_return=(0, TESTCASE_DUMMY_STATIC_WITHOUT_MTU_SHOW_OUTPUT, ""))
@pytest.fixture
def mocked_dummy_connection_static_with_custom_mtu_modify(mocker):
mocker_set(mocker,
connection_exists=True,
execute_return=None,
execute_side_effect=(
(0, TESTCASE_DUMMY_STATIC_WITH_CUSTOM_MTU_SHOW_OUTPUT, ""),
(0, "", ""),
))
@pytest.fixture @pytest.fixture
def mocked_gsm_connection_unchanged(mocker): def mocked_gsm_connection_unchanged(mocker):
mocker_set(mocker, mocker_set(mocker,
@@ -2283,6 +2370,48 @@ def test_dummy_connection_static_unchanged(mocked_dummy_connection_static_unchan
assert not results['changed'] assert not results['changed']
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_DUMMY_STATIC, indirect=['patch_ansible_module'])
def test_dummy_connection_static_without_mtu_unchanged(mocked_dummy_connection_static_without_mtu_unchanged, capfd):
"""
Test : Dummy connection with static IP configuration and no mtu set unchanged
"""
with pytest.raises(SystemExit):
nmcli.main()
out, err = capfd.readouterr()
results = json.loads(out)
assert not results.get('failed')
assert not results['changed']
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_DUMMY_STATIC, indirect=['patch_ansible_module'])
def test_dummy_connection_static_with_custom_mtu_modify(mocked_dummy_connection_static_with_custom_mtu_modify, capfd):
"""
Test : Dummy connection with static IP configuration and no mtu set modify
"""
with pytest.raises(SystemExit):
nmcli.main()
assert nmcli.Nmcli.execute_command.call_count == 2
arg_list = nmcli.Nmcli.execute_command.call_args_list
args, kwargs = arg_list[1]
assert args[0][0] == '/usr/bin/nmcli'
assert args[0][1] == 'con'
assert args[0][2] == 'modify'
assert args[0][3] == 'non_existent_nw_device'
args_text = list(map(to_text, args[0]))
for param in ['802-3-ethernet.mtu', '0']:
assert param in args_text
out, err = capfd.readouterr()
results = json.loads(out)
assert not results.get('failed')
assert results['changed']
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_GSM, indirect=['patch_ansible_module']) @pytest.mark.parametrize('patch_ansible_module', TESTCASE_GSM, indirect=['patch_ansible_module'])
def test_create_gsm(mocked_generic_connection_create, capfd): def test_create_gsm(mocked_generic_connection_create, capfd):
""" """

View File

@@ -0,0 +1,21 @@
# interfaces_file unit tests
## Tests structure
- `input` directory contains interfaces configuration files
- `test_interfaces_file.py` runs each hardcoded test agains all configurations in `input` directory and compares results with golden outputs in `golden_output`
## Running unit tests with docker
1. Clone project to `ansible_collections/community/general`
2. Change directory to the project one `cd ansible_collections/community/general`
3. Run `ansible-test units --docker -v --python 3.6 tests/unit/plugins/modules/system/interfaces_file/test_interfaces_file.py`
## Adding tests
1. New configurations should added to `input` directory
2. New test cases should be defined in `test_interfaces_file.py`. Same for new test functions if needed
3. On first test run for a new combination of a test case and an interface configuration new set of golden files will be generated. In case of docker-based test approach that's going to fail due to RO mount option. The workaround is to run tests locally with Python 3 (3.7 in this example):
1. Install required modules with `pip3.7 install pytest-xdist pytest-mock mock`
3. Run tests with `ansible-test units --python 3.7 tests/unit/plugins/modules/system/interfaces_file/test_interfaces_file.py`
4. Carefully verify newly created golden output files!

View File

@@ -0,0 +1,12 @@
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet static
address 192.168.0.1
post-up echo configuring ipv4
iface eth0 inet6 static
address fc00::1
post-up echo configuring ipv6

View File

@@ -0,0 +1,17 @@
[0] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "present",
"value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
}
=====
[1] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "present",
"value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
}

View File

@@ -0,0 +1,21 @@
{
"eth0": {
"address": "fc00::1",
"address_family": "inet6",
"down": [],
"method": "static",
"post-up": [
"echo configuring ipv6"
],
"pre-up": [],
"up": []
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,12 @@
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet static
address 192.168.0.1
post-up echo configuring ipv4
iface eth0 inet6 static
address fc00::1
post-up echo configuring ipv6

View File

@@ -0,0 +1,17 @@
[0] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "absent",
"value": null
}
=====
[1] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "present",
"value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
}

View File

@@ -0,0 +1,21 @@
{
"eth0": {
"address": "fc00::1",
"address_family": "inet6",
"down": [],
"method": "static",
"post-up": [
"echo configuring ipv6"
],
"pre-up": [],
"up": []
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,6 @@
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp

View File

@@ -0,0 +1,17 @@
[0] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "present",
"value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
}
=====
[1] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "present",
"value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
}

View File

@@ -0,0 +1,18 @@
{
"eth0": {
"address_family": "inet",
"down": [],
"method": "dhcp",
"post-up": [],
"pre-up": [],
"up": []
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,6 @@
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp

View File

@@ -0,0 +1,17 @@
[0] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "absent",
"value": null
}
=====
[1] fail_json message: Error: interface aggi not found
options:
{
"iface": "aggi",
"option": "up",
"state": "present",
"value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
}

View File

@@ -0,0 +1,18 @@
{
"eth0": {
"address_family": "inet",
"down": [],
"method": "dhcp",
"post-up": [],
"pre-up": [],
"up": []
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,62 @@
auto aggi
iface aggi inet static
hwaddress ether 22:44:77:88:D5:96
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
slaves int1 int2
bond_mode 4
bond_miimon 100
bond_downdelay 200
bond_updelay 200
bond_lacp_rate slow
bond_xmit_hash_policy layer3+4
post-up /sbin/ethtool -K aggi tx off tso off
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
auto agge
iface agge inet manual
auto br0
iface br0 inet static
bridge_ports agge
hwaddress ether 22:44:77:88:D5:98
address 188.44.133.76
netmask 255.255.255.248
gateway 188.44.133.75
slaves ext1 ext2
bond_mode 4
bond_miimon 100
bond_downdelay 200
bond_updelay 200
bond_lacp_rate slow
bond_xmit_hash_policy layer3+4
post-up /sbin/ethtool -K agge tx off tso off
up route add -net 10.0.0.0/8 gw 10.44.15.117 dev aggi
up route add -net 192.168.0.0/16 gw 10.44.15.117 dev aggi
up route add -net 188.44.208.0/21 gw 10.44.15.117 dev aggi
auto int1
iface int1 inet manual
bond-master aggi
auto int2
iface int2 inet manual
bond-master aggi
auto ext1
iface ext1 inet manual
bond-master agge
auto ext2
iface ext2 inet manual
bond-master agge
auto eth1
iface eth1 inet manual
auto lo
iface lo inet loopback
source /etc/network/interfaces.d/*.cfg

View File

@@ -0,0 +1,109 @@
{
"agge": {
"address_family": "inet",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"bond_downdelay": "200",
"bond_lacp_rate": "slow",
"bond_miimon": "100",
"bond_mode": "4",
"bond_updelay": "200",
"bond_xmit_hash_policy": "layer3+4",
"down": [],
"hwaddress": "ether 22:44:77:88:D5:96",
"method": "static",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [
"/sbin/ethtool -K aggi tx off tso off"
],
"pre-up": [],
"slaves": "int1 int2",
"up": []
},
"br0": {
"address": "188.44.133.76",
"address_family": "inet",
"bond_downdelay": "200",
"bond_lacp_rate": "slow",
"bond_miimon": "100",
"bond_mode": "4",
"bond_updelay": "200",
"bond_xmit_hash_policy": "layer3+4",
"bridge_ports": "agge",
"down": [],
"gateway": "188.44.133.75",
"hwaddress": "ether 22:44:77:88:D5:98",
"method": "static",
"netmask": "255.255.255.248",
"post-up": [
"/sbin/ethtool -K agge tx off tso off"
],
"pre-up": [],
"slaves": "ext1 ext2",
"up": [
"route add -net 10.0.0.0/8 gw 10.44.15.117 dev aggi",
"route add -net 192.168.0.0/16 gw 10.44.15.117 dev aggi",
"route add -net 188.44.208.0/21 gw 10.44.15.117 dev aggi"
]
},
"eth1": {
"address_family": "inet",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"ext1": {
"address_family": "inet",
"bond-master": "agge",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"ext2": {
"address_family": "inet",
"bond-master": "agge",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"int1": {
"address_family": "inet",
"bond-master": "aggi",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"int2": {
"address_family": "inet",
"bond-master": "aggi",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,62 @@
auto aggi
iface aggi inet static
hwaddress ether 22:44:77:88:D5:96
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
slaves int1 int2
bond_mode 4
bond_miimon 100
bond_downdelay 200
bond_updelay 200
bond_lacp_rate slow
bond_xmit_hash_policy layer3+4
post-up /sbin/ethtool -K aggi tx off tso off
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
auto agge
iface agge inet manual
auto br0
iface br0 inet static
bridge_ports agge
hwaddress ether 22:44:77:88:D5:98
address 188.44.133.76
netmask 255.255.255.248
gateway 188.44.133.75
slaves ext1 ext2
bond_mode 4
bond_miimon 100
bond_downdelay 200
bond_updelay 200
bond_lacp_rate slow
bond_xmit_hash_policy layer3+4
post-up /sbin/ethtool -K agge tx off tso off
up route add -net 10.0.0.0/8 gw 10.44.15.117 dev aggi
up route add -net 192.168.0.0/16 gw 10.44.15.117 dev aggi
up route add -net 188.44.208.0/21 gw 10.44.15.117 dev aggi
auto int1
iface int1 inet manual
bond-master aggi
auto int2
iface int2 inet manual
bond-master aggi
auto ext1
iface ext1 inet manual
bond-master agge
auto ext2
iface ext2 inet manual
bond-master agge
auto eth1
iface eth1 inet manual
auto lo
iface lo inet loopback
source /etc/network/interfaces.d/*.cfg

View File

@@ -0,0 +1,109 @@
{
"agge": {
"address_family": "inet",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"bond_downdelay": "200",
"bond_lacp_rate": "slow",
"bond_miimon": "100",
"bond_mode": "4",
"bond_updelay": "200",
"bond_xmit_hash_policy": "layer3+4",
"down": [],
"hwaddress": "ether 22:44:77:88:D5:96",
"method": "static",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [
"/sbin/ethtool -K aggi tx off tso off"
],
"pre-up": [],
"slaves": "int1 int2",
"up": []
},
"br0": {
"address": "188.44.133.76",
"address_family": "inet",
"bond_downdelay": "200",
"bond_lacp_rate": "slow",
"bond_miimon": "100",
"bond_mode": "4",
"bond_updelay": "200",
"bond_xmit_hash_policy": "layer3+4",
"bridge_ports": "agge",
"down": [],
"gateway": "188.44.133.75",
"hwaddress": "ether 22:44:77:88:D5:98",
"method": "static",
"netmask": "255.255.255.248",
"post-up": [
"/sbin/ethtool -K agge tx off tso off"
],
"pre-up": [],
"slaves": "ext1 ext2",
"up": [
"route add -net 10.0.0.0/8 gw 10.44.15.117 dev aggi",
"route add -net 192.168.0.0/16 gw 10.44.15.117 dev aggi",
"route add -net 188.44.208.0/21 gw 10.44.15.117 dev aggi"
]
},
"eth1": {
"address_family": "inet",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"ext1": {
"address_family": "inet",
"bond-master": "agge",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"ext2": {
"address_family": "inet",
"bond-master": "agge",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"int1": {
"address_family": "inet",
"bond-master": "aggi",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"int2": {
"address_family": "inet",
"bond-master": "aggi",
"down": [],
"method": "manual",
"post-up": [],
"pre-up": [],
"up": []
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,11 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,11 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,11 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,9 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,10 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,11 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi

View File

@@ -0,0 +1,9 @@
fail_json message: Error: interface eth0 not found
options:
{
"address_family": "inet",
"iface": "eth0",
"option": "address",
"state": "present",
"value": "192.168.0.42"
}

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

View File

@@ -0,0 +1,11 @@
# this file covers duplicates issue for up/down option, #3841
auto lo
iface lo inet loopback
auto aggi
iface aggi inet dhcp
address 10.44.15.196
netmask 255.255.255.248
mtu 1500
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi
up route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi

View File

@@ -0,0 +1,9 @@
fail_json message: Error: interface eth0 not found
options:
{
"address_family": "inet",
"iface": "eth0",
"option": "post-up",
"state": "present",
"value": "XXXX_ipv4"
}

View File

@@ -0,0 +1,24 @@
{
"aggi": {
"address": "10.44.15.196",
"address_family": "inet",
"down": [],
"method": "dhcp",
"mtu": "1500",
"netmask": "255.255.255.248",
"post-up": [],
"pre-up": [],
"up": [
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi",
"route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi"
]
},
"lo": {
"address_family": "inet",
"down": [],
"method": "loopback",
"post-up": [],
"pre-up": [],
"up": []
}
}

Some files were not shown because too many files have changed in this diff Show More