mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-29 01:46:53 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27c094a095 | ||
|
|
86a5b4f28c | ||
|
|
4e14c429c7 | ||
|
|
c34fb01462 | ||
|
|
2086977af6 | ||
|
|
587d221376 | ||
|
|
5ed6b38477 | ||
|
|
2c0cfe4d16 | ||
|
|
c344d20a9a | ||
|
|
53480b25c8 | ||
|
|
cfffaa5b6f | ||
|
|
726918930b | ||
|
|
614a84d0f2 | ||
|
|
a11022e896 | ||
|
|
491196937d | ||
|
|
af7a6dc29f | ||
|
|
16ffb4ba10 | ||
|
|
31c3865251 | ||
|
|
53e0bf8297 | ||
|
|
9b80b14956 | ||
|
|
be763e6ed2 | ||
|
|
4375280497 | ||
|
|
ebda14ba41 | ||
|
|
c16a5f3780 | ||
|
|
f6c1566924 | ||
|
|
bffed2fda5 | ||
|
|
440804fd62 | ||
|
|
a915a4b7c5 | ||
|
|
ed69bde7a9 | ||
|
|
77700e7110 | ||
|
|
91d445ab35 | ||
|
|
19c2af03b7 | ||
|
|
58a5463ddb | ||
|
|
84941d0a7f |
@@ -24,14 +24,15 @@ schedules:
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-2
|
||||
- stable-3
|
||||
- stable-4
|
||||
- cron: 0 11 * * 0
|
||||
displayName: Weekly (old stable branches)
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-1
|
||||
- stable-2
|
||||
|
||||
variables:
|
||||
- name: checkoutPath
|
||||
@@ -209,8 +210,8 @@ stages:
|
||||
test: macos/11.1
|
||||
- name: RHEL 7.9
|
||||
test: rhel/7.9
|
||||
- name: RHEL 8.4
|
||||
test: rhel/8.4
|
||||
- name: RHEL 8.5
|
||||
test: rhel/8.5
|
||||
- name: FreeBSD 12.2
|
||||
test: freebsd/12.2
|
||||
- name: FreeBSD 13.0
|
||||
@@ -297,10 +298,10 @@ stages:
|
||||
targets:
|
||||
- name: CentOS 7
|
||||
test: centos7
|
||||
- name: Fedora 33
|
||||
test: fedora33
|
||||
- name: Fedora 34
|
||||
test: fedora34
|
||||
- name: Fedora 35
|
||||
test: fedora35
|
||||
- name: openSUSE 15 py2
|
||||
test: opensuse15py2
|
||||
- name: openSUSE 15 py3
|
||||
|
||||
@@ -11,7 +11,7 @@ mkdir "${agent_temp_directory}/coverage/"
|
||||
|
||||
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
|
||||
# Only analyze coverage if the installed version of ansible-test supports it.
|
||||
|
||||
101
.azure-pipelines/scripts/publish-codecov.py
Executable file
101
.azure-pipelines/scripts/publish-codecov.py
Executable 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()
|
||||
@@ -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
|
||||
@@ -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
|
||||
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
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml"
|
||||
displayName: Publish to Azure Pipelines
|
||||
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
|
||||
condition: gt(variables.coverageFileCount, 0)
|
||||
continueOnError: true
|
||||
|
||||
12
.github/BOTMETA.yml
vendored
12
.github/BOTMETA.yml
vendored
@@ -156,7 +156,7 @@ files:
|
||||
maintainers: conloos
|
||||
$inventories/nmap.py: {}
|
||||
$inventories/online.py:
|
||||
maintainers: sieben
|
||||
maintainers: remyleone
|
||||
$inventories/opennebula.py:
|
||||
maintainers: feldsam
|
||||
labels: cloud opennebula
|
||||
@@ -339,7 +339,7 @@ files:
|
||||
$modules/cloud/oneandone/:
|
||||
maintainers: aajdinov edevenport
|
||||
$modules/cloud/online/:
|
||||
maintainers: sieben
|
||||
maintainers: remyleone
|
||||
$modules/cloud/opennebula/:
|
||||
maintainers: $team_opennebula
|
||||
$modules/cloud/opennebula/one_host.py:
|
||||
@@ -409,11 +409,11 @@ files:
|
||||
$modules/cloud/scaleway/scaleway_ip_info.py:
|
||||
maintainers: Spredzy
|
||||
$modules/cloud/scaleway/scaleway_organization_info.py:
|
||||
maintainers: sieben Spredzy
|
||||
maintainers: Spredzy
|
||||
$modules/cloud/scaleway/scaleway_security_group.py:
|
||||
maintainers: DenBeke
|
||||
$modules/cloud/scaleway/scaleway_security_group_info.py:
|
||||
maintainers: sieben Spredzy
|
||||
maintainers: Spredzy
|
||||
$modules/cloud/scaleway/scaleway_security_group_rule.py:
|
||||
maintainers: DenBeke
|
||||
$modules/cloud/scaleway/scaleway_server_info.py:
|
||||
@@ -1221,7 +1221,7 @@ macros:
|
||||
team_cyberark_conjur: jvanderhoof ryanprior
|
||||
team_e_spirit: MatrixCrawler getjack
|
||||
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_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2
|
||||
team_ipa: Akasurde Nosmoht fxfitz justchris1
|
||||
@@ -1236,7 +1236,7 @@ macros:
|
||||
team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16
|
||||
team_redfish: mraineri tomasg2012 xmadsen renxulei
|
||||
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_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor
|
||||
team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso
|
||||
|
||||
@@ -6,6 +6,47 @@ Community General Release Notes
|
||||
|
||||
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
|
||||
======
|
||||
|
||||
@@ -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).
|
||||
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).
|
||||
- slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- urmpi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- urpmi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- xbps - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- 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).
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ releases:
|
||||
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).
|
||||
- slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed
|
||||
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- urmpi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``,
|
||||
- urpmi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``,
|
||||
will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
- xbps - deprecated invalid parameter alias ``update-cache``, will be removed
|
||||
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
|
||||
@@ -1978,3 +1978,55 @@ releases:
|
||||
- 3626-fix-one_image-error.yml
|
||||
- 3649-proxmox_group_info_TypeError.yml
|
||||
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'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace: community
|
||||
name: general
|
||||
version: 3.8.1
|
||||
version: 3.8.3
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
|
||||
@@ -45,6 +45,8 @@ class CallbackModule(CallbackBase):
|
||||
_task_total = 0
|
||||
_host_counter = 1
|
||||
_host_total = 0
|
||||
_current_batch_total = 0
|
||||
_previous_batch_total = 0
|
||||
|
||||
def __init__(self):
|
||||
super(CallbackModule, self).__init__()
|
||||
@@ -76,8 +78,11 @@ class CallbackModule(CallbackBase):
|
||||
self._display.banner(msg)
|
||||
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._task_total = len(self._play.get_tasks()[0])
|
||||
self._task_counter = 1
|
||||
|
||||
def v2_playbook_on_stats(self, stats):
|
||||
self._display.banner("PLAY RECAP")
|
||||
@@ -145,7 +150,7 @@ class CallbackModule(CallbackBase):
|
||||
path = task.get_path()
|
||||
if path:
|
||||
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
|
||||
|
||||
def v2_runner_on_ok(self, result):
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# (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)
|
||||
|
||||
@@ -263,6 +264,8 @@ class OpenTelemetrySource(object):
|
||||
else:
|
||||
message = 'skipped'
|
||||
status = Status(status_code=StatusCode.UNSET)
|
||||
elif host_data.status == 'ignored':
|
||||
status = Status(status_code=StatusCode.UNSET)
|
||||
|
||||
span.set_status(status)
|
||||
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):
|
||||
self.errors += 1
|
||||
if ignore_errors:
|
||||
status = 'ignored'
|
||||
else:
|
||||
status = 'failed'
|
||||
self.errors += 1
|
||||
|
||||
self.opentelemetry.finish_task(
|
||||
self.tasks_data,
|
||||
'failed',
|
||||
status,
|
||||
result
|
||||
)
|
||||
|
||||
|
||||
@@ -89,9 +89,9 @@ class Connection(ConnectionBase):
|
||||
local_cmd.extend(["--project", self.get_option("project")])
|
||||
local_cmd.extend([
|
||||
"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]
|
||||
@@ -126,7 +126,7 @@ class Connection(ConnectionBase):
|
||||
local_cmd.extend([
|
||||
"file", "push",
|
||||
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]
|
||||
@@ -145,7 +145,7 @@ class Connection(ConnectionBase):
|
||||
local_cmd.extend(["--project", self.get_option("project")])
|
||||
local_cmd.extend([
|
||||
"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
|
||||
])
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ __metaclass__ = type
|
||||
DOCUMENTATION = r'''
|
||||
name: online
|
||||
author:
|
||||
- Remy Leone (@sieben)
|
||||
- Remy Leone (@remyleone)
|
||||
short_description: Scaleway (previously Online SAS or Online.net) inventory source
|
||||
description:
|
||||
- Get inventory hosts from Scaleway (previously Online SAS or Online.net).
|
||||
|
||||
@@ -9,7 +9,7 @@ __metaclass__ = type
|
||||
DOCUMENTATION = r'''
|
||||
name: scaleway
|
||||
author:
|
||||
- Remy Leone (@sieben)
|
||||
- Remy Leone (@remyleone)
|
||||
short_description: Scaleway inventory source
|
||||
description:
|
||||
- Get inventory hosts from Scaleway.
|
||||
|
||||
@@ -93,7 +93,7 @@ DOCUMENTATION = '''
|
||||
environment variable and keep I(endpoints), I(host), and I(port) unused.
|
||||
seealso:
|
||||
- module: community.general.etcd3
|
||||
- ref: etcd_lookup
|
||||
- ref: ansible_collections.community.general.etcd_lookup
|
||||
description: The etcd v2 lookup.
|
||||
|
||||
requirements:
|
||||
|
||||
@@ -54,6 +54,17 @@ def proxmox_to_ansible_bool(value):
|
||||
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):
|
||||
"""Base class for Proxmox modules"""
|
||||
def __init__(self, module):
|
||||
|
||||
@@ -374,6 +374,10 @@ except ImportError:
|
||||
from ansible.module_utils.basic import AnsibleModule, env_fallback
|
||||
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
|
||||
|
||||
@@ -627,14 +631,14 @@ def main():
|
||||
netif=module.params['netif'],
|
||||
mounts=module.params['mounts'],
|
||||
ip_address=module.params['ip_address'],
|
||||
onboot=int(module.params['onboot']),
|
||||
onboot=ansible_to_proxmox_bool(module.params['onboot']),
|
||||
cpuunits=module.params['cpuunits'],
|
||||
nameserver=module.params['nameserver'],
|
||||
searchdomain=module.params['searchdomain'],
|
||||
force=int(module.params['force']),
|
||||
force=ansible_to_proxmox_bool(module.params['force']),
|
||||
pubkey=module.params['pubkey'],
|
||||
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'],
|
||||
hookscript=module.params['hookscript'])
|
||||
|
||||
|
||||
@@ -319,11 +319,25 @@ def remove_workspace(bin_path, project_path, 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:
|
||||
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:
|
||||
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))
|
||||
else:
|
||||
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:
|
||||
module.fail_json(msg="Aborting command because it would destroy some resources. "
|
||||
"Consider switching the 'check_destroy' to false to suppress this error")
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the servers.
|
||||
- U(https://www.online.net/en/dedicated-server)
|
||||
author:
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.online
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ short_description: Gather information about Online user.
|
||||
description:
|
||||
- Gather information about the user.
|
||||
author:
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.online
|
||||
'''
|
||||
|
||||
@@ -16,7 +16,7 @@ DOCUMENTATION = '''
|
||||
---
|
||||
module: scaleway_compute
|
||||
short_description: Scaleway compute management module
|
||||
author: Remy Leone (@sieben)
|
||||
author: Remy Leone (@remyleone)
|
||||
description:
|
||||
- "This module manages compute instances on Scaleway."
|
||||
extends_documentation_fragment:
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway images available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.scaleway
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ DOCUMENTATION = '''
|
||||
---
|
||||
module: scaleway_ip
|
||||
short_description: Scaleway IP management module
|
||||
author: Remy Leone (@sieben)
|
||||
author: Remy Leone (@remyleone)
|
||||
description:
|
||||
- This module manages IP on Scaleway account
|
||||
U(https://developer.scaleway.com)
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway ips available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.scaleway
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ DOCUMENTATION = '''
|
||||
---
|
||||
module: scaleway_lb
|
||||
short_description: Scaleway load-balancer management module
|
||||
author: Remy Leone (@sieben)
|
||||
author: Remy Leone (@remyleone)
|
||||
description:
|
||||
- "This module manages load-balancers on Scaleway."
|
||||
extends_documentation_fragment:
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway organizations available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
options:
|
||||
api_url:
|
||||
description:
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway security groups available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
options:
|
||||
region:
|
||||
type: str
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway servers available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.scaleway
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway snapshot available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.scaleway
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ DOCUMENTATION = '''
|
||||
---
|
||||
module: scaleway_sshkey
|
||||
short_description: Scaleway SSH keys management module
|
||||
author: Remy Leone (@sieben)
|
||||
author: Remy Leone (@remyleone)
|
||||
description:
|
||||
- This module manages SSH keys on Scaleway account
|
||||
U(https://developer.scaleway.com)
|
||||
|
||||
@@ -16,7 +16,7 @@ DOCUMENTATION = '''
|
||||
---
|
||||
module: scaleway_user_data
|
||||
short_description: Scaleway user_data management module
|
||||
author: Remy Leone (@sieben)
|
||||
author: Remy Leone (@remyleone)
|
||||
description:
|
||||
- "This module manages user_data on compute instances on Scaleway."
|
||||
- "It can be used to configure cloud-init for instance"
|
||||
|
||||
@@ -15,7 +15,7 @@ description:
|
||||
- Gather information about the Scaleway volumes available.
|
||||
author:
|
||||
- "Yanis Guenane (@Spredzy)"
|
||||
- "Remy Leone (@sieben)"
|
||||
- "Remy Leone (@remyleone)"
|
||||
extends_documentation_fragment:
|
||||
- community.general.scaleway
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ options:
|
||||
description:
|
||||
- the address to advertise that the service will be listening on.
|
||||
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.
|
||||
tags:
|
||||
type: list
|
||||
|
||||
@@ -26,6 +26,7 @@ extends_documentation_fragment:
|
||||
- community.general.redis
|
||||
|
||||
seealso:
|
||||
- module: community.general.redis_data
|
||||
- module: community.general.redis_info
|
||||
- module: community.general.redis
|
||||
'''
|
||||
|
||||
@@ -158,7 +158,7 @@ def _run_xattr(module, cmd, check_rc=True):
|
||||
if line.startswith('#') or line == '':
|
||||
pass
|
||||
elif '=' in line:
|
||||
(key, val) = line.split('=')
|
||||
(key, val) = line.split('=', 1)
|
||||
result[key] = val.strip('"')
|
||||
else:
|
||||
result[line] = ''
|
||||
|
||||
@@ -106,11 +106,10 @@ def main():
|
||||
module.fail_json(msg=missing_required_lib('python-ldap'),
|
||||
exception=LDAP_IMP_ERR)
|
||||
|
||||
if not module.check_mode:
|
||||
try:
|
||||
LdapSearch(module).main()
|
||||
except Exception as exception:
|
||||
module.fail_json(msg="Attribute action failed.", details=to_native(exception))
|
||||
try:
|
||||
LdapSearch(module).main()
|
||||
except Exception as exception:
|
||||
module.fail_json(msg="Attribute action failed.", details=to_native(exception))
|
||||
|
||||
module.exit_json(changed=False)
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ options:
|
||||
ip4:
|
||||
description:
|
||||
- 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).
|
||||
type: str
|
||||
gw4:
|
||||
@@ -143,7 +143,7 @@ options:
|
||||
ip6:
|
||||
description:
|
||||
- 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).
|
||||
type: str
|
||||
gw6:
|
||||
@@ -1241,7 +1241,7 @@ class Nmcli(object):
|
||||
# IP address options.
|
||||
if self.ip_conn_type and not self.master:
|
||||
options.update({
|
||||
'ipv4.addresses': self.ip4,
|
||||
'ipv4.addresses': self.enforce_ipv4_cidr_notation(self.ip4),
|
||||
'ipv4.dhcp-client-id': self.dhcp_client_id,
|
||||
'ipv4.dns': self.dns4,
|
||||
'ipv4.dns-search': self.dns4_search,
|
||||
@@ -1254,7 +1254,7 @@ class Nmcli(object):
|
||||
'ipv4.never-default': self.never_default4,
|
||||
'ipv4.method': self.ipv4_method,
|
||||
'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-search': self.dns6_search,
|
||||
'ipv6.ignore-auto-dns': self.dns6_ignore_auto,
|
||||
@@ -1332,6 +1332,9 @@ class Nmcli(object):
|
||||
options.update({
|
||||
'vlan.id': self.vlanid,
|
||||
'vlan.parent': self.vlandev,
|
||||
'vlan.flags': self.flags,
|
||||
'vlan.ingress': self.ingress,
|
||||
'vlan.egress': self.egress,
|
||||
})
|
||||
elif self.type == 'vxlan':
|
||||
options.update({
|
||||
@@ -1444,6 +1447,22 @@ class Nmcli(object):
|
||||
'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
|
||||
def bool_to_string(boolean):
|
||||
if boolean:
|
||||
@@ -1695,6 +1714,8 @@ class Nmcli(object):
|
||||
# Depending on version nmcli adds double-qoutes to gsm.apn
|
||||
# Need to strip them in order to compare both
|
||||
current_value = current_value.strip('"')
|
||||
if key == self.mtu_setting and self.mtu is None:
|
||||
self.mtu = 0
|
||||
else:
|
||||
# parameter does not exist
|
||||
current_value = None
|
||||
@@ -1703,6 +1724,8 @@ class Nmcli(object):
|
||||
# compare values between two lists
|
||||
if sorted(current_value) != sorted(value):
|
||||
changed = True
|
||||
elif all([key == self.mtu_setting, self.type == 'dummy', current_value is None, value == 'auto', self.mtu is None]):
|
||||
value = None
|
||||
else:
|
||||
if current_value != to_text(value):
|
||||
changed = True
|
||||
|
||||
@@ -127,7 +127,7 @@ ansible_sysname:
|
||||
type: str
|
||||
sample: ubuntu-user
|
||||
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
|
||||
type: str
|
||||
sample: Sitting on the Dock of the Bay
|
||||
|
||||
@@ -10,7 +10,7 @@ __metaclass__ = type
|
||||
DOCUMENTATION = """
|
||||
module: ansible_galaxy_install
|
||||
author:
|
||||
- "Alexei Znamensky (@russoz)"
|
||||
- "Alexei Znamensky (@russoz)"
|
||||
short_description: Install Ansible roles or collections using ansible-galaxy
|
||||
version_added: 3.5.0
|
||||
description:
|
||||
@@ -24,44 +24,46 @@ requirements:
|
||||
options:
|
||||
type:
|
||||
description:
|
||||
- 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.
|
||||
- "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)."
|
||||
- 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.
|
||||
- "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)."
|
||||
type: str
|
||||
choices: [collection, role, both]
|
||||
required: true
|
||||
name:
|
||||
description:
|
||||
- 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.
|
||||
- Name of the collection or role being installed.
|
||||
- >
|
||||
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
|
||||
requirements_file:
|
||||
description:
|
||||
- Path to a file containing a list of requirements to be installed.
|
||||
- It works for I(type) equals to C(collection) and C(role).
|
||||
- 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."
|
||||
- Path to a file containing a list of requirements to be installed.
|
||||
- It works for I(type) equals to C(collection) and C(role).
|
||||
- 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."
|
||||
type: path
|
||||
dest:
|
||||
description:
|
||||
- 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)
|
||||
contains both roles and collections and I(dest) is specified.
|
||||
- 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)
|
||||
contains both roles and collections and I(dest) is specified.
|
||||
type: path
|
||||
force:
|
||||
description:
|
||||
- Force overwriting an existing role or collection.
|
||||
- Using I(force=true) is mandatory when downgrading.
|
||||
- "B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections."
|
||||
- Force overwriting an existing role or collection.
|
||||
- Using I(force=true) is mandatory when downgrading.
|
||||
- "B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections."
|
||||
type: bool
|
||||
default: false
|
||||
ack_ansible29:
|
||||
description:
|
||||
- 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).
|
||||
- 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 of Ansible greater than C(2.9.x).
|
||||
type: bool
|
||||
default: false
|
||||
"""
|
||||
@@ -114,9 +116,9 @@ RETURN = """
|
||||
returned: always
|
||||
installed_roles:
|
||||
description:
|
||||
- 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.
|
||||
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
|
||||
- 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.
|
||||
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
|
||||
type: dict
|
||||
returned: always when installing roles
|
||||
contains:
|
||||
@@ -131,9 +133,9 @@ RETURN = """
|
||||
ansistrano.deploy: 3.8.0
|
||||
installed_collections:
|
||||
description:
|
||||
- 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.
|
||||
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
|
||||
- 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.
|
||||
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
|
||||
type: dict
|
||||
returned: always when installing collections
|
||||
contains:
|
||||
|
||||
@@ -167,7 +167,7 @@ class PipX(CmdStateModuleHelper):
|
||||
command_args_formats = dict(
|
||||
state=dict(fmt=lambda v: [_state_map.get(v, v)]),
|
||||
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),
|
||||
force=dict(fmt="--force", style=ArgFormat.BOOLEAN),
|
||||
include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN),
|
||||
|
||||
@@ -307,7 +307,7 @@ EXAMPLES = '''
|
||||
community.general.redfish_command:
|
||||
category: Systems
|
||||
command: SetOneTimeBoot
|
||||
bootnext: BiosSetup
|
||||
boot_next: BiosSetup
|
||||
boot_override_mode: Legacy
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
|
||||
@@ -253,7 +253,7 @@ def set_interface_option(module, lines, iface, option, raw_value, state, address
|
||||
last_line_dict = iface_lines[-1]
|
||||
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)
|
||||
|
||||
# if more than one option found edit the last one
|
||||
|
||||
@@ -451,7 +451,8 @@ def main():
|
||||
if this_lv is None:
|
||||
if state == 'present':
|
||||
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
|
||||
if (lv or thinpool) and not size:
|
||||
for test_lv in lvs:
|
||||
|
||||
@@ -45,7 +45,7 @@ options:
|
||||
required: false
|
||||
type: bool
|
||||
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
|
||||
effect prior to I(state=reset).
|
||||
user:
|
||||
|
||||
@@ -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).
|
||||
On SmartOS, C(sm-set-timezone), for macOS, C(systemsetup), for BSD, C(/etc/localtime) is modified.
|
||||
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.4 support was added for macOS.
|
||||
- As of Ansible 2.9 support was added for AIX 6.1+
|
||||
|
||||
@@ -6,3 +6,4 @@ skip/osx
|
||||
skip/rhel8.2
|
||||
skip/rhel8.3
|
||||
skip/rhel8.4
|
||||
skip/rhel8.5
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
- '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
|
||||
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
|
||||
- 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")'
|
||||
# Tests use losetup which can not be used inside unprivileged container
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
name: reiserfs-utils
|
||||
state: present
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_distribution == 'Fedora' and (ansible_facts.distribution_major_version | int < 35)
|
||||
|
||||
- name: "Install reiserfs (OpenSuse)"
|
||||
ansible.builtin.package:
|
||||
|
||||
@@ -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
|
||||
@@ -2,6 +2,7 @@
|
||||
- name:
|
||||
set_fact:
|
||||
interfaces_testfile: '{{ remote_tmp_dir }}/interfaces'
|
||||
interfaces_testfile_3841: '{{ remote_tmp_dir }}/interfaces_3841'
|
||||
|
||||
- name: Copy interfaces file
|
||||
copy:
|
||||
@@ -31,3 +32,32 @@
|
||||
- assert:
|
||||
that:
|
||||
- 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
|
||||
|
||||
@@ -124,3 +124,29 @@
|
||||
- '"ansible-lint" in inject_pkgs_ansible_lint.application'
|
||||
- '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]'
|
||||
- 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'
|
||||
|
||||
@@ -18,7 +18,7 @@ redis_bin:
|
||||
CentOS: /usr/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
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
dependencies:
|
||||
- setup_pkg_mgr
|
||||
- setup_remote_constraints
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
- name: Install redis module
|
||||
pip:
|
||||
name: "{{ redis_module }}"
|
||||
extra_args: "-c {{ remote_constraints }}"
|
||||
state: present
|
||||
notify: cleanup redis
|
||||
|
||||
|
||||
@@ -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/compat/ipaddress.py no-assert
|
||||
plugins/module_utils/compat/ipaddress.py no-unicode-literals
|
||||
|
||||
@@ -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-unicode-literals
|
||||
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
|
||||
|
||||
@@ -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-unicode-literals
|
||||
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
|
||||
|
||||
@@ -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-unicode-literals
|
||||
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
|
||||
|
||||
@@ -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/compat/ipaddress.py no-assert
|
||||
plugins/module_utils/compat/ipaddress.py no-unicode-literals
|
||||
|
||||
@@ -563,6 +563,26 @@ ipv6.ignore-auto-dns: 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 = [
|
||||
{
|
||||
'type': 'wifi',
|
||||
@@ -668,6 +688,44 @@ ipv4.ignore-auto-routes: no
|
||||
ipv4.never-default: no
|
||||
ipv4.may-fail: yes
|
||||
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.ignore-auto-dns: 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, ""))
|
||||
|
||||
|
||||
@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
|
||||
def mocked_ethernet_connection_dhcp_to_static(mocker):
|
||||
mocker_set(mocker,
|
||||
@@ -955,6 +1024,24 @@ def mocked_dummy_connection_static_unchanged(mocker):
|
||||
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
|
||||
def mocked_gsm_connection_unchanged(mocker):
|
||||
mocker_set(mocker,
|
||||
@@ -2283,6 +2370,48 @@ def test_dummy_connection_static_unchanged(mocked_dummy_connection_static_unchan
|
||||
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'])
|
||||
def test_create_gsm(mocked_generic_connection_create, capfd):
|
||||
"""
|
||||
|
||||
21
tests/unit/plugins/modules/system/interfaces_file/README.md
Normal file
21
tests/unit/plugins/modules/system/interfaces_file/README.md
Normal 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!
|
||||
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# The loopback network interface
|
||||
auto lo eth0
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
iface eth0 inet dhcp
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# The loopback network interface
|
||||
auto lo eth0
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
iface eth0 inet dhcp
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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
Reference in New Issue
Block a user