Compare commits

..

12 commits
main ... 2.20.1

Author SHA1 Message Date
Felix Fontein
19363bb424 Release 2.2.0.1. 2025-04-19 16:24:18 +02:00
Felix Fontein
8aed0204cf
Declare 2.x.y EOL. (#362) 2025-04-19 16:20:32 +02:00
Felix Fontein
317fca8502
Use shared unit test utils from community.internal_test_tools (#353) (#357)
* Use shared unit test utils from community.internal_test_tools.

* Make sure community.internal_test_tools is installed in CI.

(cherry picked from commit 30a79061f3)
2025-03-22 11:57:24 +01:00
Felix Fontein
5f21f8f7c6
Use shared unit test utils from community.internal_test_tools (#353) (#354)
* Use shared unit test utils from community.internal_test_tools.

* Make sure community.internal_test_tools is installed in CI.

(cherry picked from commit 30a79061f3)
2025-03-12 21:47:20 +01:00
patchback[bot]
90780b9cd0
Fix typo in "API" (#351) (#352)
(cherry picked from commit ab446b4449)

Co-authored-by: hansmi <hansmi@users.noreply.github.com>
2025-03-12 20:12:13 +01:00
Felix Fontein
3a5b1175ff
Switch from ubuntu-20.04 to ubuntu-latest for old Ansible versions. (#349) 2025-03-11 21:56:44 +01:00
Felix Fontein
c5f1fb50d7 Improve tests (#348)
* Simplify filter error tests.

* Convert set_module_args to context manager.

(cherry picked from commit be9a7ed3ad)
2025-03-08 12:39:57 +01:00
Felix Fontein
f8f86f6ec0 Fix CI badge image URL. Add documentation badge.
(cherry picked from commit 1466c9f984)
2025-01-04 11:26:57 +01:00
Felix Fontein
8eab877140 Improve language.
(cherry picked from commit 77de6d90bf)
2024-12-28 14:27:41 +01:00
patchback[bot]
353027cb5c
Fix some issues pointed out by zizmor. (#333) (#334)
(cherry picked from commit 995ab18e7b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-12-14 15:17:24 +01:00
Felix Fontein
b0453b2e47 Fix reuse workflow branches.
(cherry picked from commit 5fdbd52303)
2024-10-19 12:37:15 +02:00
Felix Fontein
3af2968316 Update links to stable-2. 2024-10-19 12:31:31 +02:00
78 changed files with 2142 additions and 2359 deletions

View file

@ -1,6 +0,0 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# Reformat YAML: https://github.com/ansible-collections/community.routeros/pull/369
08152376de116e7d933d19ee25318f7a2eb222ae

View file

@ -9,7 +9,3 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
groups:
ci:
patterns:
- "*"

158
.github/workflows/ansible-test.yml vendored Normal file
View file

@ -0,0 +1,158 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# For the comprehensive list of the inputs supported by the ansible-community/ansible-test-gh-action GitHub Action, see
# https://github.com/marketplace/actions/ansible-test
name: CI
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches:
- main
- stable-*
pull_request:
# Run CI once per day (at 05:15 UTC)
schedule:
- cron: '15 5 * * *'
jobs:
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
# It's important that Sanity is tested against all stable-X.Y branches
# Testing against `devel` may fail as new tests are added.
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- stable-2.18
- devel
runs-on: ubuntu-latest
steps:
- name: Perform sanity testing
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.9", "stable-2.10", "stable-2.11"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }}
ansible-core-version: ${{ matrix.ansible }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
testing-type: sanity
# NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
pre-test-cmd: |-
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
units:
runs-on: ubuntu-latest
name: Units (Ⓐ${{ matrix.ansible }})
strategy:
# As soon as the first unit test fails, cancel the others to free up the CI queue
fail-fast: true
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- stable-2.18
- devel
steps:
- name: >-
Perform unit testing against
Ansible version ${{ matrix.ansible }}
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.9", "stable-2.10", "stable-2.11"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }}
ansible-core-version: ${{ matrix.ansible }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
testing-type: units
# NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
pre-test-cmd: |-
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
integration:
runs-on: ubuntu-latest
name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
fail-fast: false
matrix:
ansible:
- devel
python:
- "3.10"
- "3.11"
- "3.12"
include:
# 2.9
- ansible: stable-2.9
python: 2.7
- ansible: stable-2.9
python: 3.5
# 2.10
- ansible: stable-2.10
python: 3.5
# 2.11
- ansible: stable-2.11
python: 2.7
- ansible: stable-2.11
python: 3.6
# 2.12
- ansible: stable-2.12
python: 3.8
# 2.13
- ansible: stable-2.13
python: "3.10"
# 2.14
- ansible: stable-2.14
python: "3.11"
# 2.15
- ansible: stable-2.15
python: "3.9"
# 2.16
- ansible: stable-2.16
python: "3.10"
# 2.17
- ansible: stable-2.17
python: "3.7"
# 2.18
- ansible: stable-2.18
python: "3.8"
steps:
- name: >-
Perform integration testing against
Ansible version ${{ matrix.ansible }}
under Python ${{ matrix.python }}
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.9", "stable-2.10", "stable-2.11"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }}
ansible-core-version: ${{ matrix.ansible }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
integration-continue-on-error: 'false'
integration-diff: 'false'
integration-retry-on-error: 'true'
# NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
pre-test-cmd: |-
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
target-python-version: ${{ matrix.python }}
testing-type: integration

View file

@ -7,7 +7,7 @@ name: Collection Docs
concurrency: concurrency:
group: docs-pr-${{ github.head_ref }} group: docs-pr-${{ github.head_ref }}
cancel-in-progress: true cancel-in-progress: true
'on': on:
pull_request_target: pull_request_target:
types: [opened, synchronize, reopened, closed] types: [opened, synchronize, reopened, closed]

View file

@ -7,7 +7,7 @@ name: Collection Docs
concurrency: concurrency:
group: docs-push-${{ github.sha }} group: docs-push-${{ github.sha }}
cancel-in-progress: true cancel-in-progress: true
'on': on:
push: push:
branches: branches:
- main - main

164
.github/workflows/ee.yml vendored Normal file
View file

@ -0,0 +1,164 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
name: execution environment
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches:
- main
- stable-*
pull_request:
# Run CI once per day (at 05:15 UTC)
# This ensures that even if there haven't been commits that we are still testing against latest version of ansible-builder
schedule:
- cron: '15 5 * * *'
env:
NAMESPACE: community
COLLECTION_NAME: routeros
jobs:
build:
name: Build and test EE (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
name:
- ''
ansible_core:
- ''
ansible_runner:
- ''
base_image:
- ''
pre_base:
- ''
extra_vars:
- ''
other_deps:
- ''
exclude:
- ansible_core: ''
include:
- name: ansible-core devel @ RHEL UBI 9
ansible_core: https://github.com/ansible/ansible/archive/devel.tar.gz
ansible_runner: ansible-runner
other_deps: |2
python_interpreter:
package_system: python3.11 python3.11-pip python3.11-wheel python3.11-cryptography
python_path: "/usr/bin/python3.11"
base_image: docker.io/redhat/ubi9:latest
pre_base: '"#"'
- name: ansible-core 2.15 @ Rocky Linux 9
ansible_core: https://github.com/ansible/ansible/archive/stable-2.15.tar.gz
ansible_runner: ansible-runner
base_image: quay.io/rockylinux/rockylinux:9
pre_base: '"#"'
- name: ansible-core 2.14 @ CentOS Stream 9
ansible_core: https://github.com/ansible/ansible/archive/stable-2.14.tar.gz
ansible_runner: ansible-runner
base_image: quay.io/centos/centos:stream9
pre_base: '"#"'
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install ansible-builder and ansible-navigator
run: pip install ansible-builder ansible-navigator
- name: Verify requirements
run: ansible-builder introspect --sanitize .
- name: Make sure galaxy.yml has version entry
run: >-
python -c
'import yaml ;
f = open("galaxy.yml", "rb") ;
data = yaml.safe_load(f) ;
f.close() ;
data["version"] = data.get("version") or "0.0.1" ;
f = open("galaxy.yml", "wb") ;
f.write(yaml.dump(data).encode("utf-8")) ;
f.close() ;
'
working-directory: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
- name: Build collection
run: |
ansible-galaxy collection build --output-path ../../../
working-directory: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
- name: Create files for building execution environment
run: |
COLLECTION_FILENAME="$(ls "${NAMESPACE}-${COLLECTION_NAME}"-*.tar.gz)"
# EE config
cat > execution-environment.yml <<EOF
---
version: 3
dependencies:
ansible_core:
package_pip: ${{ matrix.ansible_core }}
ansible_runner:
package_pip: ${{ matrix.ansible_runner }}
galaxy: requirements.yml
${{ matrix.other_deps }}
images:
base_image:
name: ${{ matrix.base_image }}
additional_build_files:
- src: ${COLLECTION_FILENAME}
dest: src
additional_build_steps:
prepend_base:
- ${{ matrix.pre_base }}
EOF
echo "::group::execution-environment.yml"
cat execution-environment.yml
echo "::endgroup::"
# Requirements
cat > requirements.yml <<EOF
---
collections:
- name: src/${COLLECTION_FILENAME}
type: file
EOF
echo "::group::requirements.yml"
cat requirements.yml
echo "::endgroup::"
- name: Build image based on ${{ matrix.base_image }}
run: |
ansible-builder build --verbosity 3 --tag test-ee:latest --container-runtime docker
- name: Show images
run: docker image ls
- name: Run basic tests
run: >
ansible-navigator run
--mode stdout
--container-engine docker
--pull-policy never
--set-environment-variable ANSIBLE_PRIVATE_ROLE_VARS=true
--execution-environment-image test-ee:latest
-v
all.yml
${{ matrix.extra_vars }}
working-directory: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}/tests/ee

52
.github/workflows/extra-tests.yml vendored Normal file
View file

@ -0,0 +1,52 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
name: extra-tests
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches:
- main
- stable-*
pull_request:
# Run CI once per day (at 05:15 UTC)
# This ensures that even if there haven't been commits that we are still testing against latest version of ansible-test for each ansible-base version
schedule:
- cron: '15 5 * * *'
env:
NAMESPACE: community
COLLECTION_NAME: routeros
jobs:
extra-sanity:
name: Extra Sanity
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install ansible-core
run: pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
- name: Install collection dependencies
run: |
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ./ansible_collections/community/internal_test_tools
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ./ansible_collections/ansible/netcommon
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ./ansible_collections/ansible/utils
# NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
# run: ansible-galaxy collection install community.internal_test_tools ansible.netcommon -p .
- name: Run sanity tests
run: ../../community/internal_test_tools/tools/run.py --color
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

20
.github/workflows/import-galaxy.yml vendored Normal file
View file

@ -0,0 +1,20 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
name: import-galaxy
'on':
# Run CI against all pushes (direct commits, also merged PRs) to main, and all Pull Requests
push:
branches:
- main
- stable-*
pull_request:
jobs:
import-galaxy:
permissions:
contents: read
name: Test to import built collection artifact with Galaxy importer
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main

View file

@ -3,33 +3,31 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
name: nox name: Verify REUSE
'on':
on:
push: push:
branches: branches:
- main - main
- stable-* - stable-*
pull_request: pull_request:
branches:
- main
- stable-*
# Run CI once per day (at 05:15 UTC) # Run CI once per day (at 05:15 UTC)
schedule: schedule:
- cron: '15 5 * * *' - cron: '15 5 * * *'
workflow_dispatch:
jobs: jobs:
nox: check:
permissions:
contents: read
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: "Run extra sanity tests"
steps: steps:
- name: Check out collection - uses: actions/checkout@v4
uses: actions/checkout@v5
with: with:
persist-credentials: false persist-credentials: false
- name: Run nox
uses: ansible-community/antsibull-nox@main
ansible-test: - name: REUSE Compliance Check
uses: ansible-community/antsibull-nox/.github/workflows/reusable-nox-matrix.yml@main uses: fsfe/reuse-action@v4
with:
upload-codecov: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

1
.gitignore vendored
View file

@ -4,7 +4,6 @@
/tests/output/ /tests/output/
/changelogs/.plugin-cache.yaml /changelogs/.plugin-cache.yaml
/tests/integration/inventory
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/

5
.reuse/dep5 Normal file
View file

@ -0,0 +1,5 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: changelogs/fragments/*
Copyright: Ansible Project
License: GPL-3.0-or-later

View file

@ -1,53 +0,0 @@
---
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Felix Fontein <felix@fontein.de>
extends: default
ignore: |
/changelogs/
rules:
line-length:
max: 300
level: error
document-start:
present: true
document-end: false
truthy:
level: error
allowed-values:
- 'true'
- 'false'
indentation:
spaces: 2
indent-sequences: true
key-duplicates: enable
trailing-spaces: enable
new-line-at-end-of-file: disable
hyphens:
max-spaces-after: 1
empty-lines:
max: 2
max-start: 0
max-end: 0
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
colons:
max-spaces-before: 0
max-spaces-after: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
braces:
min-spaces-inside: 0
max-spaces-inside: 1
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
comments:
min-spaces-from-content: 1
comments-indentation: false

View file

@ -1,54 +0,0 @@
---
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Felix Fontein <felix@fontein.de>
extends: default
ignore: |
/changelogs/
rules:
line-length:
max: 160
level: error
document-start:
present: false
document-end:
present: false
truthy:
level: error
allowed-values:
- 'true'
- 'false'
indentation:
spaces: 2
indent-sequences: true
key-duplicates: enable
trailing-spaces: enable
new-line-at-end-of-file: disable
hyphens:
max-spaces-after: 1
empty-lines:
max: 2
max-start: 0
max-end: 0
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
colons:
max-spaces-before: 0
max-spaces-after: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
braces:
min-spaces-inside: 0
max-spaces-inside: 1
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
comments:
min-spaces-from-content: 1
comments-indentation: false

View file

@ -1,54 +0,0 @@
---
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Felix Fontein <felix@fontein.de>
extends: default
ignore: |
/changelogs/
rules:
line-length:
max: 160
level: error
document-start:
present: true
document-end:
present: false
truthy:
level: error
allowed-values:
- 'true'
- 'false'
indentation:
spaces: 2
indent-sequences: true
key-duplicates: enable
trailing-spaces: enable
new-line-at-end-of-file: disable
hyphens:
max-spaces-after: 1
empty-lines:
max: 2
max-start: 0
max-end: 0
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
colons:
max-spaces-before: 0
max-spaces-after: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
braces:
min-spaces-inside: 0
max-spaces-inside: 1
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
comments:
min-spaces-from-content: 1
comments-indentation: false

View file

@ -1,53 +0,0 @@
---
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Felix Fontein <felix@fontein.de>
extends: default
ignore: |
/changelogs/
rules:
line-length:
max: 160
level: error
document-start: disable
document-end:
present: false
truthy:
level: error
allowed-values:
- 'true'
- 'false'
indentation:
spaces: 2
indent-sequences: true
key-duplicates: enable
trailing-spaces: enable
new-line-at-end-of-file: disable
hyphens:
max-spaces-after: 1
empty-lines:
max: 2
max-start: 0
max-end: 0
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
colons:
max-spaces-before: 0
max-spaces-after: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
braces:
min-spaces-inside: 0
max-spaces-inside: 1
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
comments:
min-spaces-from-content: 1
comments-indentation: false

View file

@ -2,346 +2,147 @@
**Topics** **Topics**
- <a href="#v3-9-0">v3\.9\.0</a> - <a href="#v2-20-1">v2\.20\.1</a>
- <a href="#release-summary">Release Summary</a> - <a href="#release-summary">Release Summary</a>
- <a href="#minor-changes">Minor Changes</a> - <a href="#v2-20-0">v2\.20\.0</a>
- <a href="#bugfixes">Bugfixes</a>
- <a href="#v3-8-1">v3\.8\.1</a>
- <a href="#release-summary-1">Release Summary</a> - <a href="#release-summary-1">Release Summary</a>
- <a href="#bugfixes-1">Bugfixes</a> - <a href="#minor-changes">Minor Changes</a>
- <a href="#v3-8-0">v3\.8\.0</a> - <a href="#v2-19-0">v2\.19\.0</a>
- <a href="#release-summary-2">Release Summary</a> - <a href="#release-summary-2">Release Summary</a>
- <a href="#minor-changes-1">Minor Changes</a> - <a href="#minor-changes-1">Minor Changes</a>
- <a href="#v3-7-0">v3\.7\.0</a> - <a href="#v2-18-0">v2\.18\.0</a>
- <a href="#release-summary-3">Release Summary</a> - <a href="#release-summary-3">Release Summary</a>
- <a href="#minor-changes-2">Minor Changes</a> - <a href="#minor-changes-2">Minor Changes</a>
- <a href="#v3-6-0">v3\.6\.0</a> - <a href="#deprecated-features">Deprecated Features</a>
- <a href="#bugfixes">Bugfixes</a>
- <a href="#v2-17-0">v2\.17\.0</a>
- <a href="#release-summary-4">Release Summary</a> - <a href="#release-summary-4">Release Summary</a>
- <a href="#minor-changes-3">Minor Changes</a> - <a href="#minor-changes-3">Minor Changes</a>
- <a href="#v3-5-0">v3\.5\.0</a> - <a href="#v2-16-0">v2\.16\.0</a>
- <a href="#release-summary-5">Release Summary</a> - <a href="#release-summary-5">Release Summary</a>
- <a href="#minor-changes-4">Minor Changes</a> - <a href="#minor-changes-4">Minor Changes</a>
- <a href="#v3-4-0">v3\.4\.0</a> - <a href="#v2-15-0">v2\.15\.0</a>
- <a href="#release-summary-6">Release Summary</a> - <a href="#release-summary-6">Release Summary</a>
- <a href="#minor-changes-5">Minor Changes</a> - <a href="#minor-changes-5">Minor Changes</a>
- <a href="#bugfixes-2">Bugfixes</a> - <a href="#v2-14-0">v2\.14\.0</a>
- <a href="#v3-3-0">v3\.3\.0</a>
- <a href="#release-summary-7">Release Summary</a> - <a href="#release-summary-7">Release Summary</a>
- <a href="#minor-changes-6">Minor Changes</a> - <a href="#minor-changes-6">Minor Changes</a>
- <a href="#v3-2-0">v3\.2\.0</a> - <a href="#v2-13-0">v2\.13\.0</a>
- <a href="#release-summary-8">Release Summary</a> - <a href="#release-summary-8">Release Summary</a>
- <a href="#minor-changes-7">Minor Changes</a> - <a href="#minor-changes-7">Minor Changes</a>
- <a href="#v3-1-0">v3\.1\.0</a> - <a href="#bugfixes-1">Bugfixes</a>
- <a href="#v2-12-0">v2\.12\.0</a>
- <a href="#release-summary-9">Release Summary</a> - <a href="#release-summary-9">Release Summary</a>
- <a href="#minor-changes-8">Minor Changes</a> - <a href="#minor-changes-8">Minor Changes</a>
- <a href="#bugfixes-3">Bugfixes</a>
- <a href="#v3-0-0">v3\.0\.0</a>
- <a href="#release-summary-10">Release Summary</a>
- <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
- <a href="#removed-features-previously-deprecated">Removed Features \(previously deprecated\)</a>
- <a href="#v2-20-0">v2\.20\.0</a>
- <a href="#release-summary-11">Release Summary</a>
- <a href="#minor-changes-9">Minor Changes</a>
- <a href="#v2-19-0">v2\.19\.0</a>
- <a href="#release-summary-12">Release Summary</a>
- <a href="#minor-changes-10">Minor Changes</a>
- <a href="#v2-18-0">v2\.18\.0</a>
- <a href="#release-summary-13">Release Summary</a>
- <a href="#minor-changes-11">Minor Changes</a>
- <a href="#deprecated-features">Deprecated Features</a>
- <a href="#bugfixes-4">Bugfixes</a>
- <a href="#v2-17-0">v2\.17\.0</a>
- <a href="#release-summary-14">Release Summary</a>
- <a href="#minor-changes-12">Minor Changes</a>
- <a href="#v2-16-0">v2\.16\.0</a>
- <a href="#release-summary-15">Release Summary</a>
- <a href="#minor-changes-13">Minor Changes</a>
- <a href="#v2-15-0">v2\.15\.0</a>
- <a href="#release-summary-16">Release Summary</a>
- <a href="#minor-changes-14">Minor Changes</a>
- <a href="#v2-14-0">v2\.14\.0</a>
- <a href="#release-summary-17">Release Summary</a>
- <a href="#minor-changes-15">Minor Changes</a>
- <a href="#v2-13-0">v2\.13\.0</a>
- <a href="#release-summary-18">Release Summary</a>
- <a href="#minor-changes-16">Minor Changes</a>
- <a href="#bugfixes-5">Bugfixes</a>
- <a href="#v2-12-0">v2\.12\.0</a>
- <a href="#release-summary-19">Release Summary</a>
- <a href="#minor-changes-17">Minor Changes</a>
- <a href="#v2-11-0">v2\.11\.0</a> - <a href="#v2-11-0">v2\.11\.0</a>
- <a href="#release-summary-20">Release Summary</a> - <a href="#release-summary-10">Release Summary</a>
- <a href="#minor-changes-18">Minor Changes</a> - <a href="#minor-changes-9">Minor Changes</a>
- <a href="#v2-10-0">v2\.10\.0</a> - <a href="#v2-10-0">v2\.10\.0</a>
- <a href="#release-summary-21">Release Summary</a> - <a href="#release-summary-11">Release Summary</a>
- <a href="#minor-changes-19">Minor Changes</a> - <a href="#minor-changes-10">Minor Changes</a>
- <a href="#bugfixes-6">Bugfixes</a> - <a href="#bugfixes-2">Bugfixes</a>
- <a href="#v2-9-0">v2\.9\.0</a> - <a href="#v2-9-0">v2\.9\.0</a>
- <a href="#release-summary-22">Release Summary</a> - <a href="#release-summary-12">Release Summary</a>
- <a href="#minor-changes-20">Minor Changes</a> - <a href="#minor-changes-11">Minor Changes</a>
- <a href="#bugfixes-7">Bugfixes</a> - <a href="#bugfixes-3">Bugfixes</a>
- <a href="#v2-8-3">v2\.8\.3</a> - <a href="#v2-8-3">v2\.8\.3</a>
- <a href="#release-summary-23">Release Summary</a> - <a href="#release-summary-13">Release Summary</a>
- <a href="#known-issues">Known Issues</a> - <a href="#known-issues">Known Issues</a>
- <a href="#v2-8-2">v2\.8\.2</a> - <a href="#v2-8-2">v2\.8\.2</a>
- <a href="#release-summary-24">Release Summary</a> - <a href="#release-summary-14">Release Summary</a>
- <a href="#bugfixes-8">Bugfixes</a> - <a href="#bugfixes-4">Bugfixes</a>
- <a href="#v2-8-1">v2\.8\.1</a> - <a href="#v2-8-1">v2\.8\.1</a>
- <a href="#release-summary-25">Release Summary</a> - <a href="#release-summary-15">Release Summary</a>
- <a href="#bugfixes-9">Bugfixes</a> - <a href="#bugfixes-5">Bugfixes</a>
- <a href="#v2-8-0">v2\.8\.0</a> - <a href="#v2-8-0">v2\.8\.0</a>
- <a href="#release-summary-26">Release Summary</a> - <a href="#release-summary-16">Release Summary</a>
- <a href="#minor-changes-21">Minor Changes</a> - <a href="#minor-changes-12">Minor Changes</a>
- <a href="#bugfixes-10">Bugfixes</a> - <a href="#bugfixes-6">Bugfixes</a>
- <a href="#v2-7-0">v2\.7\.0</a> - <a href="#v2-7-0">v2\.7\.0</a>
- <a href="#release-summary-27">Release Summary</a> - <a href="#release-summary-17">Release Summary</a>
- <a href="#minor-changes-22">Minor Changes</a> - <a href="#minor-changes-13">Minor Changes</a>
- <a href="#bugfixes-11">Bugfixes</a> - <a href="#bugfixes-7">Bugfixes</a>
- <a href="#v2-6-0">v2\.6\.0</a> - <a href="#v2-6-0">v2\.6\.0</a>
- <a href="#release-summary-28">Release Summary</a> - <a href="#release-summary-18">Release Summary</a>
- <a href="#minor-changes-23">Minor Changes</a> - <a href="#minor-changes-14">Minor Changes</a>
- <a href="#bugfixes-12">Bugfixes</a> - <a href="#bugfixes-8">Bugfixes</a>
- <a href="#v2-5-0">v2\.5\.0</a> - <a href="#v2-5-0">v2\.5\.0</a>
- <a href="#release-summary-29">Release Summary</a> - <a href="#release-summary-19">Release Summary</a>
- <a href="#minor-changes-24">Minor Changes</a> - <a href="#minor-changes-15">Minor Changes</a>
- <a href="#bugfixes-13">Bugfixes</a> - <a href="#bugfixes-9">Bugfixes</a>
- <a href="#v2-4-0">v2\.4\.0</a> - <a href="#v2-4-0">v2\.4\.0</a>
- <a href="#release-summary-30">Release Summary</a> - <a href="#release-summary-20">Release Summary</a>
- <a href="#minor-changes-25">Minor Changes</a> - <a href="#minor-changes-16">Minor Changes</a>
- <a href="#bugfixes-14">Bugfixes</a> - <a href="#bugfixes-10">Bugfixes</a>
- <a href="#known-issues-1">Known Issues</a> - <a href="#known-issues-1">Known Issues</a>
- <a href="#v2-3-1">v2\.3\.1</a> - <a href="#v2-3-1">v2\.3\.1</a>
- <a href="#release-summary-31">Release Summary</a> - <a href="#release-summary-21">Release Summary</a>
- <a href="#known-issues-2">Known Issues</a> - <a href="#known-issues-2">Known Issues</a>
- <a href="#v2-3-0">v2\.3\.0</a> - <a href="#v2-3-0">v2\.3\.0</a>
- <a href="#release-summary-32">Release Summary</a> - <a href="#release-summary-22">Release Summary</a>
- <a href="#minor-changes-26">Minor Changes</a> - <a href="#minor-changes-17">Minor Changes</a>
- <a href="#bugfixes-15">Bugfixes</a> - <a href="#bugfixes-11">Bugfixes</a>
- <a href="#v2-2-1">v2\.2\.1</a> - <a href="#v2-2-1">v2\.2\.1</a>
- <a href="#release-summary-33">Release Summary</a> - <a href="#release-summary-23">Release Summary</a>
- <a href="#bugfixes-16">Bugfixes</a> - <a href="#bugfixes-12">Bugfixes</a>
- <a href="#v2-2-0">v2\.2\.0</a> - <a href="#v2-2-0">v2\.2\.0</a>
- <a href="#release-summary-34">Release Summary</a> - <a href="#release-summary-24">Release Summary</a>
- <a href="#minor-changes-27">Minor Changes</a> - <a href="#minor-changes-18">Minor Changes</a>
- <a href="#bugfixes-17">Bugfixes</a> - <a href="#bugfixes-13">Bugfixes</a>
- <a href="#new-modules">New Modules</a> - <a href="#new-modules">New Modules</a>
- <a href="#v2-1-0">v2\.1\.0</a> - <a href="#v2-1-0">v2\.1\.0</a>
- <a href="#release-summary-35">Release Summary</a> - <a href="#release-summary-25">Release Summary</a>
- <a href="#minor-changes-28">Minor Changes</a> - <a href="#minor-changes-19">Minor Changes</a>
- <a href="#bugfixes-18">Bugfixes</a> - <a href="#bugfixes-14">Bugfixes</a>
- <a href="#new-modules-1">New Modules</a> - <a href="#new-modules-1">New Modules</a>
- <a href="#v2-0-0">v2\.0\.0</a> - <a href="#v2-0-0">v2\.0\.0</a>
- <a href="#release-summary-36">Release Summary</a> - <a href="#release-summary-26">Release Summary</a>
- <a href="#minor-changes-29">Minor Changes</a> - <a href="#minor-changes-20">Minor Changes</a>
- <a href="#breaking-changes--porting-guide-1">Breaking Changes / Porting Guide</a> - <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
- <a href="#bugfixes-19">Bugfixes</a> - <a href="#bugfixes-15">Bugfixes</a>
- <a href="#new-plugins">New Plugins</a> - <a href="#new-plugins">New Plugins</a>
- <a href="#filter">Filter</a> - <a href="#filter">Filter</a>
- <a href="#v1-2-0">v1\.2\.0</a> - <a href="#v1-2-0">v1\.2\.0</a>
- <a href="#release-summary-37">Release Summary</a> - <a href="#release-summary-27">Release Summary</a>
- <a href="#minor-changes-30">Minor Changes</a> - <a href="#minor-changes-21">Minor Changes</a>
- <a href="#bugfixes-20">Bugfixes</a> - <a href="#bugfixes-16">Bugfixes</a>
- <a href="#v1-1-0">v1\.1\.0</a> - <a href="#v1-1-0">v1\.1\.0</a>
- <a href="#release-summary-38">Release Summary</a> - <a href="#release-summary-28">Release Summary</a>
- <a href="#minor-changes-31">Minor Changes</a> - <a href="#minor-changes-22">Minor Changes</a>
- <a href="#v1-0-1">v1\.0\.1</a> - <a href="#v1-0-1">v1\.0\.1</a>
- <a href="#release-summary-39">Release Summary</a> - <a href="#release-summary-29">Release Summary</a>
- <a href="#bugfixes-21">Bugfixes</a> - <a href="#bugfixes-17">Bugfixes</a>
- <a href="#v1-0-0">v1\.0\.0</a> - <a href="#v1-0-0">v1\.0\.0</a>
- <a href="#release-summary-40">Release Summary</a> - <a href="#release-summary-30">Release Summary</a>
- <a href="#bugfixes-22">Bugfixes</a> - <a href="#bugfixes-18">Bugfixes</a>
- <a href="#v0-1-1">v0\.1\.1</a> - <a href="#v0-1-1">v0\.1\.1</a>
- <a href="#release-summary-41">Release Summary</a> - <a href="#release-summary-31">Release Summary</a>
- <a href="#bugfixes-23">Bugfixes</a> - <a href="#bugfixes-19">Bugfixes</a>
- <a href="#v0-1-0">v0\.1\.0</a> - <a href="#v0-1-0">v0\.1\.0</a>
- <a href="#release-summary-42">Release Summary</a> - <a href="#release-summary-32">Release Summary</a>
- <a href="#minor-changes-32">Minor Changes</a> - <a href="#minor-changes-23">Minor Changes</a>
<a id="v3-9-0"></a> <a id="v2-20-1"></a>
## v3\.9\.0 ## v2\.20\.1
<a id="release-summary"></a> <a id="release-summary"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. This is the final community\.routeros 2\.x\.y release\.
<a id="minor-changes"></a> Please upgrade to community\.routeros 3\.x\.y as soon as possible to receive further bugfixes\.
### Minor Changes
* api\_info\, api modify \- add <code>remote\-log\-format</code>\, <code>remote\-protocol</code>\, and <code>event\-delimiter</code> to <code>system logging action</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/381](https\://github\.com/ansible\-collections/community\.routeros/pull/381)\)\. Thanks to everyone who contributed to community\.routeros 2\.x\.y releases\!
* api\_info\, api\_modify \- add <code>disable\-link\-local\-address</code> and <code>stale\-neighbor\-timeout</code> fields to <code>ipv6 settings</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/380](https\://github\.com/ansible\-collections/community\.routeros/pull/380)\)\.
* api\_info\, api\_modify \- adjust neighbor limit fields in <code>ipv6 settings</code> to match RouterOS 7\.18 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/380](https\://github\.com/ansible\-collections/community\.routeros/pull/380)\)\.
* api\_info\, api\_modify \- set <code>passthrough</code> default in <code>ip firewall mangle</code> to <code>true</code> for RouterOS 7\.19 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/382](https\://github\.com/ansible\-collections/community\.routeros/pull/382)\)\.
* api\_info\, api\_modify \- since RouterOS 7\.17 VRF is supported for OVPN server\. It now supports multiple entries\, while <code>api\_modify</code> so far only accepted a single entry\. The <code>interface ovpn\-server server</code> path now allows multiple entries on RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/383](https\://github\.com/ansible\-collections/community\.routeros/pull/383)\)\.
<a id="bugfixes"></a>
### Bugfixes
* routeros terminal plugin \- fix <code>terminal\_stdout\_re</code> pattern to handle long system identities when connecting to RouterOS through SSH \([https\://github\.com/ansible\-collections/community\.routeros/pull/386](https\://github\.com/ansible\-collections/community\.routeros/pull/386)\)\.
<a id="v3-8-1"></a>
## v3\.8\.1
<a id="release-summary-1"></a>
### Release Summary
Bugfix release\.
<a id="bugfixes-1"></a>
### Bugfixes
* facts and api\_facts modules \- prevent deprecation warnings when used with ansible\-core 2\.19 \([https\://github\.com/ansible\-collections/community\.routeros/pull/384](https\://github\.com/ansible\-collections/community\.routeros/pull/384)\)\.
<a id="v3-8-0"></a>
## v3\.8\.0
<a id="release-summary-2"></a>
### Release Summary
Feature release\.
<a id="minor-changes-1"></a>
### Minor Changes
* api\_info\, api\_modify \- add <code>interface ethernet switch port\-isolation</code> which is supported since RouterOS 6\.43 \([https\://github\.com/ansible\-collections/community\.routeros/pull/375](https\://github\.com/ansible\-collections/community\.routeros/pull/375)\)\.
* api\_info\, api\_modify \- add <code>routing bfd configuration</code>\. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7\.11
\([https\://github\.com/ansible\-collections/community\.routeros/pull/375](https\://github\.com/ansible\-collections/community\.routeros/pull/375)\)\.
* api\_modify\, api\_info \- support API path <code>ip ipsec mode\-config</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/376](https\://github\.com/ansible\-collections/community\.routeros/pull/376)\)\.
<a id="v3-7-0"></a>
## v3\.7\.0
<a id="release-summary-3"></a>
### Release Summary
Feature release\.
<a id="minor-changes-2"></a>
### Minor Changes
* api\_find\_and\_modify \- allow to control whether <code>dynamic</code> and/or <code>builtin</code> entries are ignored with the new <code>ignore\_dynamic</code> and <code>ignore\_builtin</code> options \([https\://github\.com/ansible\-collections/community\.routeros/issues/372](https\://github\.com/ansible\-collections/community\.routeros/issues/372)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/373](https\://github\.com/ansible\-collections/community\.routeros/pull/373)\)\.
* api\_info\, api\_modify \- add <code>port\-cost\-mode</code> to <code>interface bridge</code> which is supported since RouterOS 7\.13 \([https\://github\.com/ansible\-collections/community\.routeros/pull/371](https\://github\.com/ansible\-collections/community\.routeros/pull/371)\)\.
<a id="v3-6-0"></a>
## v3\.6\.0
<a id="release-summary-4"></a>
### Release Summary
Feature release\.
<a id="minor-changes-3"></a>
### Minor Changes
* api\_info\, api\_modify \- add <code>mdns\-repeat\-ifaces</code> to <code>ip dns</code> for RouterOS 7\.16 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/358](https\://github\.com/ansible\-collections/community\.routeros/pull/358)\)\.
* api\_info\, api\_modify \- field name change in <code>routing bgp connection</code> path implemented by RouterOS 7\.19 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/360](https\://github\.com/ansible\-collections/community\.routeros/pull/360)\)\.
* api\_info\, api\_modify \- rename <code>is\-responder</code> property in <code>interface wireguard peers</code> to <code>responder</code> for RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/364](https\://github\.com/ansible\-collections/community\.routeros/pull/364)\)\.
<a id="v3-5-0"></a>
## v3\.5\.0
<a id="release-summary-5"></a>
### Release Summary
Feature release\.
<a id="minor-changes-4"></a>
### Minor Changes
* api\_info\, api\_modify \- change default for <code>/ip/cloud/ddns\-enabled</code> for RouterOS 7\.17 and newer from <code>yes</code> to <code>auto</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/350](https\://github\.com/ansible\-collections/community\.routeros/pull/350)\)\.
<a id="v3-4-0"></a>
## v3\.4\.0
<a id="release-summary-6"></a>
### Release Summary
Feature and bugfix release\.
<a id="minor-changes-5"></a>
### Minor Changes
* api\_info\, api\_modify \- add support for the <code>ip dns forwarders</code> path implemented by RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/343](https\://github\.com/ansible\-collections/community\.routeros/pull/343)\)\.
<a id="bugfixes-2"></a>
### Bugfixes
* api\_info\, api\_modify \- remove the primary key <code>action</code> from the <code>interface wifi provisioning</code> path\, since RouterOS also allows to create completely duplicate entries \([https\://github\.com/ansible\-collections/community\.routeros/issues/344](https\://github\.com/ansible\-collections/community\.routeros/issues/344)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/345](https\://github\.com/ansible\-collections/community\.routeros/pull/345)\)\.
<a id="v3-3-0"></a>
## v3\.3\.0
<a id="release-summary-7"></a>
### Release Summary
Feature release\.
<a id="minor-changes-6"></a>
### Minor Changes
* api\_info\, api\_modify \- add missing attribute <code>require\-message\-auth</code> for the <code>radius</code> path which exists since RouterOS version 7\.15 \([https\://github\.com/ansible\-collections/community\.routeros/issues/338](https\://github\.com/ansible\-collections/community\.routeros/issues/338)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/339](https\://github\.com/ansible\-collections/community\.routeros/pull/339)\)\.
* api\_info\, api\_modify \- add the <code>interface 6to4</code> path\. Used to manage IPv6 tunnels via tunnel\-brokers like HE\, where native IPv6 is not provided \([https\://github\.com/ansible\-collections/community\.routeros/pull/342](https\://github\.com/ansible\-collections/community\.routeros/pull/342)\)\.
* api\_info\, api\_modify \- add the <code>interface wireless access\-list</code> and <code>interface wireless connect\-list</code> paths \([https\://github\.com/ansible\-collections/community\.routeros/issues/284](https\://github\.com/ansible\-collections/community\.routeros/issues/284)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/340](https\://github\.com/ansible\-collections/community\.routeros/pull/340)\)\.
* api\_info\, api\_modify \- add the <code>use\-interface\-duid</code> option for <code>ipv6 dhcp\-client</code> path\. This option prevents issues with Fritzbox modems and routers\, when using virtual interfaces \(like VLANs\) may create duplicated records in hosts config\, this breaks original \"expose\-host\" function\. Also add the <code>script</code>\, <code>custom\-duid</code> and <code>validate\-server\-duid</code> as backport from 7\.15 version update \([https\://github\.com/ansible\-collections/community\.routeros/pull/341](https\://github\.com/ansible\-collections/community\.routeros/pull/341)\)\.
<a id="v3-2-0"></a>
## v3\.2\.0
<a id="release-summary-8"></a>
### Release Summary
Feature release\.
<a id="minor-changes-7"></a>
### Minor Changes
* api\_info\, api\_modify \- add support for the <code>routing filter community\-list</code> path implemented by RouterOS 7 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/331](https\://github\.com/ansible\-collections/community\.routeros/pull/331)\)\.
<a id="v3-1-0"></a>
## v3\.1\.0
<a id="release-summary-9"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-8"></a>
### Minor Changes
* api\_info\, api\_modify \- add missing fields <code>comment</code>\, <code>next\-pool</code> to <code>ip pool</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/327](https\://github\.com/ansible\-collections/community\.routeros/pull/327)\)\.
<a id="bugfixes-3"></a>
### Bugfixes
* api\_info\, api\_modify \- fields <code>log</code> and <code>log\-prefix</code> in paths <code>ip firewall filter</code>\, <code>ip firewall mangle</code>\, <code>ip firewall nat</code>\, <code>ip firewall raw</code> now have the correct default values \([https\://github\.com/ansible\-collections/community\.routeros/pull/324](https\://github\.com/ansible\-collections/community\.routeros/pull/324)\)\.
<a id="v3-0-0"></a>
## v3\.0\.0
<a id="release-summary-10"></a>
### Release Summary
Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\.
<a id="breaking-changes--porting-guide"></a>
### Breaking Changes / Porting Guide
* command \- the module no longer declares that it supports check mode \([https\://github\.com/ansible\-collections/community\.routeros/pull/318](https\://github\.com/ansible\-collections/community\.routeros/pull/318)\)\.
<a id="removed-features-previously-deprecated"></a>
### Removed Features \(previously deprecated\)
* The collection no longer supports Ansible 2\.9\, ansible\-base 2\.10\, ansible\-core 2\.11\, ansible\-core 2\.12\, ansible\-core 2\.13\, and ansible\-core 2\.14\. If you need to continue using End of Life versions of Ansible/ansible\-base/ansible\-core\, please use community\.routeros 2\.x\.y \([https\://github\.com/ansible\-collections/community\.routeros/pull/318](https\://github\.com/ansible\-collections/community\.routeros/pull/318)\)\.
<a id="v2-20-0"></a> <a id="v2-20-0"></a>
## v2\.20\.0 ## v2\.20\.0
<a id="release-summary-11"></a> <a id="release-summary-1"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-9"></a> <a id="minor-changes"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add new parameters from the RouterOS 7\.16 release \([https\://github\.com/ansible\-collections/community\.routeros/pull/323](https\://github\.com/ansible\-collections/community\.routeros/pull/323)\)\. * api\_info\, api\_modify \- add new parameters from the RouterOS 7\.16 release \([https\://github\.com/ansible\-collections/community\.routeros/pull/323](https\://github\.com/ansible\-collections/community\.routeros/pull/323)\)\.
@ -352,12 +153,12 @@ Feature release\.
<a id="v2-19-0"></a> <a id="v2-19-0"></a>
## v2\.19\.0 ## v2\.19\.0
<a id="release-summary-12"></a> <a id="release-summary-2"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-10"></a> <a id="minor-changes-1"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add support for the <code>ip dns adlist</code> path implemented by RouterOS 7\.15 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/310](https\://github\.com/ansible\-collections/community\.routeros/pull/310)\)\. * api\_info\, api\_modify \- add support for the <code>ip dns adlist</code> path implemented by RouterOS 7\.15 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/310](https\://github\.com/ansible\-collections/community\.routeros/pull/310)\)\.
@ -369,12 +170,12 @@ Feature release\.
<a id="v2-18-0"></a> <a id="v2-18-0"></a>
## v2\.18\.0 ## v2\.18\.0
<a id="release-summary-13"></a> <a id="release-summary-3"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-11"></a> <a id="minor-changes-2"></a>
### Minor Changes ### Minor Changes
* api\_info \- allow to restrict the output by limiting fields to specific values with the new <code>restrict</code> option \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\. * api\_info \- allow to restrict the output by limiting fields to specific values with the new <code>restrict</code> option \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\.
@ -390,7 +191,7 @@ Feature release\.
* The collection deprecates support for all Ansible/ansible\-base/ansible\-core versions that are currently End of Life\, [according to the ansible\-core support matrix](https\://docs\.ansible\.com/ansible\-core/devel/reference\_appendices/release\_and\_maintenance\.html\#ansible\-core\-support\-matrix)\. This means that the next major release of the collection will no longer support Ansible 2\.9\, ansible\-base 2\.10\, ansible\-core 2\.11\, ansible\-core 2\.12\, ansible\-core 2\.13\, and ansible\-core 2\.14\. * The collection deprecates support for all Ansible/ansible\-base/ansible\-core versions that are currently End of Life\, [according to the ansible\-core support matrix](https\://docs\.ansible\.com/ansible\-core/devel/reference\_appendices/release\_and\_maintenance\.html\#ansible\-core\-support\-matrix)\. This means that the next major release of the collection will no longer support Ansible 2\.9\, ansible\-base 2\.10\, ansible\-core 2\.11\, ansible\-core 2\.12\, ansible\-core 2\.13\, and ansible\-core 2\.14\.
<a id="bugfixes-4"></a> <a id="bugfixes"></a>
### Bugfixes ### Bugfixes
* api\_modify\, api\_info \- change the default of <code>ingress\-filtering</code> in paths <code>interface bridge</code> and <code>interface bridge port</code> back to <code>false</code> for RouterOS before version 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\. * api\_modify\, api\_info \- change the default of <code>ingress\-filtering</code> in paths <code>interface bridge</code> and <code>interface bridge port</code> back to <code>false</code> for RouterOS before version 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\.
@ -398,12 +199,12 @@ Feature release\.
<a id="v2-17-0"></a> <a id="v2-17-0"></a>
## v2\.17\.0 ## v2\.17\.0
<a id="release-summary-14"></a> <a id="release-summary-4"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-12"></a> <a id="minor-changes-3"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add <code>system health settings</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/294](https\://github\.com/ansible\-collections/community\.routeros/pull/294)\)\. * api\_info\, api\_modify \- add <code>system health settings</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/294](https\://github\.com/ansible\-collections/community\.routeros/pull/294)\)\.
@ -413,12 +214,12 @@ Feature release\.
<a id="v2-16-0"></a> <a id="v2-16-0"></a>
## v2\.16\.0 ## v2\.16\.0
<a id="release-summary-15"></a> <a id="release-summary-5"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-13"></a> <a id="minor-changes-4"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add missing path <code>/ppp secret</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/286](https\://github\.com/ansible\-collections/community\.routeros/pull/286)\)\. * api\_info\, api\_modify \- add missing path <code>/ppp secret</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/286](https\://github\.com/ansible\-collections/community\.routeros/pull/286)\)\.
@ -427,12 +228,12 @@ Feature release\.
<a id="v2-15-0"></a> <a id="v2-15-0"></a>
## v2\.15\.0 ## v2\.15\.0
<a id="release-summary-16"></a> <a id="release-summary-6"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-14"></a> <a id="minor-changes-5"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- Add RouterOS 7\.x support to <code>/mpls ldp</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/271](https\://github\.com/ansible\-collections/community\.routeros/pull/271)\)\. * api\_info\, api\_modify \- Add RouterOS 7\.x support to <code>/mpls ldp</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/271](https\://github\.com/ansible\-collections/community\.routeros/pull/271)\)\.
@ -449,12 +250,12 @@ Feature release\.
<a id="v2-14-0"></a> <a id="v2-14-0"></a>
## v2\.14\.0 ## v2\.14\.0
<a id="release-summary-17"></a> <a id="release-summary-7"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-15"></a> <a id="minor-changes-6"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add read\-only fields <code>installed\-version</code>\, <code>latest\-version</code> and <code>status</code> in <code>system package update</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/263](https\://github\.com/ansible\-collections/community\.routeros/pull/263)\)\. * api\_info\, api\_modify \- add read\-only fields <code>installed\-version</code>\, <code>latest\-version</code> and <code>status</code> in <code>system package update</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/263](https\://github\.com/ansible\-collections/community\.routeros/pull/263)\)\.
@ -464,18 +265,18 @@ Feature release\.
<a id="v2-13-0"></a> <a id="v2-13-0"></a>
## v2\.13\.0 ## v2\.13\.0
<a id="release-summary-18"></a> <a id="release-summary-8"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. Bugfix and feature release\.
<a id="minor-changes-16"></a> <a id="minor-changes-7"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- make path <code>user group</code> modifiable and add <code>comment</code> attribute \([https\://github\.com/ansible\-collections/community\.routeros/issues/256](https\://github\.com/ansible\-collections/community\.routeros/issues/256)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/257](https\://github\.com/ansible\-collections/community\.routeros/pull/257)\)\. * api\_info\, api\_modify \- make path <code>user group</code> modifiable and add <code>comment</code> attribute \([https\://github\.com/ansible\-collections/community\.routeros/issues/256](https\://github\.com/ansible\-collections/community\.routeros/issues/256)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/257](https\://github\.com/ansible\-collections/community\.routeros/pull/257)\)\.
* api\_modify\, api\_info \- add support for the <code>ip vrf</code> path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/259](https\://github\.com/ansible\-collections/community\.routeros/pull/259)\) * api\_modify\, api\_info \- add support for the <code>ip vrf</code> path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/259](https\://github\.com/ansible\-collections/community\.routeros/pull/259)\)
<a id="bugfixes-5"></a> <a id="bugfixes-1"></a>
### Bugfixes ### Bugfixes
* facts \- fix date not getting removed for idempotent config export \([https\://github\.com/ansible\-collections/community\.routeros/pull/262](https\://github\.com/ansible\-collections/community\.routeros/pull/262)\)\. * facts \- fix date not getting removed for idempotent config export \([https\://github\.com/ansible\-collections/community\.routeros/pull/262](https\://github\.com/ansible\-collections/community\.routeros/pull/262)\)\.
@ -483,12 +284,12 @@ Bugfix and feature release\.
<a id="v2-12-0"></a> <a id="v2-12-0"></a>
## v2\.12\.0 ## v2\.12\.0
<a id="release-summary-19"></a> <a id="release-summary-9"></a>
### Release Summary ### Release Summary
Feature release\. Feature release\.
<a id="minor-changes-17"></a> <a id="minor-changes-8"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add <code>interface ovpn\-client</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/242](https\://github\.com/ansible\-collections/community\.routeros/issues/242)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/244](https\://github\.com/ansible\-collections/community\.routeros/pull/244)\)\. * api\_info\, api\_modify \- add <code>interface ovpn\-client</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/242](https\://github\.com/ansible\-collections/community\.routeros/issues/242)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/244](https\://github\.com/ansible\-collections/community\.routeros/pull/244)\)\.
@ -502,12 +303,12 @@ Feature release\.
<a id="v2-11-0"></a> <a id="v2-11-0"></a>
## v2\.11\.0 ## v2\.11\.0
<a id="release-summary-20"></a> <a id="release-summary-10"></a>
### Release Summary ### Release Summary
Feature and bugfix release\. Feature and bugfix release\.
<a id="minor-changes-18"></a> <a id="minor-changes-9"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add missing DoH parameters <code>doh\-max\-concurrent\-queries</code>\, <code>doh\-max\-server\-connections</code>\, and <code>doh\-timeout</code> to the <code>ip dns</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/230](https\://github\.com/ansible\-collections/community\.routeros/issues/230)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/235](https\://github\.com/ansible\-collections/community\.routeros/pull/235)\) * api\_info\, api\_modify \- add missing DoH parameters <code>doh\-max\-concurrent\-queries</code>\, <code>doh\-max\-server\-connections</code>\, and <code>doh\-timeout</code> to the <code>ip dns</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/230](https\://github\.com/ansible\-collections/community\.routeros/issues/230)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/235](https\://github\.com/ansible\-collections/community\.routeros/pull/235)\)
@ -522,12 +323,12 @@ Feature and bugfix release\.
<a id="v2-10-0"></a> <a id="v2-10-0"></a>
## v2\.10\.0 ## v2\.10\.0
<a id="release-summary-21"></a> <a id="release-summary-11"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. Bugfix and feature release\.
<a id="minor-changes-19"></a> <a id="minor-changes-10"></a>
### Minor Changes ### Minor Changes
* api\_info \- add new <code>include\_read\_only</code> option to select behavior for read\-only values\. By default these are not returned \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\. * api\_info \- add new <code>include\_read\_only</code> option to select behavior for read\-only values\. By default these are not returned \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\.
@ -551,7 +352,7 @@ Bugfix and feature release\.
* api\_modify \- add new <code>handle\_read\_only</code> and <code>handle\_write\_only</code> options to handle the module\'s behavior for read\-only and write\-only fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\. * api\_modify \- add new <code>handle\_read\_only</code> and <code>handle\_write\_only</code> options to handle the module\'s behavior for read\-only and write\-only fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\.
* api\_modify\, api\_info \- support API paths <code>routing id</code>\, <code>routing bgp connection</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/220](https\://github\.com/ansible\-collections/community\.routeros/pull/220)\)\. * api\_modify\, api\_info \- support API paths <code>routing id</code>\, <code>routing bgp connection</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/220](https\://github\.com/ansible\-collections/community\.routeros/pull/220)\)\.
<a id="bugfixes-6"></a> <a id="bugfixes-2"></a>
### Bugfixes ### Bugfixes
* api\_info\, api\_modify \- in the <code>snmp</code> path\, ensure that <code>engine\-id\-suffix</code> is only available on RouterOS 7\.10\+\, and that <code>engine\-id</code> is read\-only on RouterOS 7\.10\+ \([https\://github\.com/ansible\-collections/community\.routeros/issues/208](https\://github\.com/ansible\-collections/community\.routeros/issues/208)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/218](https\://github\.com/ansible\-collections/community\.routeros/pull/218)\)\. * api\_info\, api\_modify \- in the <code>snmp</code> path\, ensure that <code>engine\-id\-suffix</code> is only available on RouterOS 7\.10\+\, and that <code>engine\-id</code> is read\-only on RouterOS 7\.10\+ \([https\://github\.com/ansible\-collections/community\.routeros/issues/208](https\://github\.com/ansible\-collections/community\.routeros/issues/208)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/218](https\://github\.com/ansible\-collections/community\.routeros/pull/218)\)\.
@ -559,18 +360,18 @@ Bugfix and feature release\.
<a id="v2-9-0"></a> <a id="v2-9-0"></a>
## v2\.9\.0 ## v2\.9\.0
<a id="release-summary-22"></a> <a id="release-summary-12"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. Bugfix and feature release\.
<a id="minor-changes-20"></a> <a id="minor-changes-11"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- add path <code>caps\-man channel</code> and enable path <code>caps\-man manager interface</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/193](https\://github\.com/ansible\-collections/community\.routeros/issues/193)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/194](https\://github\.com/ansible\-collections/community\.routeros/pull/194)\)\. * api\_info\, api\_modify \- add path <code>caps\-man channel</code> and enable path <code>caps\-man manager interface</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/193](https\://github\.com/ansible\-collections/community\.routeros/issues/193)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/194](https\://github\.com/ansible\-collections/community\.routeros/pull/194)\)\.
* api\_info\, api\_modify \- add path <code>ip traffic\-flow target</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/191](https\://github\.com/ansible\-collections/community\.routeros/issues/191)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/192](https\://github\.com/ansible\-collections/community\.routeros/pull/192)\)\. * api\_info\, api\_modify \- add path <code>ip traffic\-flow target</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/191](https\://github\.com/ansible\-collections/community\.routeros/issues/191)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/192](https\://github\.com/ansible\-collections/community\.routeros/pull/192)\)\.
<a id="bugfixes-7"></a> <a id="bugfixes-3"></a>
### Bugfixes ### Bugfixes
* api\_modify\, api\_info \- add missing parameter <code>engine\-id\-suffix</code> for the <code>snmp</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/189](https\://github\.com/ansible\-collections/community\.routeros/issues/189)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/190](https\://github\.com/ansible\-collections/community\.routeros/pull/190)\)\. * api\_modify\, api\_info \- add missing parameter <code>engine\-id\-suffix</code> for the <code>snmp</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/189](https\://github\.com/ansible\-collections/community\.routeros/issues/189)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/190](https\://github\.com/ansible\-collections/community\.routeros/pull/190)\)\.
@ -578,7 +379,7 @@ Bugfix and feature release\.
<a id="v2-8-3"></a> <a id="v2-8-3"></a>
## v2\.8\.3 ## v2\.8\.3
<a id="release-summary-23"></a> <a id="release-summary-13"></a>
### Release Summary ### Release Summary
Maintenance release with updated documentation\. Maintenance release with updated documentation\.
@ -599,12 +400,12 @@ for the rendered HTML version of the documentation of the latest release\.
<a id="v2-8-2"></a> <a id="v2-8-2"></a>
## v2\.8\.2 ## v2\.8\.2
<a id="release-summary-24"></a> <a id="release-summary-14"></a>
### Release Summary ### Release Summary
Bugfix release\. Bugfix release\.
<a id="bugfixes-8"></a> <a id="bugfixes-4"></a>
### Bugfixes ### Bugfixes
* api\_modify\, api\_info \- add missing parameter <code>tls</code> for the <code>tool e\-mail</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/179](https\://github\.com/ansible\-collections/community\.routeros/issues/179)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/180](https\://github\.com/ansible\-collections/community\.routeros/pull/180)\)\. * api\_modify\, api\_info \- add missing parameter <code>tls</code> for the <code>tool e\-mail</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/179](https\://github\.com/ansible\-collections/community\.routeros/issues/179)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/180](https\://github\.com/ansible\-collections/community\.routeros/pull/180)\)\.
@ -612,12 +413,12 @@ Bugfix release\.
<a id="v2-8-1"></a> <a id="v2-8-1"></a>
## v2\.8\.1 ## v2\.8\.1
<a id="release-summary-25"></a> <a id="release-summary-15"></a>
### Release Summary ### Release Summary
Bugfix release\. Bugfix release\.
<a id="bugfixes-9"></a> <a id="bugfixes-5"></a>
### Bugfixes ### Bugfixes
* facts \- do not crash in CLI output preprocessing in unexpected situations during line unwrapping \([https\://github\.com/ansible\-collections/community\.routeros/issues/170](https\://github\.com/ansible\-collections/community\.routeros/issues/170)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/177](https\://github\.com/ansible\-collections/community\.routeros/pull/177)\)\. * facts \- do not crash in CLI output preprocessing in unexpected situations during line unwrapping \([https\://github\.com/ansible\-collections/community\.routeros/issues/170](https\://github\.com/ansible\-collections/community\.routeros/issues/170)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/177](https\://github\.com/ansible\-collections/community\.routeros/pull/177)\)\.
@ -625,12 +426,12 @@ Bugfix release\.
<a id="v2-8-0"></a> <a id="v2-8-0"></a>
## v2\.8\.0 ## v2\.8\.0
<a id="release-summary-26"></a> <a id="release-summary-16"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. Bugfix and feature release\.
<a id="minor-changes-21"></a> <a id="minor-changes-12"></a>
### Minor Changes ### Minor Changes
* api\_modify \- adapt data for API paths <code>ip dhcp\-server network</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/156](https\://github\.com/ansible\-collections/community\.routeros/pull/156)\)\. * api\_modify \- adapt data for API paths <code>ip dhcp\-server network</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/156](https\://github\.com/ansible\-collections/community\.routeros/pull/156)\)\.
@ -640,7 +441,7 @@ Bugfix and feature release\.
* api\_modify \- support API paths <code>ip firewall layer7\-protocol</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/153](https\://github\.com/ansible\-collections/community\.routeros/pull/153)\)\. * api\_modify \- support API paths <code>ip firewall layer7\-protocol</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/153](https\://github\.com/ansible\-collections/community\.routeros/pull/153)\)\.
* command \- workaround for extra characters in stdout in RouterOS versions between 6\.49 and 7\.1\.5 \([https\://github\.com/ansible\-collections/community\.routeros/issues/62](https\://github\.com/ansible\-collections/community\.routeros/issues/62)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/161](https\://github\.com/ansible\-collections/community\.routeros/pull/161)\)\. * command \- workaround for extra characters in stdout in RouterOS versions between 6\.49 and 7\.1\.5 \([https\://github\.com/ansible\-collections/community\.routeros/issues/62](https\://github\.com/ansible\-collections/community\.routeros/issues/62)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/161](https\://github\.com/ansible\-collections/community\.routeros/pull/161)\)\.
<a id="bugfixes-10"></a> <a id="bugfixes-6"></a>
### Bugfixes ### Bugfixes
* api\_info\, api\_modify \- fix default and remove behavior for <code>dhcp\-options</code> in path <code>ip dhcp\-client</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/148](https\://github\.com/ansible\-collections/community\.routeros/issues/148)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. * api\_info\, api\_modify \- fix default and remove behavior for <code>dhcp\-options</code> in path <code>ip dhcp\-client</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/148](https\://github\.com/ansible\-collections/community\.routeros/issues/148)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\.
@ -650,17 +451,17 @@ Bugfix and feature release\.
<a id="v2-7-0"></a> <a id="v2-7-0"></a>
## v2\.7\.0 ## v2\.7\.0
<a id="release-summary-27"></a> <a id="release-summary-17"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. Bugfix and feature release\.
<a id="minor-changes-22"></a> <a id="minor-changes-13"></a>
### Minor Changes ### Minor Changes
* api\_modify\, api\_info \- support API paths <code>ip arp</code>\, <code>ip firewall raw</code>\, <code>ipv6 firewall raw</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\. * api\_modify\, api\_info \- support API paths <code>ip arp</code>\, <code>ip firewall raw</code>\, <code>ipv6 firewall raw</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\.
<a id="bugfixes-11"></a> <a id="bugfixes-7"></a>
### Bugfixes ### Bugfixes
* api\_modify\, api\_info \- defaults corrected for fields in <code>interface wireguard peers</code> API path \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\. * api\_modify\, api\_info \- defaults corrected for fields in <code>interface wireguard peers</code> API path \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\.
@ -668,18 +469,18 @@ Bugfix and feature release\.
<a id="v2-6-0"></a> <a id="v2-6-0"></a>
## v2\.6\.0 ## v2\.6\.0
<a id="release-summary-28"></a> <a id="release-summary-18"></a>
### Release Summary ### Release Summary
Regular bugfix and feature release\. Regular bugfix and feature release\.
<a id="minor-changes-23"></a> <a id="minor-changes-14"></a>
### Minor Changes ### Minor Changes
* api\_modify\, api\_info \- add field <code>regexp</code> to <code>ip dns static</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\. * api\_modify\, api\_info \- add field <code>regexp</code> to <code>ip dns static</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\.
* api\_modify\, api\_info \- support API paths <code>interface wireguard</code>\, <code>interface wireguard peers</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/143](https\://github\.com/ansible\-collections/community\.routeros/pull/143)\)\. * api\_modify\, api\_info \- support API paths <code>interface wireguard</code>\, <code>interface wireguard peers</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/143](https\://github\.com/ansible\-collections/community\.routeros/pull/143)\)\.
<a id="bugfixes-12"></a> <a id="bugfixes-8"></a>
### Bugfixes ### Bugfixes
* api\_modify \- do not use <code>name</code> as a unique key in <code>ip dns static</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\. * api\_modify \- do not use <code>name</code> as a unique key in <code>ip dns static</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\.
@ -688,17 +489,17 @@ Regular bugfix and feature release\.
<a id="v2-5-0"></a> <a id="v2-5-0"></a>
## v2\.5\.0 ## v2\.5\.0
<a id="release-summary-29"></a> <a id="release-summary-19"></a>
### Release Summary ### Release Summary
Feature and bugfix release\. Feature and bugfix release\.
<a id="minor-changes-24"></a> <a id="minor-changes-15"></a>
### Minor Changes ### Minor Changes
* api\_info\, api\_modify \- support API paths <code>interface ethernet poe</code>\, <code>interface gre6</code>\, <code>interface vrrp</code> and also support all previously missing fields of entries in <code>ip dhcp\-server</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/137](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\. * api\_info\, api\_modify \- support API paths <code>interface ethernet poe</code>\, <code>interface gre6</code>\, <code>interface vrrp</code> and also support all previously missing fields of entries in <code>ip dhcp\-server</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/137](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\.
<a id="bugfixes-13"></a> <a id="bugfixes-9"></a>
### Bugfixes ### Bugfixes
* api\_modify \- <code>address\-pool</code> field of entries in API path <code>ip dhcp\-server</code> is not required anymore \([https\://github\.com/ansible\-collections/community\.routeros/pull/137](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\. * api\_modify \- <code>address\-pool</code> field of entries in API path <code>ip dhcp\-server</code> is not required anymore \([https\://github\.com/ansible\-collections/community\.routeros/pull/137](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\.
@ -706,12 +507,12 @@ Feature and bugfix release\.
<a id="v2-4-0"></a> <a id="v2-4-0"></a>
## v2\.4\.0 ## v2\.4\.0
<a id="release-summary-30"></a> <a id="release-summary-20"></a>
### Release Summary ### Release Summary
Feature release improving the <code>api\*</code> modules\. Feature release improving the <code>api\*</code> modules\.
<a id="minor-changes-25"></a> <a id="minor-changes-16"></a>
### Minor Changes ### Minor Changes
* api\* modules \- Add new option <code>force\_no\_cert</code> to connect with ADH ciphers \([https\://github\.com/ansible\-collections/community\.routeros/pull/124](https\://github\.com/ansible\-collections/community\.routeros/pull/124)\)\. * api\* modules \- Add new option <code>force\_no\_cert</code> to connect with ADH ciphers \([https\://github\.com/ansible\-collections/community\.routeros/pull/124](https\://github\.com/ansible\-collections/community\.routeros/pull/124)\)\.
@ -732,7 +533,7 @@ Feature release improving the <code>api\*</code> modules\.
* api\_modify\, api\_info \- support for fields <code>blackhole</code>\, <code>pref\-src</code>\, <code>routing\-table</code>\, <code>suppress\-hw\-offload</code>\, <code>type</code>\, <code>vrf\-interface</code> in <code>ip route</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\. * api\_modify\, api\_info \- support for fields <code>blackhole</code>\, <code>pref\-src</code>\, <code>routing\-table</code>\, <code>suppress\-hw\-offload</code>\, <code>type</code>\, <code>vrf\-interface</code> in <code>ip route</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\.
* api\_modify\, api\_info \- support paths <code>system ntp client servers</code> and <code>system ntp server</code> available in ROS7\, as well as new fields <code>servers</code>\, <code>mode</code>\, and <code>vrf</code> for <code>system ntp client</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/122](https\://github\.com/ansible\-collections/community\.routeros/pull/122)\)\. * api\_modify\, api\_info \- support paths <code>system ntp client servers</code> and <code>system ntp server</code> available in ROS7\, as well as new fields <code>servers</code>\, <code>mode</code>\, and <code>vrf</code> for <code>system ntp client</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/122](https\://github\.com/ansible\-collections/community\.routeros/pull/122)\)\.
<a id="bugfixes-14"></a> <a id="bugfixes-10"></a>
### Bugfixes ### Bugfixes
* api\_modify \- <code>ip route</code> entry can be defined without the need of <code>gateway</code> field\, which is correct for unreachable/blackhole type of routes \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\. * api\_modify \- <code>ip route</code> entry can be defined without the need of <code>gateway</code> field\, which is correct for unreachable/blackhole type of routes \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\.
@ -750,7 +551,7 @@ Feature release improving the <code>api\*</code> modules\.
<a id="v2-3-1"></a> <a id="v2-3-1"></a>
## v2\.3\.1 ## v2\.3\.1
<a id="release-summary-31"></a> <a id="release-summary-21"></a>
### Release Summary ### Release Summary
Maintenance release with improved documentation\. Maintenance release with improved documentation\.
@ -763,19 +564,19 @@ Maintenance release with improved documentation\.
<a id="v2-3-0"></a> <a id="v2-3-0"></a>
## v2\.3\.0 ## v2\.3\.0
<a id="release-summary-32"></a> <a id="release-summary-22"></a>
### Release Summary ### Release Summary
Feature and bugfix release\. Feature and bugfix release\.
<a id="minor-changes-26"></a> <a id="minor-changes-17"></a>
### Minor Changes ### Minor Changes
* The collection repository conforms to the [REUSE specification](https\://reuse\.software/spec/) except for the changelog fragments \([https\://github\.com/ansible\-collections/community\.routeros/pull/108](https\://github\.com/ansible\-collections/community\.routeros/pull/108)\)\. * The collection repository conforms to the [REUSE specification](https\://reuse\.software/spec/) except for the changelog fragments \([https\://github\.com/ansible\-collections/community\.routeros/pull/108](https\://github\.com/ansible\-collections/community\.routeros/pull/108)\)\.
* api\* modules \- added <code>timeout</code> parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/109](https\://github\.com/ansible\-collections/community\.routeros/pull/109)\)\. * api\* modules \- added <code>timeout</code> parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/109](https\://github\.com/ansible\-collections/community\.routeros/pull/109)\)\.
* api\_modify\, api\_info \- support API path <code>ip firewall mangle</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\. * api\_modify\, api\_info \- support API path <code>ip firewall mangle</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\.
<a id="bugfixes-15"></a> <a id="bugfixes-11"></a>
### Bugfixes ### Bugfixes
* api\_modify\, api\_info \- make API path <code>ip dhcp\-server</code> support <code>script</code>\, and <code>ip firewall nat</code> support <code>in\-interface</code> and <code>in\-interface\-list</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\. * api\_modify\, api\_info \- make API path <code>ip dhcp\-server</code> support <code>script</code>\, and <code>ip firewall nat</code> support <code>in\-interface</code> and <code>in\-interface\-list</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\.
@ -783,12 +584,12 @@ Feature and bugfix release\.
<a id="v2-2-1"></a> <a id="v2-2-1"></a>
## v2\.2\.1 ## v2\.2\.1
<a id="release-summary-33"></a> <a id="release-summary-23"></a>
### Release Summary ### Release Summary
Bugfix release\. Bugfix release\.
<a id="bugfixes-16"></a> <a id="bugfixes-12"></a>
### Bugfixes ### Bugfixes
* api\_modify\, api\_info \- make API path <code>ip dhcp\-server lease</code> support <code>server\=all</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/104](https\://github\.com/ansible\-collections/community\.routeros/issues/104)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/107](https\://github\.com/ansible\-collections/community\.routeros/pull/107)\)\. * api\_modify\, api\_info \- make API path <code>ip dhcp\-server lease</code> support <code>server\=all</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/104](https\://github\.com/ansible\-collections/community\.routeros/issues/104)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/107](https\://github\.com/ansible\-collections/community\.routeros/pull/107)\)\.
@ -797,17 +598,17 @@ Bugfix release\.
<a id="v2-2-0"></a> <a id="v2-2-0"></a>
## v2\.2\.0 ## v2\.2\.0
<a id="release-summary-34"></a> <a id="release-summary-24"></a>
### Release Summary ### Release Summary
New feature release\. New feature release\.
<a id="minor-changes-27"></a> <a id="minor-changes-18"></a>
### Minor Changes ### Minor Changes
* All software licenses are now in the <code>LICENSES/</code> directory of the collection root\. Moreover\, <code>SPDX\-License\-Identifier\:</code> is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\. * All software licenses are now in the <code>LICENSES/</code> directory of the collection root\. Moreover\, <code>SPDX\-License\-Identifier\:</code> is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\.
<a id="bugfixes-17"></a> <a id="bugfixes-13"></a>
### Bugfixes ### Bugfixes
* Include <code>LICENSES/BSD\-2\-Clause\.txt</code> file for the <code>routeros</code> module utils \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\. * Include <code>LICENSES/BSD\-2\-Clause\.txt</code> file for the <code>routeros</code> module utils \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\.
@ -821,12 +622,12 @@ New feature release\.
<a id="v2-1-0"></a> <a id="v2-1-0"></a>
## v2\.1\.0 ## v2\.1\.0
<a id="release-summary-35"></a> <a id="release-summary-25"></a>
### Release Summary ### Release Summary
Feature and bugfix release with new modules\. Feature and bugfix release with new modules\.
<a id="minor-changes-28"></a> <a id="minor-changes-19"></a>
### Minor Changes ### Minor Changes
* Added a <code>community\.routeros\.api</code> module defaults group\. Use with <code>group/community\.routeros\.api</code> to provide options for all API\-based modules \([https\://github\.com/ansible\-collections/community\.routeros/pull/89](https\://github\.com/ansible\-collections/community\.routeros/pull/89)\)\. * Added a <code>community\.routeros\.api</code> module defaults group\. Use with <code>group/community\.routeros\.api</code> to provide options for all API\-based modules \([https\://github\.com/ansible\-collections/community\.routeros/pull/89](https\://github\.com/ansible\-collections/community\.routeros/pull/89)\)\.
@ -835,7 +636,7 @@ Feature and bugfix release with new modules\.
* api \- update <code>query</code> to accept symbolic parameters \([https\://github\.com/ansible\-collections/community\.routeros/pull/63](https\://github\.com/ansible\-collections/community\.routeros/pull/63)\)\. * api \- update <code>query</code> to accept symbolic parameters \([https\://github\.com/ansible\-collections/community\.routeros/pull/63](https\://github\.com/ansible\-collections/community\.routeros/pull/63)\)\.
* api\* modules \- allow to set an encoding other than the default ASCII for communicating with the API \([https\://github\.com/ansible\-collections/community\.routeros/pull/95](https\://github\.com/ansible\-collections/community\.routeros/pull/95)\)\. * api\* modules \- allow to set an encoding other than the default ASCII for communicating with the API \([https\://github\.com/ansible\-collections/community\.routeros/pull/95](https\://github\.com/ansible\-collections/community\.routeros/pull/95)\)\.
<a id="bugfixes-18"></a> <a id="bugfixes-14"></a>
### Bugfixes ### Bugfixes
* query \- fix query function check for <code>\.id</code> vs\. <code>id</code> arguments to not conflict with routeros arguments like <code>identity</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/68](https\://github\.com/ansible\-collections/community\.routeros/pull/68)\, [https\://github\.com/ansible\-collections/community\.routeros/issues/67](https\://github\.com/ansible\-collections/community\.routeros/issues/67)\)\. * query \- fix query function check for <code>\.id</code> vs\. <code>id</code> arguments to not conflict with routeros arguments like <code>identity</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/68](https\://github\.com/ansible\-collections/community\.routeros/pull/68)\, [https\://github\.com/ansible\-collections/community\.routeros/issues/67](https\://github\.com/ansible\-collections/community\.routeros/issues/67)\)\.
@ -850,26 +651,26 @@ Feature and bugfix release with new modules\.
<a id="v2-0-0"></a> <a id="v2-0-0"></a>
## v2\.0\.0 ## v2\.0\.0
<a id="release-summary-36"></a> <a id="release-summary-26"></a>
### Release Summary ### Release Summary
A new major release with breaking changes in the behavior of <code>community\.routeros\.api</code> and <code>community\.routeros\.command</code>\. A new major release with breaking changes in the behavior of <code>community\.routeros\.api</code> and <code>community\.routeros\.command</code>\.
<a id="minor-changes-29"></a> <a id="minor-changes-20"></a>
### Minor Changes ### Minor Changes
* api \- make validation of <code>WHERE</code> for <code>query</code> more strict \([https\://github\.com/ansible\-collections/community\.routeros/pull/53](https\://github\.com/ansible\-collections/community\.routeros/pull/53)\)\. * api \- make validation of <code>WHERE</code> for <code>query</code> more strict \([https\://github\.com/ansible\-collections/community\.routeros/pull/53](https\://github\.com/ansible\-collections/community\.routeros/pull/53)\)\.
* command \- the <code>commands</code> and <code>wait\_for</code> options now convert the list elements to strings \([https\://github\.com/ansible\-collections/community\.routeros/pull/55](https\://github\.com/ansible\-collections/community\.routeros/pull/55)\)\. * command \- the <code>commands</code> and <code>wait\_for</code> options now convert the list elements to strings \([https\://github\.com/ansible\-collections/community\.routeros/pull/55](https\://github\.com/ansible\-collections/community\.routeros/pull/55)\)\.
* facts \- the <code>gather\_subset</code> option now converts the list elements to strings \([https\://github\.com/ansible\-collections/community\.routeros/pull/55](https\://github\.com/ansible\-collections/community\.routeros/pull/55)\)\. * facts \- the <code>gather\_subset</code> option now converts the list elements to strings \([https\://github\.com/ansible\-collections/community\.routeros/pull/55](https\://github\.com/ansible\-collections/community\.routeros/pull/55)\)\.
<a id="breaking-changes--porting-guide-1"></a> <a id="breaking-changes--porting-guide"></a>
### Breaking Changes / Porting Guide ### Breaking Changes / Porting Guide
* api \- due to a programming error\, the module never failed on errors\. This has now been fixed\. If you are relying on the module not failing in case of idempotent commands \(resulting in errors like <code>failure\: already have such address</code>\)\, you need to adjust your roles/playbooks\. We suggest to use <code>failed\_when</code> to accept failure in specific circumstances\, for example <code>failed\_when\: \"\'failure\: already have \' in result\.msg\[0\]\"</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/39](https\://github\.com/ansible\-collections/community\.routeros/pull/39)\)\. * api \- due to a programming error\, the module never failed on errors\. This has now been fixed\. If you are relying on the module not failing in case of idempotent commands \(resulting in errors like <code>failure\: already have such address</code>\)\, you need to adjust your roles/playbooks\. We suggest to use <code>failed\_when</code> to accept failure in specific circumstances\, for example <code>failed\_when\: \"\'failure\: already have \' in result\.msg\[0\]\"</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/39](https\://github\.com/ansible\-collections/community\.routeros/pull/39)\)\.
* api \- splitting commands no longer uses a naive split by whitespace\, but a more RouterOS CLI compatible splitting algorithm \([https\://github\.com/ansible\-collections/community\.routeros/pull/45](https\://github\.com/ansible\-collections/community\.routeros/pull/45)\)\. * api \- splitting commands no longer uses a naive split by whitespace\, but a more RouterOS CLI compatible splitting algorithm \([https\://github\.com/ansible\-collections/community\.routeros/pull/45](https\://github\.com/ansible\-collections/community\.routeros/pull/45)\)\.
* command \- the module now always indicates that a change happens\. If this is not correct\, please use <code>changed\_when</code> to determine the correct changed status for a task \([https\://github\.com/ansible\-collections/community\.routeros/pull/50](https\://github\.com/ansible\-collections/community\.routeros/pull/50)\)\. * command \- the module now always indicates that a change happens\. If this is not correct\, please use <code>changed\_when</code> to determine the correct changed status for a task \([https\://github\.com/ansible\-collections/community\.routeros/pull/50](https\://github\.com/ansible\-collections/community\.routeros/pull/50)\)\.
<a id="bugfixes-19"></a> <a id="bugfixes-15"></a>
### Bugfixes ### Bugfixes
* api \- improve splitting of <code>WHERE</code> queries \([https\://github\.com/ansible\-collections/community\.routeros/pull/47](https\://github\.com/ansible\-collections/community\.routeros/pull/47)\)\. * api \- improve splitting of <code>WHERE</code> queries \([https\://github\.com/ansible\-collections/community\.routeros/pull/47](https\://github\.com/ansible\-collections/community\.routeros/pull/47)\)\.
@ -891,12 +692,12 @@ A new major release with breaking changes in the behavior of <code>community\.ro
<a id="v1-2-0"></a> <a id="v1-2-0"></a>
## v1\.2\.0 ## v1\.2\.0
<a id="release-summary-37"></a> <a id="release-summary-27"></a>
### Release Summary ### Release Summary
Bugfix and feature release\. Bugfix and feature release\.
<a id="minor-changes-30"></a> <a id="minor-changes-21"></a>
### Minor Changes ### Minor Changes
* Avoid internal ansible\-core module\_utils in favor of equivalent public API available since at least Ansible 2\.9 \([https\://github\.com/ansible\-collections/community\.routeros/pull/38](https\://github\.com/ansible\-collections/community\.routeros/pull/38)\)\. * Avoid internal ansible\-core module\_utils in favor of equivalent public API available since at least Ansible 2\.9 \([https\://github\.com/ansible\-collections/community\.routeros/pull/38](https\://github\.com/ansible\-collections/community\.routeros/pull/38)\)\.
@ -904,7 +705,7 @@ Bugfix and feature release\.
* api \- rename option <code>ssl</code> to <code>tls</code>\, and keep the old name as an alias \([https\://github\.com/ansible\-collections/community\.routeros/pull/37](https\://github\.com/ansible\-collections/community\.routeros/pull/37)\)\. * api \- rename option <code>ssl</code> to <code>tls</code>\, and keep the old name as an alias \([https\://github\.com/ansible\-collections/community\.routeros/pull/37](https\://github\.com/ansible\-collections/community\.routeros/pull/37)\)\.
* fact \- add fact <code>ansible\_net\_config\_nonverbose</code> to get idempotent config \(no date\, no verbose\) \([https\://github\.com/ansible\-collections/community\.routeros/pull/23](https\://github\.com/ansible\-collections/community\.routeros/pull/23)\)\. * fact \- add fact <code>ansible\_net\_config\_nonverbose</code> to get idempotent config \(no date\, no verbose\) \([https\://github\.com/ansible\-collections/community\.routeros/pull/23](https\://github\.com/ansible\-collections/community\.routeros/pull/23)\)\.
<a id="bugfixes-20"></a> <a id="bugfixes-16"></a>
### Bugfixes ### Bugfixes
* api \- when using TLS/SSL\, remove explicit cipher configuration to insecure values\, which also makes it impossible to connect to newer RouterOS versions \([https\://github\.com/ansible\-collections/community\.routeros/pull/34](https\://github\.com/ansible\-collections/community\.routeros/pull/34)\)\. * api \- when using TLS/SSL\, remove explicit cipher configuration to insecure values\, which also makes it impossible to connect to newer RouterOS versions \([https\://github\.com/ansible\-collections/community\.routeros/pull/34](https\://github\.com/ansible\-collections/community\.routeros/pull/34)\)\.
@ -912,12 +713,12 @@ Bugfix and feature release\.
<a id="v1-1-0"></a> <a id="v1-1-0"></a>
## v1\.1\.0 ## v1\.1\.0
<a id="release-summary-38"></a> <a id="release-summary-28"></a>
### Release Summary ### Release Summary
This release allow dashes in usernames for SSH\-based modules\. This release allow dashes in usernames for SSH\-based modules\.
<a id="minor-changes-31"></a> <a id="minor-changes-22"></a>
### Minor Changes ### Minor Changes
* command \- added support for a dash \(<code>\-</code>\) in username \([https\://github\.com/ansible\-collections/community\.routeros/pull/18](https\://github\.com/ansible\-collections/community\.routeros/pull/18)\)\. * command \- added support for a dash \(<code>\-</code>\) in username \([https\://github\.com/ansible\-collections/community\.routeros/pull/18](https\://github\.com/ansible\-collections/community\.routeros/pull/18)\)\.
@ -926,12 +727,12 @@ This release allow dashes in usernames for SSH\-based modules\.
<a id="v1-0-1"></a> <a id="v1-0-1"></a>
## v1\.0\.1 ## v1\.0\.1
<a id="release-summary-39"></a> <a id="release-summary-29"></a>
### Release Summary ### Release Summary
Maintenance release with a bugfix for <code>api</code>\. Maintenance release with a bugfix for <code>api</code>\.
<a id="bugfixes-21"></a> <a id="bugfixes-17"></a>
### Bugfixes ### Bugfixes
* api \- remove <code>id to \.id</code> as default requirement which conflicts with RouterOS <code>id</code> configuration parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/15](https\://github\.com/ansible\-collections/community\.routeros/pull/15)\)\. * api \- remove <code>id to \.id</code> as default requirement which conflicts with RouterOS <code>id</code> configuration parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/15](https\://github\.com/ansible\-collections/community\.routeros/pull/15)\)\.
@ -939,12 +740,12 @@ Maintenance release with a bugfix for <code>api</code>\.
<a id="v1-0-0"></a> <a id="v1-0-0"></a>
## v1\.0\.0 ## v1\.0\.0
<a id="release-summary-40"></a> <a id="release-summary-30"></a>
### Release Summary ### Release Summary
This is the first production \(non\-prerelease\) release of <code>community\.routeros</code>\. This is the first production \(non\-prerelease\) release of <code>community\.routeros</code>\.
<a id="bugfixes-22"></a> <a id="bugfixes-18"></a>
### Bugfixes ### Bugfixes
* routeros terminal plugin \- allow slashes in hostnames for terminal detection\. Without this\, slashes in hostnames will result in connection timeouts \([https\://github\.com/ansible\-collections/community\.network/pull/138](https\://github\.com/ansible\-collections/community\.network/pull/138)\)\. * routeros terminal plugin \- allow slashes in hostnames for terminal detection\. Without this\, slashes in hostnames will result in connection timeouts \([https\://github\.com/ansible\-collections/community\.network/pull/138](https\://github\.com/ansible\-collections/community\.network/pull/138)\)\.
@ -952,12 +753,12 @@ This is the first production \(non\-prerelease\) release of <code>community\.rou
<a id="v0-1-1"></a> <a id="v0-1-1"></a>
## v0\.1\.1 ## v0\.1\.1
<a id="release-summary-41"></a> <a id="release-summary-31"></a>
### Release Summary ### Release Summary
Small improvements and bugfixes over the initial release\. Small improvements and bugfixes over the initial release\.
<a id="bugfixes-23"></a> <a id="bugfixes-19"></a>
### Bugfixes ### Bugfixes
* api \- fix crash when the <code>ssl</code> parameter is used \([https\://github\.com/ansible\-collections/community\.routeros/pull/3](https\://github\.com/ansible\-collections/community\.routeros/pull/3)\)\. * api \- fix crash when the <code>ssl</code> parameter is used \([https\://github\.com/ansible\-collections/community\.routeros/pull/3](https\://github\.com/ansible\-collections/community\.routeros/pull/3)\)\.
@ -965,12 +766,12 @@ Small improvements and bugfixes over the initial release\.
<a id="v0-1-0"></a> <a id="v0-1-0"></a>
## v0\.1\.0 ## v0\.1\.0
<a id="release-summary-42"></a> <a id="release-summary-32"></a>
### Release Summary ### Release Summary
The <code>community\.routeros</code> continues the work on the Ansible RouterOS modules from their state in <code>community\.network</code> 1\.2\.0\. The changes listed here are thus relative to the modules <code>community\.network\.routeros\_\*</code>\. The <code>community\.routeros</code> continues the work on the Ansible RouterOS modules from their state in <code>community\.network</code> 1\.2\.0\. The changes listed here are thus relative to the modules <code>community\.network\.routeros\_\*</code>\.
<a id="minor-changes-32"></a> <a id="minor-changes-23"></a>
### Minor Changes ### Minor Changes
* facts \- now also collecting data about BGP and OSPF \([https\://github\.com/ansible\-collections/community\.network/pull/101](https\://github\.com/ansible\-collections/community\.network/pull/101)\)\. * facts \- now also collecting data about BGP and OSPF \([https\://github\.com/ansible\-collections/community\.network/pull/101](https\://github\.com/ansible\-collections/community\.network/pull/101)\)\.

View file

@ -4,181 +4,17 @@ Community RouterOS Release Notes
.. contents:: Topics .. contents:: Topics
v3.9.0 v2.20.1
====== =======
Release Summary Release Summary
--------------- ---------------
Bugfix and feature release. This is the final community.routeros 2.x.y release.
Minor Changes Please upgrade to community.routeros 3.x.y as soon as possible to receive further bugfixes.
-------------
- api_info, api modify - add ``remote-log-format``, ``remote-protocol``, and ``event-delimiter`` to ``system logging action`` (https://github.com/ansible-collections/community.routeros/pull/381). Thanks to everyone who contributed to community.routeros 2.x.y releases!
- api_info, api_modify - add ``disable-link-local-address`` and ``stale-neighbor-timeout`` fields to ``ipv6 settings`` (https://github.com/ansible-collections/community.routeros/pull/380).
- api_info, api_modify - adjust neighbor limit fields in ``ipv6 settings`` to match RouterOS 7.18 and newer (https://github.com/ansible-collections/community.routeros/pull/380).
- api_info, api_modify - set ``passthrough`` default in ``ip firewall mangle`` to ``true`` for RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/382).
- api_info, api_modify - since RouterOS 7.17 VRF is supported for OVPN server. It now supports multiple entries, while ``api_modify`` so far only accepted a single entry. The ``interface ovpn-server server`` path now allows multiple entries on RouterOS 7.17 and newer (https://github.com/ansible-collections/community.routeros/pull/383).
Bugfixes
--------
- routeros terminal plugin - fix ``terminal_stdout_re`` pattern to handle long system identities when connecting to RouterOS through SSH (https://github.com/ansible-collections/community.routeros/pull/386).
v3.8.1
======
Release Summary
---------------
Bugfix release.
Bugfixes
--------
- facts and api_facts modules - prevent deprecation warnings when used with ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384).
v3.8.0
======
Release Summary
---------------
Feature release.
Minor Changes
-------------
- api_info, api_modify - add ``interface ethernet switch port-isolation`` which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375).
- api_info, api_modify - add ``routing bfd configuration``. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7.11
(https://github.com/ansible-collections/community.routeros/pull/375).
- api_modify, api_info - support API path ``ip ipsec mode-config`` (https://github.com/ansible-collections/community.routeros/pull/376).
v3.7.0
======
Release Summary
---------------
Feature release.
Minor Changes
-------------
- api_find_and_modify - allow to control whether ``dynamic`` and/or ``builtin`` entries are ignored with the new ``ignore_dynamic`` and ``ignore_builtin`` options (https://github.com/ansible-collections/community.routeros/issues/372, https://github.com/ansible-collections/community.routeros/pull/373).
- api_info, api_modify - add ``port-cost-mode`` to ``interface bridge`` which is supported since RouterOS 7.13 (https://github.com/ansible-collections/community.routeros/pull/371).
v3.6.0
======
Release Summary
---------------
Feature release.
Minor Changes
-------------
- api_info, api_modify - add ``mdns-repeat-ifaces`` to ``ip dns`` for RouterOS 7.16 and newer (https://github.com/ansible-collections/community.routeros/pull/358).
- api_info, api_modify - field name change in ``routing bgp connection`` path implemented by RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/360).
- api_info, api_modify - rename ``is-responder`` property in ``interface wireguard peers`` to ``responder`` for RouterOS 7.17 and newer (https://github.com/ansible-collections/community.routeros/pull/364).
v3.5.0
======
Release Summary
---------------
Feature release.
Minor Changes
-------------
- api_info, api_modify - change default for ``/ip/cloud/ddns-enabled`` for RouterOS 7.17 and newer from ``yes`` to ``auto`` (https://github.com/ansible-collections/community.routeros/pull/350).
v3.4.0
======
Release Summary
---------------
Feature and bugfix release.
Minor Changes
-------------
- api_info, api_modify - add support for the ``ip dns forwarders`` path implemented by RouterOS 7.17 and newer (https://github.com/ansible-collections/community.routeros/pull/343).
Bugfixes
--------
- api_info, api_modify - remove the primary key ``action`` from the ``interface wifi provisioning`` path, since RouterOS also allows to create completely duplicate entries (https://github.com/ansible-collections/community.routeros/issues/344, https://github.com/ansible-collections/community.routeros/pull/345).
v3.3.0
======
Release Summary
---------------
Feature release.
Minor Changes
-------------
- api_info, api_modify - add missing attribute ``require-message-auth`` for the ``radius`` path which exists since RouterOS version 7.15 (https://github.com/ansible-collections/community.routeros/issues/338, https://github.com/ansible-collections/community.routeros/pull/339).
- api_info, api_modify - add the ``interface 6to4`` path. Used to manage IPv6 tunnels via tunnel-brokers like HE, where native IPv6 is not provided (https://github.com/ansible-collections/community.routeros/pull/342).
- api_info, api_modify - add the ``interface wireless access-list`` and ``interface wireless connect-list`` paths (https://github.com/ansible-collections/community.routeros/issues/284, https://github.com/ansible-collections/community.routeros/pull/340).
- api_info, api_modify - add the ``use-interface-duid`` option for ``ipv6 dhcp-client`` path. This option prevents issues with Fritzbox modems and routers, when using virtual interfaces (like VLANs) may create duplicated records in hosts config, this breaks original "expose-host" function. Also add the ``script``, ``custom-duid`` and ``validate-server-duid`` as backport from 7.15 version update (https://github.com/ansible-collections/community.routeros/pull/341).
v3.2.0
======
Release Summary
---------------
Feature release.
Minor Changes
-------------
- api_info, api_modify - add support for the ``routing filter community-list`` path implemented by RouterOS 7 and newer (https://github.com/ansible-collections/community.routeros/pull/331).
v3.1.0
======
Release Summary
---------------
Bugfix and feature release.
Minor Changes
-------------
- api_info, api_modify - add missing fields ``comment``, ``next-pool`` to ``ip pool`` path (https://github.com/ansible-collections/community.routeros/pull/327).
Bugfixes
--------
- api_info, api_modify - fields ``log`` and ``log-prefix`` in paths ``ip firewall filter``, ``ip firewall mangle``, ``ip firewall nat``, ``ip firewall raw`` now have the correct default values (https://github.com/ansible-collections/community.routeros/pull/324).
v3.0.0
======
Release Summary
---------------
Major release that drops support for End of Life Python versions and fixes check mode for community.routeros.command.
Breaking Changes / Porting Guide
--------------------------------
- command - the module no longer declares that it supports check mode (https://github.com/ansible-collections/community.routeros/pull/318).
Removed Features (previously deprecated)
----------------------------------------
- The collection no longer supports Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14. If you need to continue using End of Life versions of Ansible/ansible-base/ansible-core, please use community.routeros 2.x.y (https://github.com/ansible-collections/community.routeros/pull/318).
v2.20.0 v2.20.0
======= =======

48
LICENSES/PSF-2.0.txt Normal file
View file

@ -0,0 +1,48 @@
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.

View file

@ -5,8 +5,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
--> -->
# Community RouterOS Collection # Community RouterOS Collection
[![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/devel/collections/community/routeros/) [![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/latest/collections/community/routeros/)
[![CI](https://github.com/ansible-collections/community.routeros/actions/workflows/nox.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.routeros/actions) [![CI](https://github.com/ansible-collections/community.routeros/actions/workflows/ansible-test.yml/badge.svg?branch=stable-2)](https://github.com/ansible-collections/community.routeros/actions)
[![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.routeros)](https://codecov.io/gh/ansible-collections/community.routeros) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.routeros)](https://codecov.io/gh/ansible-collections/community.routeros)
[![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.routeros)](https://api.reuse.software/info/github.com/ansible-collections/community.routeros) [![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.routeros)](https://api.reuse.software/info/github.com/ansible-collections/community.routeros)
@ -34,11 +34,11 @@ For more information about communication, see the [Ansible communication guide](
## Tested with Ansible ## Tested with Ansible
Tested with the current ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, ansible-core 2.18, and ansible-core 2.19 releases and the current development version of ansible-core. Ansible 2.9, ansible-base 2.10, and ansible-core versions before 2.15.0 are not supported. Tested with the current Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, and ansible-core 2.18 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported.
## External requirements ## External requirements
The exact requirements for every module are listed in the module documentation. The exact requirements for every module are listed in the module documentation.
### Supported connections ### Supported connections
@ -54,7 +54,7 @@ Browsing the [**latest** collection documentation](https://docs.ansible.com/ansi
Browsing the [**devel** collection documentation](https://docs.ansible.com/ansible/devel/collections/community/routeros) shows docs for the _latest version released on Galaxy_. Browsing the [**devel** collection documentation](https://docs.ansible.com/ansible/devel/collections/community/routeros) shows docs for the _latest version released on Galaxy_.
We also separately publish [**latest commit** collection documentation](https://ansible-collections.github.io/community.routeros/branch/main/) which shows docs for the _latest commit in the `main` branch_. We also separately publish [**latest commit** collection documentation](https://ansible-collections.github.io/community.routeros/branch/stable-2/) which shows docs for the _latest commit in the `stable-2` branch_.
If you use the Ansible package and do not update collections independently, use **latest**. If you install or update this collection directly from Galaxy, use **devel**. If you are looking to contribute, use **latest commit**. If you use the Ansible package and do not update collections independently, use **latest**. If you install or update this collection directly from Galaxy, use **devel**. If you are looking to contribute, use **latest commit**.
@ -184,7 +184,7 @@ See [Ansible's dev guide](https://docs.ansible.com/ansible/devel/dev_guide/devel
## Release notes ## Release notes
See the [collection's changelog](https://github.com/ansible-collections/community.routeros/blob/main/CHANGELOG.md). See the [collection's changelog](https://github.com/ansible-collections/community.routeros/blob/stable-2/CHANGELOG.md).
## Roadmap ## Roadmap
@ -204,8 +204,8 @@ We plan to regularly release minor and patch versions, whenever new features are
This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later. This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.routeros/blob/main/COPYING) for the full text. See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.routeros/blob/stable-2/COPYING) for the full text.
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.routeros/blob/main/LICENSES/BSD-2-Clause.txt). Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.routeros/blob/stable-2/LICENSES/BSD-2-Clause.txt).
All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/). All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `.reuse/dep5`. This conforms to the [REUSE specification](https://reuse.software/spec/).

View file

@ -1,11 +0,0 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
version = 1
[[annotations]]
path = "changelogs/fragments/**"
precedence = "aggregate"
SPDX-FileCopyrightText = "Ansible Project"
SPDX-License-Identifier = "GPL-3.0-or-later"

View file

@ -1,97 +0,0 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
[collection_sources]
"community.internal_test_tools" = "git+https://github.com/ansible-collections/community.internal_test_tools.git,main"
"community.netcommon" = "git+https://github.com/ansible-collections/ansible.netcommon.git,main"
"community.utils" = "git+https://github.com/ansible-collections/ansible.utils.git,main"
[sessions]
[sessions.lint]
run_isort = false
run_black = false
run_flake8 = false
run_pylint = false
run_yamllint = true
yamllint_config = ".yamllint"
yamllint_config_plugins = ".yamllint-docs"
yamllint_config_plugins_examples = ".yamllint-examples"
yamllint_config_extra_docs = ".yamllint-extra-docs"
run_mypy = false
[sessions.docs_check]
validate_collection_refs="all"
codeblocks_restrict_types = [
"ansible-output",
"ini",
"yaml",
"yaml+jinja",
]
codeblocks_restrict_type_exact_case = true
codeblocks_allow_without_type = false
codeblocks_allow_literal_blocks = false
[sessions.license_check]
[sessions.extra_checks]
run_no_unwanted_files = true
no_unwanted_files_module_extensions = [".py"]
no_unwanted_files_yaml_extensions = [".yml"]
run_action_groups = true
run_no_trailing_whitespace = true
no_trailing_whitespace_skip_directories = [
"tests/unit/plugins/modules/fixtures/",
]
run_avoid_characters = true
[[sessions.extra_checks.action_groups_config]]
name = "api"
pattern = "^api.*$"
exclusions = []
doc_fragment = "community.routeros.attributes.actiongroup_api"
[[sessions.extra_checks.avoid_character_group]]
name = "tab"
regex = "\\x09"
[sessions.build_import_check]
run_galaxy_importer = true
[sessions.ansible_test_sanity]
include_devel = true
[sessions.ansible_test_units]
include_devel = true
[sessions.ansible_test_integration_w_default_container]
include_devel = true
controller_python_versions_only = true
[sessions.ansible_test_integration_w_default_container.core_python_versions]
"2.15" = ["2.7", "3.6", "3.7"]
"2.16" = ["3.10"]
"2.17" = ["3.8"]
"2.18" = ["3.9"]
"2.19" = ["3.11"]
[[sessions.ee_check.execution_environments]]
name = "devel-ubi-9"
description = "ansible-core devel @ RHEL UBI 9"
test_playbooks = ["tests/ee/all.yml"]
config.images.base_image.name = "docker.io/redhat/ubi9:latest"
config.dependencies.ansible_core.package_pip = "https://github.com/ansible/ansible/archive/devel.tar.gz"
config.dependencies.ansible_runner.package_pip = "ansible-runner"
config.dependencies.python_interpreter.package_system = "python3.12 python3.12-pip python3.12-wheel python3.12-cryptography"
config.dependencies.python_interpreter.python_path = "/usr/bin/python3.12"
runtime_environment = {"ANSIBLE_PRIVATE_ROLE_VARS" = "true"}
[[sessions.ee_check.execution_environments]]
name = "2.15-rocky-9"
description = "ansible-core 2.15 @ Rocky Linux 9"
test_playbooks = ["tests/ee/all.yml"]
config.images.base_image.name = "quay.io/rockylinux/rockylinux:9"
config.dependencies.ansible_core.package_pip = "https://github.com/ansible/ansible/archive/stable-2.15.tar.gz"
config.dependencies.ansible_runner.package_pip = "ansible-runner"
runtime_environment = {"ANSIBLE_PRIVATE_ROLE_VARS" = "true"}

View file

@ -795,179 +795,18 @@ releases:
- 322-add-l2tp-client-interface-configuration.yml - 322-add-l2tp-client-interface-configuration.yml
- 323-add-ros-7.16-parameters.yml - 323-add-ros-7.16-parameters.yml
release_date: '2024-10-17' release_date: '2024-10-17'
3.0.0: 2.20.1:
changes: changes:
breaking_changes: release_summary: 'This is the final community.routeros 2.x.y release.
- command - the module no longer declares that it supports check mode (https://github.com/ansible-collections/community.routeros/pull/318).
release_summary: Major release that drops support for End of Life Python versions
and fixes check mode for community.routeros.command.
removed_features:
- The collection no longer supports Ansible 2.9, ansible-base 2.10, ansible-core
2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14. If you
need to continue using End of Life versions of Ansible/ansible-base/ansible-core,
please use community.routeros 2.x.y (https://github.com/ansible-collections/community.routeros/pull/318).
fragments:
- 3.0.0.yml
release_date: '2024-10-20'
3.1.0:
changes:
bugfixes:
- api_info, api_modify - fields ``log`` and ``log-prefix`` in paths ``ip firewall
filter``, ``ip firewall mangle``, ``ip firewall nat``, ``ip firewall raw``
now have the correct default values (https://github.com/ansible-collections/community.routeros/pull/324).
minor_changes:
- api_info, api_modify - add missing fields ``comment``, ``next-pool`` to
``ip pool`` path (https://github.com/ansible-collections/community.routeros/pull/327).
release_summary: Bugfix and feature release.
fragments:
- 3.1.0.yml
- 324-fix-firewall-log-and-log-prefix.yaml
- 327-add-missing-ip-pool-fields.yml
release_date: '2024-12-02'
3.2.0:
changes:
minor_changes:
- api_info, api_modify - add support for the ``routing filter community-list``
path implemented by RouterOS 7 and newer (https://github.com/ansible-collections/community.routeros/pull/331).
release_summary: Feature release.
fragments:
- 3.2.0.yml
- 331-add-routing-filter-community-list.yml
release_date: '2024-12-30'
3.3.0:
changes:
minor_changes:
- api_info, api_modify - add missing attribute ``require-message-auth`` for
the ``radius`` path which exists since RouterOS version 7.15 (https://github.com/ansible-collections/community.routeros/issues/338,
https://github.com/ansible-collections/community.routeros/pull/339).
- api_info, api_modify - add the ``interface 6to4`` path. Used to manage IPv6
tunnels via tunnel-brokers like HE, where native IPv6 is not provided (https://github.com/ansible-collections/community.routeros/pull/342).
- api_info, api_modify - add the ``interface wireless access-list`` and ``interface
wireless connect-list`` paths (https://github.com/ansible-collections/community.routeros/issues/284,
https://github.com/ansible-collections/community.routeros/pull/340).
- api_info, api_modify - add the ``use-interface-duid`` option for ``ipv6
dhcp-client`` path. This option prevents issues with Fritzbox modems and
routers, when using virtual interfaces (like VLANs) may create duplicated
records in hosts config, this breaks original "expose-host" function. Also
add the ``script``, ``custom-duid`` and ``validate-server-duid`` as backport
from 7.15 version update (https://github.com/ansible-collections/community.routeros/pull/341).
release_summary: Feature release.
fragments:
- 3.3.0.yml
- 339-add-require-message-auth-for-radius.yml
- 340-add-interface-wireless-access-and-connect-list.yml
- 341-add-dhcpv6-client-use-interface-duid.yml
- 342-add-interface-6to4.yml
release_date: '2025-01-27'
3.4.0:
changes:
bugfixes:
- api_info, api_modify - remove the primary key ``action`` from the ``interface
wifi provisioning`` path, since RouterOS also allows to create completely
duplicate entries (https://github.com/ansible-collections/community.routeros/issues/344,
https://github.com/ansible-collections/community.routeros/pull/345).
minor_changes:
- api_info, api_modify - add support for the ``ip dns forwarders`` path implemented
by RouterOS 7.17 and newer (https://github.com/ansible-collections/community.routeros/pull/343).
release_summary: Feature and bugfix release.
fragments:
- 3.4.0.yml
- 343-add-ip-dns-forwarders.yml
- 345-interface-wifi-provisioning.yml
release_date: '2025-02-24'
3.5.0:
changes:
minor_changes:
- api_info, api_modify - change default for ``/ip/cloud/ddns-enabled`` for
RouterOS 7.17 and newer from ``yes`` to ``auto`` (https://github.com/ansible-collections/community.routeros/pull/350).
release_summary: Feature release.
fragments:
- 3.5.0.yml
- 350-ip-cloud-ddns-enabled-auto.yml
release_date: '2025-03-22'
3.6.0:
changes:
minor_changes:
- api_info, api_modify - add ``mdns-repeat-ifaces`` to ``ip dns`` for RouterOS
7.16 and newer (https://github.com/ansible-collections/community.routeros/pull/358).
- api_info, api_modify - field name change in ``routing bgp connection`` path
implemented by RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/360).
- api_info, api_modify - rename ``is-responder`` property in ``interface wireguard
peers`` to ``responder`` for RouterOS 7.17 and newer (https://github.com/ansible-collections/community.routeros/pull/364).
release_summary: Feature release.
fragments:
- 3.6.0.yml
- 358-mdns-repeat-ifaces.yml
- 360-bgp-connection-afi.yml
- 364-wireguard-responder.yml
release_date: '2025-04-21'
3.7.0:
changes:
minor_changes:
- api_find_and_modify - allow to control whether ``dynamic`` and/or ``builtin``
entries are ignored with the new ``ignore_dynamic`` and ``ignore_builtin``
options (https://github.com/ansible-collections/community.routeros/issues/372,
https://github.com/ansible-collections/community.routeros/pull/373).
- api_info, api_modify - add ``port-cost-mode`` to ``interface bridge`` which
is supported since RouterOS 7.13 (https://github.com/ansible-collections/community.routeros/pull/371).
release_summary: Feature release.
fragments:
- 3.7.0.yml
- 371-add-bridge-port-cost-mode.yml
- 373-api_find_and_modify-dynamic-builtin.yml
release_date: '2025-05-31'
3.8.0:
changes:
minor_changes:
- api_info, api_modify - add ``interface ethernet switch port-isolation``
which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375).
- 'api_info, api_modify - add ``routing bfd configuration``. Officially stabilized
BFD support for BGP and OSPF is available since RouterOS 7.11
(https://github.com/ansible-collections/community.routeros/pull/375).
' Please upgrade to community.routeros 3.x.y as soon as possible to receive
- api_modify, api_info - support API path ``ip ipsec mode-config`` (https://github.com/ansible-collections/community.routeros/pull/376). further bugfixes.
release_summary: Feature release.
Thanks to everyone who contributed to community.routeros 2.x.y releases!
'
fragments: fragments:
- 3.8.0.yml - 2.20.1.yml
- 375-port_isolation-and-routing_bfd_configuration.yml release_date: '2025-04-19'
- 376-ipsec-mode-config.yml
release_date: '2025-06-14'
3.8.1:
changes:
bugfixes:
- facts and api_facts modules - prevent deprecation warnings when used with
ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384).
release_summary: Bugfix release.
fragments:
- 3.8.1.yml
- 384-warnings.yml
release_date: '2025-07-26'
3.9.0:
changes:
bugfixes:
- routeros terminal plugin - fix ``terminal_stdout_re`` pattern to handle
long system identities when connecting to RouterOS through SSH (https://github.com/ansible-collections/community.routeros/pull/386).
minor_changes:
- api_info, api modify - add ``remote-log-format``, ``remote-protocol``, and
``event-delimiter`` to ``system logging action`` (https://github.com/ansible-collections/community.routeros/pull/381).
- api_info, api_modify - add ``disable-link-local-address`` and ``stale-neighbor-timeout``
fields to ``ipv6 settings`` (https://github.com/ansible-collections/community.routeros/pull/380).
- api_info, api_modify - adjust neighbor limit fields in ``ipv6 settings``
to match RouterOS 7.18 and newer (https://github.com/ansible-collections/community.routeros/pull/380).
- api_info, api_modify - set ``passthrough`` default in ``ip firewall mangle``
to ``true`` for RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/382).
- api_info, api_modify - since RouterOS 7.17 VRF is supported for OVPN server.
It now supports multiple entries, while ``api_modify`` so far only accepted
a single entry. The ``interface ovpn-server server`` path now allows multiple
entries on RouterOS 7.17 and newer (https://github.com/ansible-collections/community.routeros/pull/383).
release_summary: Bugfix and feature release.
fragments:
- 3.9.0.yml
- 380-ipv6-settings.yml
- 381-logging-cef.yml
- 382-mangle-passthrough.yml
- 385-vrf-support-for-ovpn-server.yml
- 386-fix-pattern-to-handle-long-identity.yml
release_date: '2025-08-10'

View file

@ -7,9 +7,9 @@ changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0 changelog_filename_version_depth: 0
changes_file: changelog.yaml changes_file: changelog.yaml
changes_format: combined changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false keep_fragments: false
mention_ancestor: true mention_ancestor: true
flatmap: true
new_plugins_after_name: removed_features new_plugins_after_name: removed_features
notesdir: fragments notesdir: fragments
output_formats: output_formats:
@ -40,4 +40,3 @@ use_fqcn: true
add_plugin_period: true add_plugin_period: true
changelog_nice_yaml: true changelog_nice_yaml: true
changelog_sort: version changelog_sort: version
vcs: auto

View file

@ -1,2 +0,0 @@
minor_changes:
- api_info, api_modify - add ``show-at-cli-login`` property in ``system note`` (https://github.com/ansible-collections/community.routeros/pull/392).

View file

@ -57,7 +57,7 @@ This results in the following output:
} }
PLAY RECAP ******************************************************************************************************* PLAY RECAP *******************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Check out the documentation of the :ansplugin:`community.routeros.api module <community.routeros.api#module>` for details on the options. Check out the documentation of the :ansplugin:`community.routeros.api module <community.routeros.api#module>` for details on the options.
@ -191,7 +191,7 @@ When this playbook completed successfully, you should be able to use the HTTPS a
.. code-block:: yaml+jinja .. code-block:: yaml+jinja
- community.routeros.api: - community.routeros.api:
# ... ...
tls: true tls: true
validate_certs: true validate_certs: true
validate_cert_hostname: true validate_cert_hostname: true

View file

@ -66,22 +66,22 @@ With the above inventory, you can use the following playbook to execute ``/syste
gather_facts: false gather_facts: false
tasks: tasks:
- name: Gather system resources - name: Gather system resources
community.routeros.command: community.routeros.command:
commands: commands:
- /system resource print - /system resource print
register: system_resource_print register: system_resource_print
- name: Show system resources - name: Show system resources
debug: debug:
var: system_resource_print.stdout_lines var: system_resource_print.stdout_lines
- name: Gather facts - name: Gather facts
community.routeros.facts: community.routeros.facts:
- name: Show a fact - name: Show a fact
debug: debug:
msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}" msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}"
This results in the following output: This results in the following output:
@ -126,4 +126,4 @@ This results in the following output:
} }
PLAY RECAP ******************************************************************************************************* PLAY RECAP *******************************************************************************************************
router : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 router : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

View file

@ -7,7 +7,7 @@
namespace: community namespace: community
name: routeros name: routeros
version: 3.9.0 version: 2.20.1
readme: README.md readme: README.md
authors: authors:
- Egor Zaitsev (github.com/heuels) - Egor Zaitsev (github.com/heuels)
@ -16,7 +16,7 @@ authors:
description: Modules and plugins for MikroTik RouterOS description: Modules and plugins for MikroTik RouterOS
license: license:
- GPL-3.0-or-later - GPL-3.0-or-later
# license_file: COPYING #license_file: COPYING
tags: tags:
- network - network
- mikrotik - mikrotik

View file

@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
requires_ansible: '>=2.15.0' requires_ansible: '>=2.9.10'
action_groups: action_groups:
api: api:
- api - api

View file

@ -1,53 +0,0 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# The following metadata allows Python runners and nox to install the required
# dependencies for running this Python script:
#
# /// script
# dependencies = ["nox>=2025.02.09", "antsibull-nox"]
# ///
import os
import sys
import nox
# We try to import antsibull-nox, and if that doesn't work, provide a more useful
# error message to the user.
try:
import antsibull_nox
except ImportError:
print("You need to install antsibull-nox in the same Python environment as nox.")
sys.exit(1)
IN_CI = os.environ.get("CI") == "true"
antsibull_nox.load_antsibull_nox_toml()
@nox.session(name="update-docs", default=True)
def update_docs_fragments(session: nox.Session) -> None:
"""
Update/check auto-generated parts of docs fragments.
"""
session.install("ansible-core")
prepare = antsibull_nox.sessions.prepare_collections(
session, install_in_site_packages=True
)
if not prepare:
return
data = ["python", "tests/update-docs.py"]
if IN_CI:
data.append("--lint")
session.run(*data)
# Allow to run the noxfile with `python noxfile.py`, `pipx run noxfile.py`, or similar.
# Requires nox >= 2025.02.09
if __name__ == "__main__":
nox.main()

View file

@ -5,14 +5,15 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
author: "Egor Zaitsev (@heuels)" author: "Egor Zaitsev (@heuels)"
name: routeros name: routeros
short_description: Use routeros cliconf to run command on MikroTik RouterOS platform short_description: Use routeros cliconf to run command on MikroTik RouterOS platform
description: description:
- This routeros plugin provides low level abstraction APIs for sending and receiving CLI commands from MikroTik RouterOS - This routeros plugin provides low level abstraction apis for
network devices. sending and receiving CLI commands from MikroTik RouterOS network devices.
""" '''
import re import re
import json import json

View file

@ -10,7 +10,7 @@ __metaclass__ = type
class ModuleDocFragment(object): class ModuleDocFragment(object):
DOCUMENTATION = r""" DOCUMENTATION = r'''
options: options:
hostname: hostname:
description: description:
@ -43,16 +43,17 @@ options:
- ssl - ssl
port: port:
description: description:
- RouterOS API port. If O(tls) is set, port will apply to TLS/SSL connection. - RouterOS api port. If O(tls) is set, port will apply to TLS/SSL connection.
- Defaults are V(8728) for the HTTP API, and V(8729) for the HTTPS API. - Defaults are V(8728) for the HTTP API, and V(8729) for the HTTPS API.
type: int type: int
force_no_cert: force_no_cert:
description: description:
- Set to V(true) to connect without a certificate when O(tls=true). - Set to V(true) to connect without a certificate when O(tls=true).
- See also O(validate_certs). - See also O(validate_certs).
- B(Note:) this forces the use of anonymous Diffie-Hellman (ADH) ciphers. The protocol is susceptible to Man-in-the-Middle - B(Note:) this forces the use of anonymous Diffie-Hellman (ADH) ciphers. The protocol is susceptible
attacks, because the keys used in the exchange are not authenticated. Instead of simply connecting without a certificate to Man-in-the-Middle attacks, because the keys used in the exchange are not authenticated.
to "make things work" have a look at O(validate_certs) and O(ca_path). Instead of simply connecting without a certificate to "make things work" have a look at
O(validate_certs) and O(ca_path).
type: bool type: bool
default: false default: false
version_added: 2.4.0 version_added: 2.4.0
@ -60,9 +61,10 @@ options:
description: description:
- Set to V(false) to skip validation of TLS certificates. - Set to V(false) to skip validation of TLS certificates.
- See also O(validate_cert_hostname). Only used when O(tls=true). - See also O(validate_cert_hostname). Only used when O(tls=true).
- B(Note:) instead of simply deactivating certificate validations to "make things work", please consider creating your - B(Note:) instead of simply deactivating certificate validations to "make things work",
own CA certificate and using it to sign certificates used for your router. You can tell the module about your CA certificate please consider creating your own CA certificate and using it to sign certificates used
with the O(ca_path) option. for your router. You can tell the module about your CA certificate with the O(ca_path)
option.
type: bool type: bool
default: true default: true
version_added: 1.2.0 version_added: 1.2.0
@ -91,10 +93,10 @@ requirements:
- Python >= 3.6 (for librouteros) - Python >= 3.6 (for librouteros)
seealso: seealso:
- ref: ansible_collections.community.routeros.docsite.api-guide - ref: ansible_collections.community.routeros.docsite.api-guide
description: How to connect to RouterOS devices with the RouterOS API. description: How to connect to RouterOS devices with the RouterOS API
""" '''
RESTRICT = r""" RESTRICT = r'''
options: options:
restrict: restrict:
type: list type: list
@ -113,21 +115,24 @@ options:
values: values:
description: description:
- The values of the field to limit to. - The values of the field to limit to.
- 'Note that the types of the values are important. If you provide a string V("0"), and librouteros converts the - >-
value returned by the API to the integer V(0), then this will not match. If you are not sure, better include both Note that the types of the values are important. If you provide a string V("0"),
variants: both the string and the integer.' and librouteros converts the value returned by the API to the integer V(0),
then this will not match. If you are not sure, better include both variants:
both the string and the integer.
type: list type: list
elements: raw elements: raw
regex: regex:
description: description:
- A regular expression matching values of the field to limit to. - A regular expression matching values of the field to limit to.
- Note that all values will be converted to strings before matching. - Note that all values will be converted to strings before matching.
- It is not possible to match disabled values with regular expressions. Set O(restrict[].match_disabled=true) if - It is not possible to match disabled values with regular expressions.
you also want to match disabled values. Set O(restrict[].match_disabled=true) if you also want to match disabled values.
type: str type: str
invert: invert:
description: description:
- Invert the condition. This affects O(restrict[].match_disabled), O(restrict[].values), and O(restrict[].regex). - Invert the condition. This affects O(restrict[].match_disabled), O(restrict[].values),
and O(restrict[].regex).
type: bool type: bool
default: false default: false
""" '''

View file

@ -11,102 +11,88 @@ __metaclass__ = type
class ModuleDocFragment(object): class ModuleDocFragment(object):
# Standard documentation fragment # Standard documentation fragment
DOCUMENTATION = r""" DOCUMENTATION = r'''
options: {} options: {}
attributes: attributes:
check_mode: check_mode:
description: Can run in C(check_mode) and return changed status prediction without modifying target. description: Can run in C(check_mode) and return changed status prediction without modifying target.
diff_mode: diff_mode:
description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode. description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode.
platform: platform:
description: Target OS/families that can be operated against. description: Target OS/families that can be operated against.
support: N/A support: N/A
idempotent: '''
description:
- When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change.
- This assumes that the system controlled/queried by the module has not changed in a relevant way.
"""
# Should be used together with the standard fragment
IDEMPOTENT_NOT_MODIFY_STATE = r"""
options: {}
attributes:
idempotent:
support: full
details:
- This action does not modify state.
"""
# Should be used together with the standard fragment # Should be used together with the standard fragment
INFO_MODULE = r''' INFO_MODULE = r'''
options: {} options: {}
attributes: attributes:
check_mode: check_mode:
support: full support: full
details: details:
- This action does not modify state. - This action does not modify state.
diff_mode: diff_mode:
support: N/A support: N/A
details: details:
- This action does not modify state. - This action does not modify state.
''' '''
ACTIONGROUP_API = r''' ACTIONGROUP_API = r'''
options: {} options: {}
attributes: attributes:
action_group: action_group:
description: Use C(group/community.routeros.api) in C(module_defaults) to set defaults for this module. description: Use C(group/community.routeros.api) in C(module_defaults) to set defaults for this module.
support: full support: full
membership: membership:
- community.routeros.api - community.routeros.api
''' '''
CONN = r""" CONN = r'''
options: {} options: {}
attributes: attributes:
become: become:
description: Is usable alongside C(become) keywords. description: Is usable alongside C(become) keywords.
connection: connection:
description: Uses the target's configured connection information to execute code on it. description: Uses the target's configured connection information to execute code on it.
delegation: delegation:
description: Can be used in conjunction with C(delegate_to) and related keywords. description: Can be used in conjunction with C(delegate_to) and related keywords.
""" '''
FACTS = r""" FACTS = r'''
options: {} options: {}
attributes: attributes:
facts: facts:
description: Action returns an C(ansible_facts) dictionary that will update existing host facts. description: Action returns an C(ansible_facts) dictionary that will update existing host facts.
""" '''
# Should be used together with the standard fragment and the FACTS fragment # Should be used together with the standard fragment and the FACTS fragment
FACTS_MODULE = r''' FACTS_MODULE = r'''
options: {} options: {}
attributes: attributes:
check_mode: check_mode:
support: full support: full
details: details:
- This action does not modify state. - This action does not modify state.
diff_mode: diff_mode:
support: N/A support: N/A
details: details:
- This action does not modify state. - This action does not modify state.
facts: facts:
support: full support: full
''' '''
FILES = r""" FILES = r'''
options: {} options: {}
attributes: attributes:
safe_file_operations: safe_file_operations:
description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption. description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption.
""" '''
FLOW = r""" FLOW = r'''
options: {} options: {}
attributes: attributes:
action: action:
description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller. description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller.
async: async:
description: Supports being used with the C(async) keyword. description: Supports being used with the C(async) keyword.
""" '''

View file

@ -20,7 +20,6 @@ DOCUMENTATION:
- Felix Fontein (@felixfontein) - Felix Fontein (@felixfontein)
EXAMPLES: | EXAMPLES: |
---
- name: Join arguments for a RouterOS CLI command - name: Join arguments for a RouterOS CLI command
ansible.builtin.set_fact: ansible.builtin.set_fact:
arguments: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.join }}" arguments: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.join }}"

View file

@ -30,7 +30,6 @@ DOCUMENTATION:
- Felix Fontein (@felixfontein) - Felix Fontein (@felixfontein)
EXAMPLES: | EXAMPLES: |
---
- name: Convert a list to a dictionary - name: Convert a list to a dictionary
ansible.builtin.set_fact: ansible.builtin.set_fact:
dictionary: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.list_to_dict }}" dictionary: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.list_to_dict }}"

View file

@ -19,11 +19,9 @@ DOCUMENTATION:
- Felix Fontein (@felixfontein) - Felix Fontein (@felixfontein)
EXAMPLES: | EXAMPLES: |
---
- name: Quote a RouterOS CLI command argument - name: Quote a RouterOS CLI command argument
ansible.builtin.set_fact: ansible.builtin.set_fact:
quoted: >- quoted: "{{ 'comment=this is a "comment"' | community.routeros.quote_argument }}"
{{ 'comment=this is a "comment"' | community.routeros.quote_argument }}
# Should result in 'comment="this is a \"comment\""' # Should result in 'comment="this is a \"comment\""'
RETURN: RETURN:

View file

@ -19,11 +19,9 @@ DOCUMENTATION:
- Felix Fontein (@felixfontein) - Felix Fontein (@felixfontein)
EXAMPLES: | EXAMPLES: |
---
- name: Quote a RouterOS CLI command argument's value - name: Quote a RouterOS CLI command argument's value
ansible.builtin.set_fact: ansible.builtin.set_fact:
quoted: >- quoted: "{{ 'this is a "comment"' | community.routeros.quote_argument_value }}"
{{ 'this is a "comment"' | community.routeros.quote_argument_value }}
# Should result in '"this is a \"comment\""' # Should result in '"this is a \"comment\""'
RETURN: RETURN:

View file

@ -19,11 +19,9 @@ DOCUMENTATION:
- Felix Fontein (@felixfontein) - Felix Fontein (@felixfontein)
EXAMPLES: | EXAMPLES: |
---
- name: Split command into list of arguments - name: Split command into list of arguments
ansible.builtin.set_fact: ansible.builtin.set_fact:
argument_list: >- argument_list: "{{ 'foo=bar comment="foo is bar" baz' | community.routeros.split }}"
{{ 'foo=bar comment="foo is bar" baz' | community.routeros.split }}
# Should result in ['foo=bar', 'comment=foo is bar', 'baz'] # Should result in ['foo=bar', 'comment=foo is bar', 'baz']
RETURN: RETURN:

View file

@ -226,25 +226,6 @@ def join_path(path):
# 3. All bold attributes go into the `primary_keys` list -- this is not always true! # 3. All bold attributes go into the `primary_keys` list -- this is not always true!
PATHS = { PATHS = {
('interface', '6to4'): APIData(
unversioned=VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
fields={
'clamp-tcp-mss': KeyInfo(default=True),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'dont-fragment': KeyInfo(default=False),
'dscp': KeyInfo(default='inherit'),
'ipsec-secret': KeyInfo(can_disable=True),
'keepalive': KeyInfo(default='10s,10', can_disable=True),
'local-address': KeyInfo(default='0.0.0.0'),
'mtu': KeyInfo(default='auto'),
'name': KeyInfo(),
'remote-address': KeyInfo(required=True),
}
),
),
('interface', 'bonding'): APIData( ('interface', 'bonding'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
@ -281,7 +262,6 @@ PATHS = {
versioned_fields=[ versioned_fields=[
([('7.0', '<')], 'ingress-filtering', KeyInfo(default=False)), ([('7.0', '<')], 'ingress-filtering', KeyInfo(default=False)),
([('7.0', '>=')], 'ingress-filtering', KeyInfo(default=True)), ([('7.0', '>=')], 'ingress-filtering', KeyInfo(default=True)),
([('7.13', '>=')], 'port-cost-mode', KeyInfo(default='long')),
([('7.16', '>=')], 'forward-reserved-addresses', KeyInfo(default=False)), ([('7.16', '>=')], 'forward-reserved-addresses', KeyInfo(default=False)),
([('7.16', '>=')], 'max-learned-entries', KeyInfo(default='auto')), ([('7.16', '>=')], 'max-learned-entries', KeyInfo(default='auto')),
], ],
@ -652,22 +632,13 @@ PATHS = {
), ),
('ip', 'ipsec', 'mode-config'): APIData( ('ip', 'ipsec', 'mode-config'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, unknown_mechanism=True,
primary_keys=('name', ), # primary_keys=('default', ),
versioned_fields=[
([('6.43', '>=')], 'responder', KeyInfo(default=False)),
([('6.44', '>=')], 'address', KeyInfo(can_disable=True, remove_value='0.0.0.0')),
],
fields={ fields={
'address-pool': KeyInfo(can_disable=True, remove_value='none'), 'default': KeyInfo(),
'address-prefix-length': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'name': KeyInfo(), 'name': KeyInfo(),
'split-dns': KeyInfo(can_disable=True, remove_value=''), 'responder': KeyInfo(),
'split-include': KeyInfo(can_disable=True, remove_value=''), 'use-responder-dns': KeyInfo(),
'src-address-list': KeyInfo(can_disable=True, remove_value=''),
'static-dns': KeyInfo(can_disable=True, remove_value=''),
'system-dns': KeyInfo(default=False),
}, },
), ),
), ),
@ -737,9 +708,7 @@ PATHS = {
fully_understood=True, fully_understood=True,
primary_keys=('name', ), primary_keys=('name', ),
fields={ fields={
'comment': KeyInfo(),
'name': KeyInfo(), 'name': KeyInfo(),
'next-pool': KeyInfo(),
'ranges': KeyInfo(), 'ranges': KeyInfo(),
}, },
), ),
@ -924,20 +893,6 @@ PATHS = {
)), )),
], ],
), ),
('routing', 'filter', 'community-list'): APIData(
versioned=[
('7', '>=', VersionedAPIData(
fully_understood=True,
fields={
'list': KeyInfo(required=True),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(can_disable=True),
'communities': KeyInfo(can_disable=True),
'regexp': KeyInfo(can_disable=True),
},
)),
],
),
('routing', 'ospf', 'instance'): APIData( ('routing', 'ospf', 'instance'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
@ -1553,19 +1508,13 @@ PATHS = {
fully_understood=True, fully_understood=True,
versioned_fields=[ versioned_fields=[
([('7.16', '>=')], 'multipath-hash-policy', KeyInfo(default='l3')), ([('7.16', '>=')], 'multipath-hash-policy', KeyInfo(default='l3')),
([('7.17', '>=')], 'disable-link-local-address', KeyInfo(default=False)),
([('7.17', '>=')], 'stale-neighbor-timeout', KeyInfo(default=60)),
([('7.18', '>=')], 'allow-fast-path', KeyInfo(default=True)),
([('7.18', '<')], 'max-neighbor-entries', KeyInfo(default=8192)),
([('7.18', '>=')], 'min-neighbor-entries', KeyInfo()),
([('7.18', '>=')], 'soft-max-neighbor-entries', KeyInfo()),
([('7.18', '>=')], 'max-neighbor-entries', KeyInfo()),
], ],
fields={ fields={
'accept-redirects': KeyInfo(default='yes-if-forwarding-disabled'), 'accept-redirects': KeyInfo(default='yes-if-forwarding-disabled'),
'accept-router-advertisements': KeyInfo(default='yes-if-forwarding-disabled'), 'accept-router-advertisements': KeyInfo(default='yes-if-forwarding-disabled'),
'disable-ipv6': KeyInfo(default=False), 'disable-ipv6': KeyInfo(default=False),
'forward': KeyInfo(default=True), 'forward': KeyInfo(default=True),
'max-neighbor-entries': KeyInfo(default=8192),
}, },
), ),
), ),
@ -1664,46 +1613,23 @@ PATHS = {
), ),
), ),
('interface', 'ovpn-server', 'server'): APIData( ('interface', 'ovpn-server', 'server'): APIData(
versioned=[ unversioned=VersionedAPIData(
('7.17', '>=', VersionedAPIData( single_value=True,
fully_understood=True, fully_understood=True,
fields={ fields={
'auth': KeyInfo(), 'auth': KeyInfo(),
'cipher': KeyInfo(), 'cipher': KeyInfo(),
'default-profile': KeyInfo(default='default'), 'default-profile': KeyInfo(default='default'),
'enabled': KeyInfo(default=False), 'enabled': KeyInfo(default=False),
'keepalive-timeout': KeyInfo(default=60), 'keepalive-timeout': KeyInfo(default=60),
'mac-address': KeyInfo(), 'mac-address': KeyInfo(),
'max-mtu': KeyInfo(default=1500), 'max-mtu': KeyInfo(default=1500),
'mode': KeyInfo(default='ip'), 'mode': KeyInfo(default='ip'),
'name': KeyInfo(default=''), 'netmask': KeyInfo(default=24),
'netmask': KeyInfo(default=24), 'port': KeyInfo(default=1194),
'port': KeyInfo(default=1194), 'require-client-certificate': KeyInfo(default=False),
'protocol': KeyInfo(default='tcp'), },
'require-client-certificate': KeyInfo(default=False), ),
'vrf': KeyInfo(default='main'),
},
)),
('7.17', '<', VersionedAPIData(
single_value=True,
fully_understood=True,
fields={
'auth': KeyInfo(),
'cipher': KeyInfo(),
'default-profile': KeyInfo(default='default'),
'enabled': KeyInfo(default=False),
'keepalive-timeout': KeyInfo(default=60),
'mac-address': KeyInfo(),
'max-mtu': KeyInfo(default=1500),
'mode': KeyInfo(default='ip'),
'name': KeyInfo(default=''),
'netmask': KeyInfo(default=24),
'port': KeyInfo(default=1194),
'protocol': KeyInfo(default='tcp'),
'require-client-certificate': KeyInfo(default=False),
},
))
]
), ),
('interface', 'pppoe-server', 'server'): APIData( ('interface', 'pppoe-server', 'server'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
@ -2076,6 +2002,7 @@ PATHS = {
versioned=[ versioned=[
('7.13', '>=', VersionedAPIData( ('7.13', '>=', VersionedAPIData(
fully_understood=True, fully_understood=True,
primary_keys=('action', ),
fields={ fields={
'action': KeyInfo(default='none'), 'action': KeyInfo(default='none'),
'address-ranges': KeyInfo(can_disable=True), 'address-ranges': KeyInfo(can_disable=True),
@ -2480,8 +2407,7 @@ PATHS = {
}, },
versioned_fields=[ versioned_fields=[
([('7.15', '>=')], 'name', KeyInfo()), ([('7.15', '>=')], 'name', KeyInfo()),
([('7.15', '>='), ('7.17', '<')], 'is-responder', KeyInfo()), ([('7.15', '>=')], 'is-responder', KeyInfo()),
([('7.17', '>=')], 'responder', KeyInfo()),
], ],
), ),
), ),
@ -2603,30 +2529,6 @@ PATHS = {
}, },
), ),
), ),
('interface', 'wireless', 'access-list'): APIData(
unversioned=VersionedAPIData(
fully_understood=True,
fields={
'allow-signal-out-of-range': KeyInfo(default='10s'),
'ap-tx-limit': KeyInfo(default=0),
'authentication': KeyInfo(default=True),
'client-tx-limit': KeyInfo(default=0),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'forwarding': KeyInfo(default=True),
'interface': KeyInfo(default='any'),
'mac-address': KeyInfo(default='00:00:00:00:00:00'),
'management-protection-key': KeyInfo(default=''),
'private-algo': KeyInfo(default='none'),
'private-key': KeyInfo(default=''),
'private-pre-shared-key': KeyInfo(default=''),
'signal-range': KeyInfo(default='-120..120'),
'time': KeyInfo(),
'vlan-id': KeyInfo(default=1),
'vlan-mode': KeyInfo(default='default'),
},
),
),
('interface', 'wireless', 'cap'): APIData( ('interface', 'wireless', 'cap'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
single_value=True, single_value=True,
@ -2645,41 +2547,6 @@ PATHS = {
}, },
), ),
), ),
('interface', 'wireless', 'connect-list'): APIData(
unversioned=VersionedAPIData(
fully_understood=True,
fields={
'3gpp': KeyInfo(default=''),
'allow-signal-out-of-range': KeyInfo(default='10s'),
'area-prefix': KeyInfo(default=''),
'comment': KeyInfo(can_disable=True, remove_value=''),
'connect': KeyInfo(default=True),
'disabled': KeyInfo(default=False),
'interface': KeyInfo(required=True),
'interworking': KeyInfo(default='any'),
'iw-asra': KeyInfo(default='any'),
'iw-authentication-types': KeyInfo(),
'iw-connection-capabilities': KeyInfo(),
'iw-esr': KeyInfo(default='any'),
'iw-hessid': KeyInfo(default='00:00:00:00:00:00'),
'iw-hotspot20': KeyInfo(default='any'),
'iw-hotspot20-dgaf': KeyInfo(default='any'),
'iw-internet': KeyInfo(default='any'),
'iw-ipv4-availability': KeyInfo(default='any'),
'iw-ipv6-availability': KeyInfo(default='any'),
'iw-network-type': KeyInfo(default='wildcard'),
'iw-realms': KeyInfo(),
'iw-roaming-ois': KeyInfo(default=''),
'iw-uesa': KeyInfo(default='any'),
'iw-venue': KeyInfo(default='any'),
'mac-address': KeyInfo(default='00:00:00:00:00:00'),
'security-profile': KeyInfo(default='none'),
'signal-range': KeyInfo(default='-120..120'),
'ssid': KeyInfo(default=''),
'wireless-protocol': KeyInfo(default='any'),
},
),
),
('interface', 'wireless', 'security-profiles'): APIData( ('interface', 'wireless', 'security-profiles'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
@ -2817,11 +2684,8 @@ PATHS = {
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
single_value=True, single_value=True,
fully_understood=True, fully_understood=True,
versioned_fields=[
([('7.17', '<')], 'ddns-enabled', KeyInfo(default=False)),
([('7.17', '>=')], 'ddns-enabled', KeyInfo(default='auto')),
],
fields={ fields={
'ddns-enabled': KeyInfo(default=False),
'ddns-update-interval': KeyInfo(default='none'), 'ddns-update-interval': KeyInfo(default='none'),
'update-time': KeyInfo(default=True), 'update-time': KeyInfo(default=True),
}, },
@ -3007,7 +2871,6 @@ PATHS = {
([('7.8', '>=')], 'doh-max-concurrent-queries', KeyInfo(default=50)), ([('7.8', '>=')], 'doh-max-concurrent-queries', KeyInfo(default=50)),
([('7.8', '>=')], 'doh-max-server-connections', KeyInfo(default=5)), ([('7.8', '>=')], 'doh-max-server-connections', KeyInfo(default=5)),
([('7.8', '>=')], 'doh-timeout', KeyInfo(default='5s')), ([('7.8', '>=')], 'doh-timeout', KeyInfo(default='5s')),
([('7.16', '>=')], 'mdns-repeat-ifaces', KeyInfo()),
], ],
fields={ fields={
'allow-remote-requests': KeyInfo(), 'allow-remote-requests': KeyInfo(),
@ -3040,22 +2903,6 @@ PATHS = {
)), )),
], ],
), ),
('ip', 'dns', 'forwarders'): APIData(
versioned=[
('7.17', '>=', VersionedAPIData(
fully_understood=True,
required_one_of=[['dns-servers', 'doh-servers']],
fields={
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'dns-servers': KeyInfo(default=''),
'doh-servers': KeyInfo(default=''),
'name': KeyInfo(required=True),
'verify-doh-cert': KeyInfo(default=True),
},
)),
],
),
('ip', 'dns', 'static'): APIData( ('ip', 'dns', 'static'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
@ -3137,8 +2984,8 @@ PATHS = {
'jump-target': KeyInfo(can_disable=True), 'jump-target': KeyInfo(can_disable=True),
'layer7-protocol': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True),
'log': KeyInfo(default=False), 'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(default=''), 'log-prefix': KeyInfo(can_disable=True),
'nth': KeyInfo(can_disable=True), 'nth': KeyInfo(can_disable=True),
'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True),
'out-bridge-port-list': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True),
@ -3174,10 +3021,6 @@ PATHS = {
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
stratify_keys=('chain', ), stratify_keys=('chain', ),
versioned_fields=[
([('7.19', '<')], 'passthrough', KeyInfo(can_disable=True)),
([('7.19', '>=')], 'passthrough', KeyInfo(default=True)),
],
fields={ fields={
'action': KeyInfo(), 'action': KeyInfo(),
'address-list': KeyInfo(can_disable=True), 'address-list': KeyInfo(can_disable=True),
@ -3212,8 +3055,8 @@ PATHS = {
'jump-target': KeyInfo(can_disable=True), 'jump-target': KeyInfo(can_disable=True),
'layer7-protocol': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True),
'log': KeyInfo(default=False), 'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(default=''), 'log-prefix': KeyInfo(can_disable=True),
'new-connection-mark': KeyInfo(can_disable=True), 'new-connection-mark': KeyInfo(can_disable=True),
'new-dscp': KeyInfo(can_disable=True), 'new-dscp': KeyInfo(can_disable=True),
'new-mss': KeyInfo(can_disable=True), 'new-mss': KeyInfo(can_disable=True),
@ -3229,6 +3072,7 @@ PATHS = {
'p2p': KeyInfo(can_disable=True), 'p2p': KeyInfo(can_disable=True),
'packet-mark': KeyInfo(can_disable=True), 'packet-mark': KeyInfo(can_disable=True),
'packet-size': KeyInfo(can_disable=True), 'packet-size': KeyInfo(can_disable=True),
'passthrough': KeyInfo(can_disable=True),
'per-connection-classifier': KeyInfo(can_disable=True), 'per-connection-classifier': KeyInfo(can_disable=True),
'port': KeyInfo(can_disable=True), 'port': KeyInfo(can_disable=True),
'priority': KeyInfo(can_disable=True), 'priority': KeyInfo(can_disable=True),
@ -3291,8 +3135,8 @@ PATHS = {
'jump-target': KeyInfo(can_disable=True), 'jump-target': KeyInfo(can_disable=True),
'layer7-protocol': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True),
'log': KeyInfo(default=False), 'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(default=''), 'log-prefix': KeyInfo(can_disable=True),
'nth': KeyInfo(can_disable=True), 'nth': KeyInfo(can_disable=True),
'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True),
'out-bridge-port-list': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True),
@ -3354,8 +3198,8 @@ PATHS = {
'ipv4-options': KeyInfo(can_disable=True), 'ipv4-options': KeyInfo(can_disable=True),
'jump-target': KeyInfo(can_disable=True), 'jump-target': KeyInfo(can_disable=True),
'limit': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True),
'log': KeyInfo(default=False), 'log': KeyInfo(can_disable=True),
'log-prefix': KeyInfo(default=''), 'log-prefix': KeyInfo(can_disable=True),
'nth': KeyInfo(can_disable=True), 'nth': KeyInfo(can_disable=True),
'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True),
'out-bridge-port-list': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True),
@ -3625,14 +3469,6 @@ PATHS = {
'request': KeyInfo(), 'request': KeyInfo(),
'use-peer-dns': KeyInfo(default=True), 'use-peer-dns': KeyInfo(default=True),
}, },
versioned_fields=[
# Mikrotik does not provide exact version in official changelogs.
# The 7.15 version is the earliest, found option in router config backups:
([('7.15', '>=')], 'script', KeyInfo(default='')),
([('7.15', '>=')], 'custom-duid', KeyInfo(default='')),
([('7.15', '>=')], 'use-interface-duid', KeyInfo(default=False)),
([('7.15', '>=')], 'validate-server-duid', KeyInfo(default=True)),
],
), ),
), ),
('ipv6', 'dhcp-server'): APIData( ('ipv6', 'dhcp-server'): APIData(
@ -4166,9 +4002,6 @@ PATHS = {
'src-address': KeyInfo(default='0.0.0.0'), 'src-address': KeyInfo(default='0.0.0.0'),
'timeout': KeyInfo(default='300ms'), 'timeout': KeyInfo(default='300ms'),
}, },
versioned_fields=[
([('7.15', '>=')], 'require-message-auth', KeyInfo(default='yes-for-request-resp')),
],
), ),
), ),
('radius', 'incoming'): APIData( ('radius', 'incoming'): APIData(
@ -4219,28 +4052,6 @@ PATHS = {
}, },
), ),
), ),
('routing', 'bfd', 'configuration'): APIData(
versioned=[
('7.11', '>=', VersionedAPIData(
fully_understood=True,
fields={
'address-list': KeyInfo(),
'addresses': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'copy-from': KeyInfo(),
'disabled': KeyInfo(default=False),
'forbid-bfd': KeyInfo(),
'interfaces': KeyInfo(),
'min-echo-rx': KeyInfo(),
'min-rx': KeyInfo(),
'min-tx': KeyInfo(),
'multiplier': KeyInfo(),
'place-before': KeyInfo(),
'vrf': KeyInfo(),
},
))
],
),
('routing', 'bfd', 'interface'): APIData( ('routing', 'bfd', 'interface'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
unknown_mechanism=True, unknown_mechanism=True,
@ -4421,9 +4232,6 @@ PATHS = {
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
single_value=True, single_value=True,
fully_understood=True, fully_understood=True,
versioned_fields=[
([('7.14', '>=')], 'show-at-cli-login', KeyInfo(default=False)),
],
fields={ fields={
'note': KeyInfo(default=''), 'note': KeyInfo(default=''),
'show-at-login': KeyInfo(default=True), 'show-at-login': KeyInfo(default=True),
@ -4960,18 +4768,6 @@ PATHS = {
}, },
), ),
), ),
('interface', 'ethernet', 'switch', 'port-isolation'): APIData(
versioned=[
('6.43', '>=', VersionedAPIData(
primary_keys=('name', ),
fully_understood=True,
fields={
'forwarding-override': KeyInfo(),
'name': KeyInfo(),
},
)),
],
),
('ip', 'dhcp-client', 'option'): APIData( ('ip', 'dhcp-client', 'option'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fixed_entries=True, fixed_entries=True,
@ -5062,13 +4858,10 @@ PATHS = {
('routing', 'bgp', 'connection'): APIData( ('routing', 'bgp', 'connection'): APIData(
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
versioned_fields=[
([('7.19', '<')], 'address-families', KeyInfo()),
([('7.19', '>=')], 'afi', KeyInfo()),
],
fields={ fields={
'as': KeyInfo(), 'as': KeyInfo(),
'add-path-out': KeyInfo(), 'add-path-out': KeyInfo(),
'address-families': KeyInfo(),
'cisco-vpls-nlri-len-fmt': KeyInfo(), 'cisco-vpls-nlri-len-fmt': KeyInfo(),
'cluster-id': KeyInfo(), 'cluster-id': KeyInfo(),
'comment': KeyInfo(), 'comment': KeyInfo(),
@ -5247,11 +5040,6 @@ PATHS = {
unversioned=VersionedAPIData( unversioned=VersionedAPIData(
fully_understood=True, fully_understood=True,
primary_keys=('name',), primary_keys=('name',),
versioned_fields=[
([('7.18', '>=')], 'remote-log-format', KeyInfo(default='default')),
([('7.18', '>=')], 'remote-protocol', KeyInfo(default='udp')),
([('7.18', '>=')], 'cef-event-delimiter', KeyInfo(default='\r\n')),
],
fields={ fields={
'bsd-syslog': KeyInfo(default=False), 'bsd-syslog': KeyInfo(default=False),
'comment': KeyInfo(can_disable=True, remove_value=''), 'comment': KeyInfo(can_disable=True, remove_value=''),

View file

@ -0,0 +1,345 @@
# Vendored copy of distutils/version.py from CPython 3.9.5
#
# Implements multiple version numbering conventions for the
# Python Module Distribution Utilities.
#
# Copyright (c) 2001-2022 Python Software Foundation. All rights reserved.
# PSF License (see LICENSES/PSF-2.0.txt or https://opensource.org/licenses/Python-2.0)
# SPDX-License-Identifier: PSF-2.0
#
"""Provides classes to represent module version numbers (one class for
each style of version numbering). There are currently two such classes
implemented: StrictVersion and LooseVersion.
Every version number class implements the following interface:
* the 'parse' method takes a string and parses it to some internal
representation; if the string is an invalid version number,
'parse' raises a ValueError exception
* the class constructor takes an optional string argument which,
if supplied, is passed to 'parse'
* __str__ reconstructs the string that was passed to 'parse' (or
an equivalent string -- ie. one that will generate an equivalent
version number instance)
* __repr__ generates Python code to recreate the version number instance
* _cmp compares the current instance with either another instance
of the same class or a string (which will be parsed to an instance
of the same class, thus must follow the same rules)
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
try:
RE_FLAGS = re.VERBOSE | re.ASCII
except AttributeError:
RE_FLAGS = re.VERBOSE
class Version:
"""Abstract base class for version numbering classes. Just provides
constructor (__init__) and reproducer (__repr__), because those
seem to be the same for all version numbering classes; and route
rich comparisons to _cmp.
"""
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def __repr__(self):
return "%s ('%s')" % (self.__class__.__name__, str(self))
def __eq__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c == 0
def __lt__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c < 0
def __le__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c <= 0
def __gt__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c > 0
def __ge__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c >= 0
# Interface for version-number classes -- must be implemented
# by the following classes (the concrete ones -- Version should
# be treated as an abstract class).
# __init__ (string) - create and take same action as 'parse'
# (string parameter is optional)
# parse (string) - convert a string representation to whatever
# internal representation is appropriate for
# this style of version numbering
# __str__ (self) - convert back to a string; should be very similar
# (if not identical to) the string supplied to parse
# __repr__ (self) - generate Python code to recreate
# the instance
# _cmp (self, other) - compare two version numbers ('other' may
# be an unparsed version string, or another
# instance of your version class)
class StrictVersion(Version):
"""Version numbering for anal retentives and software idealists.
Implements the standard interface for version number classes as
described above. A version number consists of two or three
dot-separated numeric components, with an optional "pre-release" tag
on the end. The pre-release tag consists of the letter 'a' or 'b'
followed by a number. If the numeric components of two version
numbers are equal, then one with a pre-release tag will always
be deemed earlier (lesser) than one without.
The following are valid version numbers (shown in the order that
would be obtained by sorting according to the supplied cmp function):
0.4 0.4.0 (these two are equivalent)
0.4.1
0.5a1
0.5b3
0.5
0.9.6
1.0
1.0.4a3
1.0.4b1
1.0.4
The following are examples of invalid version numbers:
1
2.7.2.2
1.3.a4
1.3pl1
1.3c4
The rationale for this version numbering system will be explained
in the distutils documentation.
"""
version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$',
RE_FLAGS)
def parse(self, vstring):
match = self.version_re.match(vstring)
if not match:
raise ValueError("invalid version number '%s'" % vstring)
(major, minor, patch, prerelease, prerelease_num) = \
match.group(1, 2, 4, 5, 6)
if patch:
self.version = tuple(map(int, [major, minor, patch]))
else:
self.version = tuple(map(int, [major, minor])) + (0,)
if prerelease:
self.prerelease = (prerelease[0], int(prerelease_num))
else:
self.prerelease = None
def __str__(self):
if self.version[2] == 0:
vstring = '.'.join(map(str, self.version[0:2]))
else:
vstring = '.'.join(map(str, self.version))
if self.prerelease:
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
return vstring
def _cmp(self, other):
if isinstance(other, str):
other = StrictVersion(other)
elif not isinstance(other, StrictVersion):
return NotImplemented
if self.version != other.version:
# numeric versions don't match
# prerelease stuff doesn't matter
if self.version < other.version:
return -1
else:
return 1
# have to compare prerelease
# case 1: neither has prerelease; they're equal
# case 2: self has prerelease, other doesn't; other is greater
# case 3: self doesn't have prerelease, other does: self is greater
# case 4: both have prerelease: must compare them!
if (not self.prerelease and not other.prerelease):
return 0
elif (self.prerelease and not other.prerelease):
return -1
elif (not self.prerelease and other.prerelease):
return 1
elif (self.prerelease and other.prerelease):
if self.prerelease == other.prerelease:
return 0
elif self.prerelease < other.prerelease:
return -1
else:
return 1
else:
raise AssertionError("never get here")
# end class StrictVersion
# The rules according to Greg Stein:
# 1) a version number has 1 or more numbers separated by a period or by
# sequences of letters. If only periods, then these are compared
# left-to-right to determine an ordering.
# 2) sequences of letters are part of the tuple for comparison and are
# compared lexicographically
# 3) recognize the numeric components may have leading zeroes
#
# The LooseVersion class below implements these rules: a version number
# string is split up into a tuple of integer and string components, and
# comparison is a simple tuple comparison. This means that version
# numbers behave in a predictable and obvious way, but a way that might
# not necessarily be how people *want* version numbers to behave. There
# wouldn't be a problem if people could stick to purely numeric version
# numbers: just split on period and compare the numbers as tuples.
# However, people insist on putting letters into their version numbers;
# the most common purpose seems to be:
# - indicating a "pre-release" version
# ('alpha', 'beta', 'a', 'b', 'pre', 'p')
# - indicating a post-release patch ('p', 'pl', 'patch')
# but of course this can't cover all version number schemes, and there's
# no way to know what a programmer means without asking him.
#
# The problem is what to do with letters (and other non-numeric
# characters) in a version number. The current implementation does the
# obvious and predictable thing: keep them as strings and compare
# lexically within a tuple comparison. This has the desired effect if
# an appended letter sequence implies something "post-release":
# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002".
#
# However, if letters in a version number imply a pre-release version,
# the "obvious" thing isn't correct. Eg. you would expect that
# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison
# implemented here, this just isn't so.
#
# Two possible solutions come to mind. The first is to tie the
# comparison algorithm to a particular set of semantic rules, as has
# been done in the StrictVersion class above. This works great as long
# as everyone can go along with bondage and discipline. Hopefully a
# (large) subset of Python module programmers will agree that the
# particular flavour of bondage and discipline provided by StrictVersion
# provides enough benefit to be worth using, and will submit their
# version numbering scheme to its domination. The free-thinking
# anarchists in the lot will never give in, though, and something needs
# to be done to accommodate them.
#
# Perhaps a "moderately strict" version class could be implemented that
# lets almost anything slide (syntactically), and makes some heuristic
# assumptions about non-digits in version number strings. This could
# sink into special-case-hell, though; if I was as talented and
# idiosyncratic as Larry Wall, I'd go ahead and implement a class that
# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is
# just as happy dealing with things like "2g6" and "1.13++". I don't
# think I'm smart enough to do it right though.
#
# In any case, I've coded the test suite for this module (see
# ../test/test_version.py) specifically to fail on things like comparing
# "1.2a2" and "1.2". That's not because the *code* is doing anything
# wrong, it's because the simple, obvious design doesn't match my
# complicated, hairy expectations for real-world version numbers. It
# would be a snap to fix the test suite to say, "Yep, LooseVersion does
# the Right Thing" (ie. the code matches the conception). But I'd rather
# have a conception that matches common notions about version numbers.
class LooseVersion(Version):
"""Version numbering for anarchists and software realists.
Implements the standard interface for version number classes as
described above. A version number consists of a series of numbers,
separated by either periods or strings of letters. When comparing
version numbers, the numeric components will be compared
numerically, and the alphabetic components lexically. The following
are all valid version numbers, in no particular order:
1.5.1
1.5.2b2
161
3.10a
8.02
3.4j
1996.07.12
3.2.pl0
3.1.1.6
2g6
11g
0.960923
2.2beta29
1.13++
5.5.kw
2.0b1pl0
In fact, there is no such thing as an invalid version number under
this scheme; the rules for comparison are simple and predictable,
but may not always give the results you want (for some definition
of "want").
"""
component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def parse(self, vstring):
# I've given up on thinking I can reconstruct the version string
# from the parsed tuple -- so I just store the string here for
# use by __str__
self.vstring = vstring
components = [x for x in self.component_re.split(vstring) if x and x != '.']
for i, obj in enumerate(components):
try:
components[i] = int(obj)
except ValueError:
pass
self.version = components
def __str__(self):
return self.vstring
def __repr__(self):
return "LooseVersion ('%s')" % str(self)
def _cmp(self, other):
if isinstance(other, str):
other = LooseVersion(other)
elif not isinstance(other, LooseVersion):
return NotImplemented
if self.version == other.version:
return 0
if self.version < other.version:
return -1
if self.version > other.version:
return 1
# end class LooseVersion

View file

@ -10,4 +10,9 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
from ansible.module_utils.compat.version import LooseVersion # pylint: disable=unused-import # Once we drop support for Ansible 2.9, ansible-base 2.10, and ansible-core 2.11, we can
# remove the _version.py file, and replace the following import by
#
# from ansible.module_utils.compat.version import LooseVersion
from ._version import LooseVersion # noqa: F401, pylint: disable=unused-import

View file

@ -8,17 +8,19 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: api module: api
author: "Nikolay Dachev (@NikolayDachev)" author: "Nikolay Dachev (@NikolayDachev)"
short_description: Ansible module for RouterOS API short_description: Ansible module for RouterOS API
description: description:
- Ansible module for RouterOS API with the Python C(librouteros) library. - Ansible module for RouterOS API with the Python C(librouteros) library.
- This module can add, remove, update, query, and execute arbitrary command in RouterOS through the API. - This module can add, remove, update, query and execute arbitrary command in RouterOS via API.
notes: notes:
- O(add), O(remove), O(update), O(cmd), and O(query) are mutually exclusive. - O(add), O(remove), O(update), O(cmd), and O(query) are mutually exclusive.
- Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules for more specific modifications, - Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules
and the M(community.routeros.api_info) module for a more controlled way of returning all entries for a path. for more specific modifications, and the M(community.routeros.api_info) module for a more controlled
way of returning all entries for a path.
extends_documentation_fragment: extends_documentation_fragment:
- community.routeros.api - community.routeros.api
- community.routeros.attributes - community.routeros.attributes
@ -33,15 +35,11 @@ attributes:
platforms: RouterOS platforms: RouterOS
action_group: action_group:
version_added: 2.1.0 version_added: 2.1.0
idempotent:
support: N/A
details:
- Whether the executed command is idempotent depends on the operation performed.
options: options:
path: path:
description: description:
- Main path for all other arguments. - Main path for all other arguments.
- If other arguments are not set, the module will return all items in selected path. - If other arguments are not set, api will return all items in selected path.
- Example V(ip address). Equivalent of RouterOS CLI C(/ip address print). - Example V(ip address). Equivalent of RouterOS CLI C(/ip address print).
required: true required: true
type: str type: str
@ -61,7 +59,7 @@ options:
update: update:
description: description:
- Update config/value in RouterOS by '.id' in selected path. - Update config/value in RouterOS by '.id' in selected path.
- Example V(.id=*03 address=1.1.1.3/32) and path V(ip address) will replace the existing IP address with C(.id=*03). - Example V(.id=*03 address=1.1.1.3/32) and path V(ip address) will replace existing ip address with C(.id=*03).
- Equivalent in RouterOS CLI C(/ip address set address=1.1.1.3/32 numbers=1). - Equivalent in RouterOS CLI C(/ip address set address=1.1.1.3/32 numbers=1).
- Note C(number) in RouterOS CLI is different from C(.id). - Note C(number) in RouterOS CLI is different from C(.id).
type: str type: str
@ -70,12 +68,11 @@ options:
- Query given path for selected query attributes from RouterOS API. - Query given path for selected query attributes from RouterOS API.
- WHERE is key word which extend query. WHERE format is key operator value - with spaces. - WHERE is key word which extend query. WHERE format is key operator value - with spaces.
- WHERE valid operators are V(==) or V(eq), V(!=) or V(not), V(>) or V(more), V(<) or V(less). - WHERE valid operators are V(==) or V(eq), V(!=) or V(not), V(>) or V(more), V(<) or V(less).
- Example path V(ip address) and query V(.id address) will return only C(.id) and C(address) for all items in V(ip address) - Example path V(ip address) and query V(.id address) will return only C(.id) and C(address) for all items in V(ip address) path.
path. - Example path V(ip address) and query V(.id address WHERE address == 1.1.1.3/32).
- Example path V(ip address) and query V(.id address WHERE address == 1.1.1.3/32). will return only C(.id) and C(address) will return only C(.id) and C(address) for items in V(ip address) path, where address is eq to 1.1.1.3/32.
for items in V(ip address) path, where address is eq to 1.1.1.3/32. - Example path V(interface) and query V(mtu name WHERE mut > 1400) will
- Example path V(interface) and query V(mtu name WHERE mut > 1400) will return only interfaces C(mtu,name) where mtu return only interfaces C(mtu,name) where mtu is bigger than 1400.
is bigger than 1400.
- Equivalent in RouterOS CLI C(/interface print where mtu > 1400). - Equivalent in RouterOS CLI C(/interface print where mtu > 1400).
type: str type: str
extended_query: extended_query:
@ -94,8 +91,7 @@ options:
where: where:
description: description:
- Allows to restrict the objects returned. - Allows to restrict the objects returned.
- The conditions here must all match. An O(extended_query.where[].or) condition needs at least one of its conditions - The conditions here must all match. An O(extended_query.where[].or) condition needs at least one of its conditions to match.
to match.
type: list type: list
elements: dict elements: dict
suboptions: suboptions:
@ -109,8 +105,7 @@ options:
description: description:
- The operator to use for matching. - The operator to use for matching.
- For equality use V(==) or V(eq). For less use V(<) or V(less). For more use V(>) or V(more). - For equality use V(==) or V(eq). For less use V(<) or V(less). For more use V(>) or V(more).
- Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].value) must - Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].value) must be a list.
be a list.
- Either O(extended_query.where[].or) or all of O(extended_query.where[].attribute), O(extended_query.where[].is), - Either O(extended_query.where[].or) or all of O(extended_query.where[].attribute), O(extended_query.where[].is),
and O(extended_query.where[].value) have to be specified. and O(extended_query.where[].value) have to be specified.
type: str type: str
@ -138,8 +133,7 @@ options:
description: description:
- The operator to use for matching. - The operator to use for matching.
- For equality use V(==) or V(eq). For less use V(<) or V(less). For more use V(>) or V(more). - For equality use V(==) or V(eq). For less use V(<) or V(less). For more use V(>) or V(more).
- Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].or[].value) - Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].or[].value) must be a list.
must be a list.
type: str type: str
choices: ["==", "!=", ">", "<", "in", "eq", "not", "more", "less"] choices: ["==", "!=", ">", "<", "in", "eq", "not", "more", "less"]
required: true required: true
@ -156,15 +150,14 @@ options:
type: str type: str
seealso: seealso:
- ref: ansible_collections.community.routeros.docsite.quoting - ref: ansible_collections.community.routeros.docsite.quoting
description: How to quote and unquote commands and arguments. description: How to quote and unquote commands and arguments
- module: community.routeros.api_facts - module: community.routeros.api_facts
- module: community.routeros.api_find_and_modify - module: community.routeros.api_find_and_modify
- module: community.routeros.api_info - module: community.routeros.api_info
- module: community.routeros.api_modify - module: community.routeros.api_modify
""" '''
EXAMPLES = r""" EXAMPLES = '''
---
- name: Get example - ip address print - name: Get example - ip address print
community.routeros.api: community.routeros.api:
hostname: "{{ hostname }}" hostname: "{{ hostname }}"
@ -223,8 +216,8 @@ EXAMPLES = r"""
- attribute: "network" - attribute: "network"
is: "in" is: "in"
value: value:
- "10.20.36.0" - "10.20.36.0"
- "192.168.255.0" - "192.168.255.0"
register: extended_queryout register: extended_queryout
- name: Dump "Extended query example" output - name: Dump "Extended query example" output
@ -238,9 +231,9 @@ EXAMPLES = r"""
username: "{{ username }}" username: "{{ username }}"
path: "ip address" path: "ip address"
update: >- update: >-
.id=*14 .id=*14
address=192.168.255.20/24 address=192.168.255.20/24
comment={{ 'Update 192.168.255.10/24 to 192.168.255.20/24 on ether2' | community.routeros.quote_argument_value }} comment={{ 'Update 192.168.255.10/24 to 192.168.255.20/24 on ether2' | community.routeros.quote_argument_value }}
- name: Remove example - ether2 ip 192.168.255.20/24 with ".id = *14" - name: Remove example - ether2 ip 192.168.255.20/24 with ".id = *14"
community.routeros.api: community.routeros.api:
@ -262,17 +255,18 @@ EXAMPLES = r"""
- name: Dump "Arbitrary command example" output - name: Dump "Arbitrary command example" output
ansible.builtin.debug: ansible.builtin.debug:
msg: '{{ arbitraryout }}' msg: '{{ arbitraryout }}'
""" '''
RETURN = r""" RETURN = '''
---
message: message:
description: All outputs are in list with dictionary elements returned from RouterOS API. description: All outputs are in list with dictionary elements returned from RouterOS api.
sample: sample:
- address: 1.2.3.4 - address: 1.2.3.4
- address: 2.3.4.5 - address: 2.3.4.5
type: list type: list
returned: always returned: always
""" '''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native

View file

@ -9,27 +9,29 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: api_facts module: api_facts
author: author:
- "Egor Zaitsev (@heuels)" - "Egor Zaitsev (@heuels)"
- "Nikolay Dachev (@NikolayDachev)" - "Nikolay Dachev (@NikolayDachev)"
- "Felix Fontein (@felixfontein)" - "Felix Fontein (@felixfontein)"
version_added: 2.1.0 version_added: 2.1.0
short_description: Collect facts from remote devices running MikroTik RouterOS using the API short_description: Collect facts from remote devices running MikroTik RouterOS using the API
description: description:
- Collects a base set of device facts from a remote device that is running RouterOS. This module prepends all of the base - Collects a base set of device facts from a remote device that
network fact keys with C(ansible_net_<fact>). The facts module will always collect a base set of facts from the device is running RouterOS. This module prepends all of the
base network fact keys with C(ansible_net_<fact>). The facts
module will always collect a base set of facts from the device
and can enable or disable collection of additional facts. and can enable or disable collection of additional facts.
- As opposed to the M(community.routeros.facts) module, it uses the RouterOS API, similar to the M(community.routeros.api) - As opposed to the M(community.routeros.facts) module, it uses the
module. RouterOS API, similar to the M(community.routeros.api) module.
extends_documentation_fragment: extends_documentation_fragment:
- community.routeros.api - community.routeros.api
- community.routeros.attributes - community.routeros.attributes
- community.routeros.attributes.actiongroup_api - community.routeros.attributes.actiongroup_api
- community.routeros.attributes.facts - community.routeros.attributes.facts
- community.routeros.attributes.facts_module - community.routeros.attributes.facts_module
- community.routeros.attributes.idempotent_not_modify_state
attributes: attributes:
platform: platform:
support: full support: full
@ -37,10 +39,12 @@ attributes:
options: options:
gather_subset: gather_subset:
description: description:
- When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument - When supplied, this argument will restrict the facts collected
include V(all), V(hardware), V(interfaces), and V(routing). to a given subset. Possible values for this argument include
- Can specify a list of values to include a larger subset. Values can also be used with an initial V(!) to specify that V(all), V(hardware), V(interfaces), and V(routing).
a specific subset should not be collected. - Can specify a list of values to include a larger subset.
Values can also be used with an initial V(!) to specify that a
specific subset should not be collected.
required: false required: false
default: default:
- all - all
@ -52,10 +56,9 @@ seealso:
- module: community.routeros.api_find_and_modify - module: community.routeros.api_find_and_modify
- module: community.routeros.api_info - module: community.routeros.api_info
- module: community.routeros.api_modify - module: community.routeros.api_modify
""" '''
EXAMPLES = r""" EXAMPLES = """
---
- name: Collect all facts from the device - name: Collect all facts from the device
community.routeros.api_facts: community.routeros.api_facts:
hostname: 192.168.88.1 hostname: 192.168.88.1
@ -72,7 +75,7 @@ EXAMPLES = r"""
- "!hardware" - "!hardware"
""" """
RETURN = r""" RETURN = """
ansible_facts: ansible_facts:
description: "Dictionary of IP geolocation facts for a host's IP address." description: "Dictionary of IP geolocation facts for a host's IP address."
returned: always returned: always
@ -419,6 +422,8 @@ FACT_SUBSETS = dict(
VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) VALID_SUBSETS = frozenset(FACT_SUBSETS.keys())
warnings = []
def main(): def main():
argument_spec = dict( argument_spec = dict(
@ -483,7 +488,7 @@ def main():
key = 'ansible_net_%s' % key key = 'ansible_net_%s' % key
ansible_facts[key] = value ansible_facts[key] = value
module.exit_json(ansible_facts=ansible_facts) module.exit_json(ansible_facts=ansible_facts, warnings=warnings)
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -8,7 +8,8 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: api_find_and_modify module: api_find_and_modify
author: author:
- "Felix Fontein (@felixfontein)" - "Felix Fontein (@felixfontein)"
@ -16,13 +17,13 @@ short_description: Find and modify information using the API
version_added: 2.1.0 version_added: 2.1.0
description: description:
- Allows to find entries for a path by conditions and modify the values of these entries. - Allows to find entries for a path by conditions and modify the values of these entries.
- Use the M(community.routeros.api_find_and_modify) module to set all entries of a path to specific values, or change multiple - Use the M(community.routeros.api_find_and_modify) module to set all entries of a path to specific values,
entries in different ways in one step. or change multiple entries in different ways in one step.
notes: notes:
- "If you want to change values based on their old values (like change all comments 'foo' to 'bar') and make sure that there - "If you want to change values based on their old values (like change all comments 'foo' to 'bar') and make sure that
are at least N such values, you can use O(require_matches_min=N) together with O(allow_no_matches=true). This will make there are at least N such values, you can use O(require_matches_min=N) together with O(allow_no_matches=true).
the module fail if there are less than N such entries, but not if there is no match. The latter case is needed for idempotency This will make the module fail if there are less than N such entries, but not if there is no match. The latter case
of the task: once the values have been changed, there should be no further match." is needed for idempotency of the task: once the values have been changed, there should be no further match."
extends_documentation_fragment: extends_documentation_fragment:
- community.routeros.api - community.routeros.api
- community.routeros.attributes - community.routeros.attributes
@ -35,8 +36,6 @@ attributes:
platform: platform:
support: full support: full
platforms: RouterOS platforms: RouterOS
idempotent:
support: full
options: options:
path: path:
description: description:
@ -75,30 +74,14 @@ options:
- Whether to allow that no match is found. - Whether to allow that no match is found.
- If not specified, this value is induced from whether O(require_matches_min) is 0 or larger. - If not specified, this value is induced from whether O(require_matches_min) is 0 or larger.
type: bool type: bool
ignore_dynamic:
description:
- Whether to ignore dynamic entries.
- By default, they are considered. If set to V(true), they are not considered.
- It is generally recommended to set this to V(true) unless when you really need to modify dynamic entries.
type: bool
default: false
version_added: 3.7.0
ignore_builtin:
description:
- Whether to ignore builtin entries.
- By default, they are considered. If set to V(true), they are not considered.
- It is generally recommended to set this to V(true) unless when you really need to modify builtin entries.
type: bool
default: false
version_added: 3.7.0
seealso: seealso:
- module: community.routeros.api - module: community.routeros.api
- module: community.routeros.api_facts - module: community.routeros.api_facts
- module: community.routeros.api_modify - module: community.routeros.api_modify
- module: community.routeros.api_info - module: community.routeros.api_info
""" '''
EXAMPLES = r""" EXAMPLES = '''
--- ---
- name: Rename bridge from 'bridge' to 'my-bridge' - name: Rename bridge from 'bridge' to 'my-bridge'
community.routeros.api_find_and_modify: community.routeros.api_find_and_modify:
@ -110,10 +93,6 @@ EXAMPLES = r"""
name: bridge name: bridge
values: values:
name: my-bridge name: my-bridge
# Always ignore dynamic and builtin entries
# (not relevant for this path, but generally recommended)
ignore_dynamic: true
ignore_builtin: true
- name: Change IP address to 192.168.1.1 for interface bridge - assuming there is only one - name: Change IP address to 192.168.1.1 for interface bridge - assuming there is only one
community.routeros.api_find_and_modify: community.routeros.api_find_and_modify:
@ -129,58 +108,55 @@ EXAMPLES = r"""
# exactly one is configured. # exactly one is configured.
require_matches_min: 1 require_matches_min: 1
require_matches_max: 1 require_matches_max: 1
# Always ignore dynamic and builtin entries '''
# (not relevant for this path, but generally recommended)
ignore_dynamic: true
ignore_builtin: true
"""
RETURN = r""" RETURN = '''
---
old_data: old_data:
description: description:
- A list of all elements for the current path before a change was made. - A list of all elements for the current path before a change was made.
sample: sample:
- '.id': '*1' - '.id': '*1'
actual-interface: bridge actual-interface: bridge
address: "192.168.88.1/24" address: "192.168.88.1/24"
comment: defconf comment: defconf
disabled: false disabled: false
dynamic: false dynamic: false
interface: bridge interface: bridge
invalid: false invalid: false
network: 192.168.88.0 network: 192.168.88.0
type: list type: list
elements: dict elements: dict
returned: success returned: success
new_data: new_data:
description: description:
- A list of all elements for the current path after a change was made. - A list of all elements for the current path after a change was made.
sample: sample:
- '.id': '*1' - '.id': '*1'
actual-interface: bridge actual-interface: bridge
address: "192.168.1.1/24" address: "192.168.1.1/24"
comment: awesome comment: awesome
disabled: false disabled: false
dynamic: false dynamic: false
interface: bridge interface: bridge
invalid: false invalid: false
network: 192.168.1.0 network: 192.168.1.0
type: list type: list
elements: dict elements: dict
returned: success returned: success
match_count: match_count:
description: description:
- The number of entries that matched the criteria in O(find). - The number of entries that matched the criteria in O(find).
sample: 1 sample: 1
type: int type: int
returned: success returned: success
modify__count: modify__count:
description: description:
- The number of entries that were modified. - The number of entries that were modified.
sample: 1 sample: 1
type: int type: int
returned: success returned: success
""" '''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
@ -209,17 +185,6 @@ def compose_api_path(api, path):
return api_path return api_path
def filter_entries(entries, ignore_dynamic=False, ignore_builtin=False):
result = []
for entry in entries:
if ignore_dynamic and entry.get('dynamic', False):
continue
if ignore_builtin and entry.get('builtin', False):
continue
result.append(entry)
return result
DISABLED_MEANS_EMPTY_STRING = ('comment', ) DISABLED_MEANS_EMPTY_STRING = ('comment', )
@ -231,8 +196,6 @@ def main():
require_matches_min=dict(type='int', default=0), require_matches_min=dict(type='int', default=0),
require_matches_max=dict(type='int'), require_matches_max=dict(type='int'),
allow_no_matches=dict(type='bool'), allow_no_matches=dict(type='bool'),
ignore_dynamic=dict(type='bool', default=False),
ignore_builtin=dict(type='bool', default=False),
) )
module_args.update(api_argument_spec()) module_args.update(api_argument_spec())
@ -260,9 +223,6 @@ def main():
if key in values: if key in values:
module.fail_json(msg='`values` must not contain both "{key}" and "!{key}"!'.format(key=key)) module.fail_json(msg='`values` must not contain both "{key}" and "!{key}"!'.format(key=key))
ignore_dynamic = module.params['ignore_dynamic']
ignore_builtin = module.params['ignore_builtin']
check_has_library(module) check_has_library(module)
api = create_api(module) api = create_api(module)
@ -270,7 +230,7 @@ def main():
api_path = compose_api_path(api, path) api_path = compose_api_path(api, path)
old_data = filter_entries(list(api_path), ignore_dynamic=ignore_dynamic, ignore_builtin=ignore_builtin) old_data = list(api_path)
new_data = [entry.copy() for entry in old_data] new_data = [entry.copy() for entry in old_data]
# Find matching entries # Find matching entries
@ -339,7 +299,7 @@ def main():
error=to_native(e), error=to_native(e),
) )
) )
new_data = filter_entries(list(api_path), ignore_dynamic=ignore_dynamic, ignore_builtin=ignore_builtin) new_data = list(api_path)
# Produce return value # Produce return value
more = {} more = {}

View file

@ -8,7 +8,8 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: api_info module: api_info
author: author:
- "Felix Fontein (@felixfontein)" - "Felix Fontein (@felixfontein)"
@ -17,18 +18,17 @@ version_added: 2.2.0
description: description:
- Allows to retrieve information for a path using the API. - Allows to retrieve information for a path using the API.
- This can be used to backup a path to restore it with the M(community.routeros.api_modify) module. - This can be used to backup a path to restore it with the M(community.routeros.api_modify) module.
- Entries are normalized, dynamic and builtin entries are not returned. Use the O(handle_disabled) and O(hide_defaults) - Entries are normalized, dynamic and builtin entries are not returned. Use the O(handle_disabled) and
options to control normalization, the O(include_dynamic) and O(include_builtin) options to also return dynamic resp. builtin O(hide_defaults) options to control normalization, the O(include_dynamic) and O(include_builtin) options to also return
entries, and use O(unfiltered) to return all fields including counters. dynamic resp. builtin entries, and use O(unfiltered) to return all fields including counters.
- B(Note) that this module is still heavily in development, and only supports B(some) paths. If you want to support new - B(Note) that this module is still heavily in development, and only supports B(some) paths.
paths, or think you found problems with existing paths, please first L(create an issue in the community.routeros Issue If you want to support new paths, or think you found problems with existing paths, please first
Tracker,https://github.com/ansible-collections/community.routeros/issues/). L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/).
extends_documentation_fragment: extends_documentation_fragment:
- community.routeros.api - community.routeros.api
- community.routeros.api.restrict - community.routeros.api.restrict
- community.routeros.attributes - community.routeros.attributes
- community.routeros.attributes.actiongroup_api - community.routeros.attributes.actiongroup_api
- community.routeros.attributes.idempotent_not_modify_state
- community.routeros.attributes.info_module - community.routeros.attributes.info_module
attributes: attributes:
platform: platform:
@ -43,232 +43,224 @@ options:
type: str type: str
choices: choices:
# BEGIN PATH LIST # BEGIN PATH LIST
- caps-man aaa - caps-man aaa
- caps-man access-list - caps-man access-list
- caps-man channel - caps-man channel
- caps-man configuration - caps-man configuration
- caps-man datapath - caps-man datapath
- caps-man manager - caps-man manager
- caps-man manager interface - caps-man manager interface
- caps-man provisioning - caps-man provisioning
- caps-man security - caps-man security
- certificate settings - certificate settings
- interface 6to4 - interface bonding
- interface bonding - interface bridge
- interface bridge - interface bridge mlag
- interface bridge mlag - interface bridge port
- interface bridge port - interface bridge port-controller
- interface bridge port-controller - interface bridge port-extender
- interface bridge port-extender - interface bridge settings
- interface bridge settings - interface bridge vlan
- interface bridge vlan - interface detect-internet
- interface detect-internet - interface eoip
- interface eoip - interface ethernet
- interface ethernet - interface ethernet poe
- interface ethernet poe - interface ethernet switch
- interface ethernet switch - interface ethernet switch port
- interface ethernet switch port - interface gre
- interface ethernet switch port-isolation - interface gre6
- interface gre - interface l2tp-client
- interface gre6 - interface l2tp-server server
- interface l2tp-client - interface list
- interface l2tp-server server - interface list member
- interface list - interface ovpn-client
- interface list member - interface ovpn-server server
- interface ovpn-client - interface ppp-client
- interface ovpn-server server - interface pppoe-client
- interface ppp-client - interface pppoe-server server
- interface pppoe-client - interface pptp-server server
- interface pppoe-server server - interface sstp-server server
- interface pptp-server server - interface vlan
- interface sstp-server server - interface vrrp
- interface vlan - interface wifi
- interface vrrp - interface wifi aaa
- interface wifi - interface wifi access-list
- interface wifi aaa - interface wifi cap
- interface wifi access-list - interface wifi capsman
- interface wifi cap - interface wifi channel
- interface wifi capsman - interface wifi configuration
- interface wifi channel - interface wifi datapath
- interface wifi configuration - interface wifi interworking
- interface wifi datapath - interface wifi provisioning
- interface wifi interworking - interface wifi security
- interface wifi provisioning - interface wifi steering
- interface wifi security - interface wifiwave2
- interface wifi steering - interface wifiwave2 aaa
- interface wifiwave2 - interface wifiwave2 access-list
- interface wifiwave2 aaa - interface wifiwave2 cap
- interface wifiwave2 access-list - interface wifiwave2 capsman
- interface wifiwave2 cap - interface wifiwave2 channel
- interface wifiwave2 capsman - interface wifiwave2 configuration
- interface wifiwave2 channel - interface wifiwave2 datapath
- interface wifiwave2 configuration - interface wifiwave2 interworking
- interface wifiwave2 datapath - interface wifiwave2 provisioning
- interface wifiwave2 interworking - interface wifiwave2 security
- interface wifiwave2 provisioning - interface wifiwave2 steering
- interface wifiwave2 security - interface wireguard
- interface wifiwave2 steering - interface wireguard peers
- interface wireguard - interface wireless
- interface wireguard peers - interface wireless align
- interface wireless - interface wireless cap
- interface wireless access-list - interface wireless security-profiles
- interface wireless align - interface wireless sniffer
- interface wireless cap - interface wireless snooper
- interface wireless connect-list - iot modbus
- interface wireless security-profiles - ip accounting
- interface wireless sniffer - ip accounting web-access
- interface wireless snooper - ip address
- iot modbus - ip arp
- ip accounting - ip cloud
- ip accounting web-access - ip cloud advanced
- ip address - ip dhcp-client
- ip arp - ip dhcp-client option
- ip cloud - ip dhcp-relay
- ip cloud advanced - ip dhcp-server
- ip dhcp-client - ip dhcp-server config
- ip dhcp-client option - ip dhcp-server lease
- ip dhcp-relay - ip dhcp-server matcher
- ip dhcp-server - ip dhcp-server network
- ip dhcp-server config - ip dhcp-server option
- ip dhcp-server lease - ip dhcp-server option sets
- ip dhcp-server matcher - ip dns
- ip dhcp-server network - ip dns adlist
- ip dhcp-server option - ip dns static
- ip dhcp-server option sets - ip firewall address-list
- ip dns - ip firewall connection tracking
- ip dns adlist - ip firewall filter
- ip dns forwarders - ip firewall layer7-protocol
- ip dns static - ip firewall mangle
- ip firewall address-list - ip firewall nat
- ip firewall connection tracking - ip firewall raw
- ip firewall filter - ip firewall service-port
- ip firewall layer7-protocol - ip hotspot service-port
- ip firewall mangle - ip ipsec identity
- ip firewall nat - ip ipsec peer
- ip firewall raw - ip ipsec policy
- ip firewall service-port - ip ipsec profile
- ip hotspot service-port - ip ipsec proposal
- ip ipsec identity - ip ipsec settings
- ip ipsec mode-config - ip neighbor discovery-settings
- ip ipsec peer - ip pool
- ip ipsec policy - ip proxy
- ip ipsec profile - ip route
- ip ipsec proposal - ip route rule
- ip ipsec settings - ip route vrf
- ip neighbor discovery-settings - ip service
- ip pool - ip settings
- ip proxy - ip smb
- ip route - ip socks
- ip route rule - ip ssh
- ip route vrf - ip tftp settings
- ip service - ip traffic-flow
- ip settings - ip traffic-flow ipfix
- ip smb - ip traffic-flow target
- ip socks - ip upnp
- ip ssh - ip upnp interfaces
- ip tftp settings - ip vrf
- ip traffic-flow - ipv6 address
- ip traffic-flow ipfix - ipv6 dhcp-client
- ip traffic-flow target - ipv6 dhcp-server
- ip upnp - ipv6 dhcp-server option
- ip upnp interfaces - ipv6 firewall address-list
- ip vrf - ipv6 firewall filter
- ipv6 address - ipv6 firewall mangle
- ipv6 dhcp-client - ipv6 firewall nat
- ipv6 dhcp-server - ipv6 firewall raw
- ipv6 dhcp-server option - ipv6 nd
- ipv6 firewall address-list - ipv6 nd prefix
- ipv6 firewall filter - ipv6 nd prefix default
- ipv6 firewall mangle - ipv6 route
- ipv6 firewall nat - ipv6 settings
- ipv6 firewall raw - mpls
- ipv6 nd - mpls interface
- ipv6 nd prefix - mpls ldp
- ipv6 nd prefix default - mpls ldp accept-filter
- ipv6 route - mpls ldp advertise-filter
- ipv6 settings - mpls ldp interface
- mpls - port firmware
- mpls interface - port remote-access
- mpls ldp - ppp aaa
- mpls ldp accept-filter - ppp profile
- mpls ldp advertise-filter - ppp secret
- mpls ldp interface - queue interface
- port firmware - queue simple
- port remote-access - queue tree
- ppp aaa - queue type
- ppp profile - radius
- ppp secret - radius incoming
- queue interface - routing bgp aggregate
- queue simple - routing bgp connection
- queue tree - routing bgp instance
- queue type - routing bgp network
- radius - routing bgp peer
- radius incoming - routing bgp template
- routing bfd configuration - routing filter
- routing bgp aggregate - routing filter num-list
- routing bgp connection - routing filter rule
- routing bgp instance - routing filter select-rule
- routing bgp network - routing id
- routing bgp peer - routing igmp-proxy
- routing bgp template - routing igmp-proxy interface
- routing filter - routing mme
- routing filter community-list - routing ospf area
- routing filter num-list - routing ospf area range
- routing filter rule - routing ospf instance
- routing filter select-rule - routing ospf interface-template
- routing id - routing ospf static-neighbor
- routing igmp-proxy - routing pimsm instance
- routing igmp-proxy interface - routing pimsm interface-template
- routing mme - routing rip
- routing ospf area - routing ripng
- routing ospf area range - routing rule
- routing ospf instance - routing table
- routing ospf interface-template - snmp
- routing ospf static-neighbor - snmp community
- routing pimsm instance - system clock
- routing pimsm interface-template - system clock manual
- routing rip - system health settings
- routing ripng - system identity
- routing rule - system leds settings
- routing table - system logging
- snmp - system logging action
- snmp community - system note
- system clock - system ntp client
- system clock manual - system ntp client servers
- system health settings - system ntp server
- system identity - system package update
- system leds settings - system resource irq rps
- system logging - system routerboard settings
- system logging action - system scheduler
- system note - system script
- system ntp client - system upgrade mirror
- system ntp client servers - system ups
- system ntp server - system watchdog
- system package update - tool bandwidth-server
- system resource irq rps - tool e-mail
- system routerboard settings - tool graphing
- system scheduler - tool graphing interface
- system script - tool graphing resource
- system upgrade mirror - tool mac-server
- system ups - tool mac-server mac-winbox
- system watchdog - tool mac-server ping
- tool bandwidth-server - tool netwatch
- tool e-mail - tool romon
- tool graphing - tool sms
- tool graphing interface - tool sniffer
- tool graphing resource - tool traffic-generator
- tool mac-server - user
- tool mac-server mac-winbox - user aaa
- tool mac-server ping - user group
- tool netwatch - user settings
- tool romon
- tool sms
- tool sniffer
- tool traffic-generator
- user
- user aaa
- user group
- user settings
# END PATH LIST # END PATH LIST
unfiltered: unfiltered:
description: description:
@ -324,9 +316,9 @@ seealso:
- module: community.routeros.api_facts - module: community.routeros.api_facts
- module: community.routeros.api_find_and_modify - module: community.routeros.api_find_and_modify
- module: community.routeros.api_modify - module: community.routeros.api_modify
""" '''
EXAMPLES = r""" EXAMPLES = '''
--- ---
- name: Get IP addresses - name: Get IP addresses
community.routeros.api_info: community.routeros.api_info:
@ -351,25 +343,26 @@ EXAMPLES = r"""
- name: Print data for IP addresses - name: Print data for IP addresses
ansible.builtin.debug: ansible.builtin.debug:
var: ip_addresses.result var: ip_addresses.result
""" '''
RETURN = r""" RETURN = '''
---
result: result:
description: A list of all elements for the current path. description: A list of all elements for the current path.
sample: sample:
- '.id': '*1' - '.id': '*1'
actual-interface: bridge actual-interface: bridge
address: "192.168.88.1/24" address: "192.168.88.1/24"
comment: defconf comment: defconf
disabled: false disabled: false
dynamic: false dynamic: false
interface: bridge interface: bridge
invalid: false invalid: false
network: 192.168.88.0 network: 192.168.88.0
type: list type: list
elements: dict elements: dict
returned: always returned: always
""" '''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native

View file

@ -8,7 +8,8 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: api_modify module: api_modify
author: author:
- "Felix Fontein (@felixfontein)" - "Felix Fontein (@felixfontein)"
@ -16,17 +17,17 @@ short_description: Modify data at paths with API
version_added: 2.2.0 version_added: 2.2.0
description: description:
- Allows to modify information for a path using the API. - Allows to modify information for a path using the API.
- Use the M(community.routeros.api_find_and_modify) module to modify one or multiple entries in a controlled way depending - Use the M(community.routeros.api_find_and_modify) module to modify one or multiple entries in a controlled way
on some search conditions. depending on some search conditions.
- To make a backup of a path that can be restored with this module, use the M(community.routeros.api_info) module. - To make a backup of a path that can be restored with this module, use the M(community.routeros.api_info) module.
- The module ignores dynamic and builtin entries. - The module ignores dynamic and builtin entries.
- B(Note) that this module is still heavily in development, and only supports B(some) paths. If you want to support new - B(Note) that this module is still heavily in development, and only supports B(some) paths.
paths, or think you found problems with existing paths, please first L(create an issue in the community.routeros Issue If you want to support new paths, or think you found problems with existing paths, please first
Tracker,https://github.com/ansible-collections/community.routeros/issues/). L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/).
notes: notes:
- If write-only fields are present in the path, the module is B(not idempotent) in a strict sense, since it is not able - If write-only fields are present in the path, the module is B(not idempotent) in a strict sense,
to verify the current value of these fields. The behavior the module should assume can be controlled with the O(handle_write_only) since it is not able to verify the current value of these fields. The behavior the module should
option. assume can be controlled with the O(handle_write_only) option.
requirements: requirements:
- Needs L(ordereddict,https://pypi.org/project/ordereddict) for Python 2.6 - Needs L(ordereddict,https://pypi.org/project/ordereddict) for Python 2.6
extends_documentation_fragment: extends_documentation_fragment:
@ -42,244 +43,233 @@ attributes:
platform: platform:
support: full support: full
platforms: RouterOS platforms: RouterOS
idempotent:
support: full
options: options:
path: path:
description: description:
- Path to query. - Path to query.
- An example value is V(ip address). This is equivalent to running modification commands in C(/ip address) in the RouterOS - An example value is V(ip address). This is equivalent to running modification commands in C(/ip address) in the RouterOS CLI.
CLI.
required: true required: true
type: str type: str
choices: choices:
# BEGIN PATH LIST # BEGIN PATH LIST
- caps-man aaa - caps-man aaa
- caps-man access-list - caps-man access-list
- caps-man channel - caps-man channel
- caps-man configuration - caps-man configuration
- caps-man datapath - caps-man datapath
- caps-man manager - caps-man manager
- caps-man manager interface - caps-man manager interface
- caps-man provisioning - caps-man provisioning
- caps-man security - caps-man security
- certificate settings - certificate settings
- interface 6to4 - interface bonding
- interface bonding - interface bridge
- interface bridge - interface bridge mlag
- interface bridge mlag - interface bridge port
- interface bridge port - interface bridge port-controller
- interface bridge port-controller - interface bridge port-extender
- interface bridge port-extender - interface bridge settings
- interface bridge settings - interface bridge vlan
- interface bridge vlan - interface detect-internet
- interface detect-internet - interface eoip
- interface eoip - interface ethernet
- interface ethernet - interface ethernet poe
- interface ethernet poe - interface ethernet switch
- interface ethernet switch - interface ethernet switch port
- interface ethernet switch port - interface gre
- interface ethernet switch port-isolation - interface gre6
- interface gre - interface l2tp-client
- interface gre6 - interface l2tp-server server
- interface l2tp-client - interface list
- interface l2tp-server server - interface list member
- interface list - interface ovpn-client
- interface list member - interface ovpn-server server
- interface ovpn-client - interface ppp-client
- interface ovpn-server server - interface pppoe-client
- interface ppp-client - interface pppoe-server server
- interface pppoe-client - interface pptp-server server
- interface pppoe-server server - interface sstp-server server
- interface pptp-server server - interface vlan
- interface sstp-server server - interface vrrp
- interface vlan - interface wifi
- interface vrrp - interface wifi aaa
- interface wifi - interface wifi access-list
- interface wifi aaa - interface wifi cap
- interface wifi access-list - interface wifi capsman
- interface wifi cap - interface wifi channel
- interface wifi capsman - interface wifi configuration
- interface wifi channel - interface wifi datapath
- interface wifi configuration - interface wifi interworking
- interface wifi datapath - interface wifi provisioning
- interface wifi interworking - interface wifi security
- interface wifi provisioning - interface wifi steering
- interface wifi security - interface wifiwave2
- interface wifi steering - interface wifiwave2 aaa
- interface wifiwave2 - interface wifiwave2 access-list
- interface wifiwave2 aaa - interface wifiwave2 cap
- interface wifiwave2 access-list - interface wifiwave2 capsman
- interface wifiwave2 cap - interface wifiwave2 channel
- interface wifiwave2 capsman - interface wifiwave2 configuration
- interface wifiwave2 channel - interface wifiwave2 datapath
- interface wifiwave2 configuration - interface wifiwave2 interworking
- interface wifiwave2 datapath - interface wifiwave2 provisioning
- interface wifiwave2 interworking - interface wifiwave2 security
- interface wifiwave2 provisioning - interface wifiwave2 steering
- interface wifiwave2 security - interface wireguard
- interface wifiwave2 steering - interface wireguard peers
- interface wireguard - interface wireless
- interface wireguard peers - interface wireless align
- interface wireless - interface wireless cap
- interface wireless access-list - interface wireless security-profiles
- interface wireless align - interface wireless sniffer
- interface wireless cap - interface wireless snooper
- interface wireless connect-list - iot modbus
- interface wireless security-profiles - ip accounting
- interface wireless sniffer - ip accounting web-access
- interface wireless snooper - ip address
- iot modbus - ip arp
- ip accounting - ip cloud
- ip accounting web-access - ip cloud advanced
- ip address - ip dhcp-client
- ip arp - ip dhcp-client option
- ip cloud - ip dhcp-relay
- ip cloud advanced - ip dhcp-server
- ip dhcp-client - ip dhcp-server config
- ip dhcp-client option - ip dhcp-server lease
- ip dhcp-relay - ip dhcp-server matcher
- ip dhcp-server - ip dhcp-server network
- ip dhcp-server config - ip dhcp-server option
- ip dhcp-server lease - ip dhcp-server option sets
- ip dhcp-server matcher - ip dns
- ip dhcp-server network - ip dns adlist
- ip dhcp-server option - ip dns static
- ip dhcp-server option sets - ip firewall address-list
- ip dns - ip firewall connection tracking
- ip dns adlist - ip firewall filter
- ip dns forwarders - ip firewall layer7-protocol
- ip dns static - ip firewall mangle
- ip firewall address-list - ip firewall nat
- ip firewall connection tracking - ip firewall raw
- ip firewall filter - ip firewall service-port
- ip firewall layer7-protocol - ip hotspot service-port
- ip firewall mangle - ip ipsec identity
- ip firewall nat - ip ipsec peer
- ip firewall raw - ip ipsec policy
- ip firewall service-port - ip ipsec profile
- ip hotspot service-port - ip ipsec proposal
- ip ipsec identity - ip ipsec settings
- ip ipsec mode-config - ip neighbor discovery-settings
- ip ipsec peer - ip pool
- ip ipsec policy - ip proxy
- ip ipsec profile - ip route
- ip ipsec proposal - ip route rule
- ip ipsec settings - ip route vrf
- ip neighbor discovery-settings - ip service
- ip pool - ip settings
- ip proxy - ip smb
- ip route - ip socks
- ip route rule - ip ssh
- ip route vrf - ip tftp settings
- ip service - ip traffic-flow
- ip settings - ip traffic-flow ipfix
- ip smb - ip traffic-flow target
- ip socks - ip upnp
- ip ssh - ip upnp interfaces
- ip tftp settings - ip vrf
- ip traffic-flow - ipv6 address
- ip traffic-flow ipfix - ipv6 dhcp-client
- ip traffic-flow target - ipv6 dhcp-server
- ip upnp - ipv6 dhcp-server option
- ip upnp interfaces - ipv6 firewall address-list
- ip vrf - ipv6 firewall filter
- ipv6 address - ipv6 firewall mangle
- ipv6 dhcp-client - ipv6 firewall nat
- ipv6 dhcp-server - ipv6 firewall raw
- ipv6 dhcp-server option - ipv6 nd
- ipv6 firewall address-list - ipv6 nd prefix
- ipv6 firewall filter - ipv6 nd prefix default
- ipv6 firewall mangle - ipv6 route
- ipv6 firewall nat - ipv6 settings
- ipv6 firewall raw - mpls
- ipv6 nd - mpls interface
- ipv6 nd prefix - mpls ldp
- ipv6 nd prefix default - mpls ldp accept-filter
- ipv6 route - mpls ldp advertise-filter
- ipv6 settings - mpls ldp interface
- mpls - port firmware
- mpls interface - port remote-access
- mpls ldp - ppp aaa
- mpls ldp accept-filter - ppp profile
- mpls ldp advertise-filter - ppp secret
- mpls ldp interface - queue interface
- port firmware - queue simple
- port remote-access - queue tree
- ppp aaa - queue type
- ppp profile - radius
- ppp secret - radius incoming
- queue interface - routing bgp aggregate
- queue simple - routing bgp connection
- queue tree - routing bgp instance
- queue type - routing bgp network
- radius - routing bgp peer
- radius incoming - routing bgp template
- routing bfd configuration - routing filter
- routing bgp aggregate - routing filter num-list
- routing bgp connection - routing filter rule
- routing bgp instance - routing filter select-rule
- routing bgp network - routing id
- routing bgp peer - routing igmp-proxy
- routing bgp template - routing igmp-proxy interface
- routing filter - routing mme
- routing filter community-list - routing ospf area
- routing filter num-list - routing ospf area range
- routing filter rule - routing ospf instance
- routing filter select-rule - routing ospf interface-template
- routing id - routing ospf static-neighbor
- routing igmp-proxy - routing pimsm instance
- routing igmp-proxy interface - routing pimsm interface-template
- routing mme - routing rip
- routing ospf area - routing ripng
- routing ospf area range - routing rule
- routing ospf instance - routing table
- routing ospf interface-template - snmp
- routing ospf static-neighbor - snmp community
- routing pimsm instance - system clock
- routing pimsm interface-template - system clock manual
- routing rip - system health settings
- routing ripng - system identity
- routing rule - system leds settings
- routing table - system logging
- snmp - system logging action
- snmp community - system note
- system clock - system ntp client
- system clock manual - system ntp client servers
- system health settings - system ntp server
- system identity - system package update
- system leds settings - system resource irq rps
- system logging - system routerboard settings
- system logging action - system scheduler
- system note - system script
- system ntp client - system upgrade mirror
- system ntp client servers - system ups
- system ntp server - system watchdog
- system package update - tool bandwidth-server
- system resource irq rps - tool e-mail
- system routerboard settings - tool graphing
- system scheduler - tool graphing interface
- system script - tool graphing resource
- system upgrade mirror - tool mac-server
- system ups - tool mac-server mac-winbox
- system watchdog - tool mac-server ping
- tool bandwidth-server - tool netwatch
- tool e-mail - tool romon
- tool graphing - tool sms
- tool graphing interface - tool sniffer
- tool graphing resource - tool traffic-generator
- tool mac-server - user
- tool mac-server mac-winbox - user aaa
- tool mac-server ping - user group
- tool netwatch - user settings
- tool romon
- tool sms
- tool sniffer
- tool traffic-generator
- user
- user aaa
- user group
- user settings
# END PATH LIST # END PATH LIST
data: data:
description: description:
@ -307,12 +297,12 @@ options:
default: ignore default: ignore
handle_entries_content: handle_entries_content:
description: description:
- For a single entry in O(data), this describes how to handle fields that are not mentioned in that entry, but appear - For a single entry in O(data), this describes how to handle fields that are not mentioned
in the actual config. in that entry, but appear in the actual config.
- If V(ignore), they are not modified. - If V(ignore), they are not modified.
- If V(remove), they are removed. If at least one cannot be removed, the module will fail. - If V(remove), they are removed. If at least one cannot be removed, the module will fail.
- If V(remove_as_much_as_possible), all that can be removed will be removed. The ones that cannot be removed will be - If V(remove_as_much_as_possible), all that can be removed will be removed. The ones that
kept. cannot be removed will be kept.
- Note that V(remove) and V(remove_as_much_as_possible) do not apply to write-only fields. - Note that V(remove) and V(remove_as_much_as_possible) do not apply to write-only fields.
type: str type: str
choices: choices:
@ -324,8 +314,8 @@ options:
description: description:
- How to handle values passed in for read-only fields. - How to handle values passed in for read-only fields.
- If V(ignore), they are not passed to the API. - If V(ignore), they are not passed to the API.
- If V(validate), the values are not passed for creation, and for updating they are compared to the value returned for - If V(validate), the values are not passed for creation, and for updating they are compared to the value returned for the object.
the object. If they differ, the module fails. If they differ, the module fails.
- If V(error), the module will fail if read-only fields are provided. - If V(error), the module will fail if read-only fields are provided.
type: str type: str
choices: choices:
@ -338,8 +328,9 @@ options:
description: description:
- How to handle values passed in for write-only fields. - How to handle values passed in for write-only fields.
- If V(create_only), they are passed on creation, and ignored for updating. - If V(create_only), they are passed on creation, and ignored for updating.
- If V(always_update), they are always passed to the API. This means that if such a value is present, the module will - If V(always_update), they are always passed to the API. This means that if such a value is present,
always result in C(changed) since there is no way to validate whether the value actually changed. the module will always result in C(changed) since there is no way to validate whether the value
actually changed.
- If V(error), the module will fail if write-only fields are provided. - If V(error), the module will fail if write-only fields are provided.
type: str type: str
choices: choices:
@ -351,18 +342,20 @@ options:
restrict: restrict:
description: description:
- Restrict operation to entries matching the following criteria. - Restrict operation to entries matching the following criteria.
- This can be useful together with O(handle_absent_entries=remove) to operate on a subset of the values. - This can be useful together with O(handle_absent_entries=remove) to operate on a subset of
- For example, for O(path=ip firewall filter), you can set O(restrict[].field=chain) and O(restrict[].values=input) the values.
to restrict operation to the input chain, and ignore the forward and output chains. - For example, for O(path=ip firewall filter), you can set O(restrict[].field=chain) and
O(restrict[].values=input) to restrict operation to the input chain, and ignore the
forward and output chains.
version_added: 2.18.0 version_added: 2.18.0
seealso: seealso:
- module: community.routeros.api - module: community.routeros.api
- module: community.routeros.api_facts - module: community.routeros.api_facts
- module: community.routeros.api_find_and_modify - module: community.routeros.api_find_and_modify
- module: community.routeros.api_info - module: community.routeros.api_info
""" '''
EXAMPLES = r""" EXAMPLES = '''
--- ---
- name: Setup DHCP server networks - name: Setup DHCP server networks
# Ensures that we have exactly two DHCP server networks (in the specified order) # Ensures that we have exactly two DHCP server networks (in the specified order)
@ -417,42 +410,43 @@ EXAMPLES = r"""
data: data:
- action: drop - action: drop
chain: input chain: input
""" '''
RETURN = r""" RETURN = '''
---
old_data: old_data:
description: description:
- A list of all elements for the current path before a change was made. - A list of all elements for the current path before a change was made.
sample: sample:
- '.id': '*1' - '.id': '*1'
actual-interface: bridge actual-interface: bridge
address: "192.168.88.1/24" address: "192.168.88.1/24"
comment: defconf comment: defconf
disabled: false disabled: false
dynamic: false dynamic: false
interface: bridge interface: bridge
invalid: false invalid: false
network: 192.168.88.0 network: 192.168.88.0
type: list type: list
elements: dict elements: dict
returned: always returned: always
new_data: new_data:
description: description:
- A list of all elements for the current path after a change was made. - A list of all elements for the current path after a change was made.
sample: sample:
- '.id': '*1' - '.id': '*1'
actual-interface: bridge actual-interface: bridge
address: "192.168.1.1/24" address: "192.168.1.1/24"
comment: awesome comment: awesome
disabled: false disabled: false
dynamic: false dynamic: false
interface: bridge interface: bridge
invalid: false invalid: false
network: 192.168.1.0 network: 192.168.1.0
type: list type: list
elements: dict elements: dict
returned: always returned: always
""" '''
from collections import defaultdict from collections import defaultdict

View file

@ -7,77 +7,89 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: command module: command
author: "Egor Zaitsev (@heuels)" author: "Egor Zaitsev (@heuels)"
short_description: Run commands on remote devices running MikroTik RouterOS short_description: Run commands on remote devices running MikroTik RouterOS
description: description:
- Sends arbitrary commands to an RouterOS node and returns the results read from the device. This module includes an argument - Sends arbitrary commands to an RouterOS node and returns the results
that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. read from the device. This module includes an
- The module always indicates a (changed) status. You can use R(the changed_when task property,override_the_changed_result) argument that will cause the module to wait for a specific condition
to determine whether a command task actually resulted in a change or not. before returning or timing out if the condition is not met.
- The module always indicates a (changed) status. You can use
R(the changed_when task property,override_the_changed_result) to determine
whether a command task actually resulted in a change or not.
notes:
- The module declares that it B(supports check mode). This is a bug and will
be changed in community.routeros 3.0.0.
extends_documentation_fragment: extends_documentation_fragment:
- community.routeros.attributes - community.routeros.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: partial
details: details:
- Before community.routeros 3.0.0, the module claimed to support check mode. It simply executed the command in check - The module claims to support check mode, but it simply always executes the command.
mode.
diff_mode: diff_mode:
support: none support: none
platform: platform:
support: full support: full
platforms: RouterOS platforms: RouterOS
idempotent:
support: N/A
details:
- Whether the executed command is idempotent depends on the command.
options: options:
commands: commands:
description: description:
- List of commands to send to the remote RouterOS device over the configured provider. The resulting output from the - List of commands to send to the remote RouterOS device over the
command is returned. If the O(wait_for) argument is provided, the module is not returned until the condition is satisfied configured provider. The resulting output from the command
or the number of retries has expired. is returned. If the O(wait_for) argument is provided, the
module is not returned until the condition is satisfied or
the number of retries has expired.
required: true required: true
type: list type: list
elements: str elements: str
wait_for: wait_for:
description: description:
- List of conditions to evaluate against the output of the command. The task will wait for each condition to be true - List of conditions to evaluate against the output of the
before moving forward. If the conditional is not true within the configured number of retries, the task fails. See command. The task will wait for each condition to be true
examples. before moving forward. If the conditional is not true
within the configured number of retries, the task fails.
See examples.
type: list type: list
elements: str elements: str
match: match:
description: description:
- The O(match) argument is used in conjunction with the O(wait_for) argument to specify the match policy. Valid values - The O(match) argument is used in conjunction with the
are V(all) or V(any). If the value is set to V(all) then all conditionals in the wait_for must be satisfied. If the O(wait_for) argument to specify the match policy. Valid
value is set to V(any) then only one of the values must be satisfied. values are V(all) or V(any). If the value is set to V(all)
then all conditionals in the wait_for must be satisfied. If
the value is set to V(any) then only one of the values must be
satisfied.
default: all default: all
choices: ['any', 'all'] choices: ['any', 'all']
type: str type: str
retries: retries:
description: description:
- Specifies the number of retries a command should by tried before it is considered failed. The command is run on the - Specifies the number of retries a command should by tried
target device every retry and evaluated against the O(wait_for) conditions. before it is considered failed. The command is run on the
target device every retry and evaluated against the
O(wait_for) conditions.
default: 10 default: 10
type: int type: int
interval: interval:
description: description:
- Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified - Configures the interval in seconds to wait between retries
conditions, the interval indicates how long to wait before trying the command again. of the command. If the command does not pass the specified
conditions, the interval indicates how long to wait before
trying the command again.
default: 1 default: 1
type: int type: int
seealso: seealso:
- ref: ansible_collections.community.routeros.docsite.ssh-guide - ref: ansible_collections.community.routeros.docsite.ssh-guide
description: How to connect to RouterOS devices with SSH. description: How to connect to RouterOS devices with SSH
- ref: ansible_collections.community.routeros.docsite.quoting - ref: ansible_collections.community.routeros.docsite.quoting
description: How to quote and unquote commands and arguments. description: How to quote and unquote commands and arguments
""" '''
EXAMPLES = r""" EXAMPLES = """
---
- name: Run command on remote devices - name: Run command on remote devices
community.routeros.command: community.routeros.command:
commands: /system routerboard print commands: /system routerboard print
@ -103,19 +115,19 @@ EXAMPLES = r"""
- result[1] contains ether1 - result[1] contains ether1
""" """
RETURN = r""" RETURN = """
stdout: stdout:
description: The set of responses from the commands. description: The set of responses from the commands
returned: always apart from low level errors (such as action plugin) returned: always apart from low level errors (such as action plugin)
type: list type: list
sample: ['...', '...'] sample: ['...', '...']
stdout_lines: stdout_lines:
description: The value of stdout split into a list. description: The value of stdout split into a list
returned: always apart from low level errors (such as action plugin) returned: always apart from low level errors (such as action plugin)
type: list type: list
sample: [['...', '...'], ['...'], ['...']] sample: [['...', '...'], ['...'], ['...']]
failed_conditions: failed_conditions:
description: The list of conditionals that have failed. description: The list of conditionals that have failed
returned: failed returned: failed
type: list type: list
sample: ['...', '...'] sample: ['...', '...']
@ -153,7 +165,7 @@ def main():
argument_spec.update(routeros_argument_spec) argument_spec.update(routeros_argument_spec)
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
supports_check_mode=False) supports_check_mode=True)
result = {'changed': False} result = {'changed': False}

View file

@ -7,19 +7,21 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = '''
---
module: facts module: facts
author: "Egor Zaitsev (@heuels)" author: "Egor Zaitsev (@heuels)"
short_description: Collect facts from remote devices running MikroTik RouterOS short_description: Collect facts from remote devices running MikroTik RouterOS
description: description:
- Collects a base set of device facts from a remote device that is running RouterOS. This module prepends all of the base - Collects a base set of device facts from a remote device that
network fact keys with C(ansible_net_<fact>). The facts module will always collect a base set of facts from the device is running RouterOS. This module prepends all of the
base network fact keys with C(ansible_net_<fact>). The facts
module will always collect a base set of facts from the device
and can enable or disable collection of additional facts. and can enable or disable collection of additional facts.
extends_documentation_fragment: extends_documentation_fragment:
- community.routeros.attributes - community.routeros.attributes
- community.routeros.attributes.facts - community.routeros.attributes.facts
- community.routeros.attributes.facts_module - community.routeros.attributes.facts_module
- community.routeros.attributes.idempotent_not_modify_state
attributes: attributes:
platform: platform:
support: full support: full
@ -27,10 +29,12 @@ attributes:
options: options:
gather_subset: gather_subset:
description: description:
- When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument - When supplied, this argument will restrict the facts collected
include V(all), V(hardware), V(config), V(interfaces), and V(routing). to a given subset. Possible values for this argument include
- Can specify a list of values to include a larger subset. Values can also be used with an initial V(!) to specify that V(all), V(hardware), V(config), V(interfaces), and V(routing).
a specific subset should not be collected. - Can specify a list of values to include a larger subset.
Values can also be used with an initial V(!) to specify that a
specific subset should not be collected.
required: false required: false
default: default:
- '!config' - '!config'
@ -38,11 +42,10 @@ options:
elements: str elements: str
seealso: seealso:
- ref: ansible_collections.community.routeros.docsite.ssh-guide - ref: ansible_collections.community.routeros.docsite.ssh-guide
description: How to connect to RouterOS devices with SSH. description: How to connect to RouterOS devices with SSH
""" '''
EXAMPLES = r""" EXAMPLES = """
---
- name: Collect all facts from the device - name: Collect all facts from the device
community.routeros.facts: community.routeros.facts:
gather_subset: all gather_subset: all
@ -58,7 +61,7 @@ EXAMPLES = r"""
- "!hardware" - "!hardware"
""" """
RETURN = r""" RETURN = """
ansible_facts: ansible_facts:
description: "Dictionary of IP geolocation facts for a host's IP address." description: "Dictionary of IP geolocation facts for a host's IP address."
returned: always returned: always
@ -126,9 +129,9 @@ ansible_facts:
ansible_net_config_nonverbose: ansible_net_config_nonverbose:
description: description:
- The current active config from the device in minimal form. - The current active config from the device in minimal form.
- This value is idempotent in the sense that if the facts module is run twice and the device's config was not changed - This value is idempotent in the sense that if the facts module is run twice and the device's config
between the runs, the value is identical. This is achieved by running C(/export) and stripping the timestamp from was not changed between the runs, the value is identical. This is achieved by running C(/export)
the comment in the first line. and stripping the timestamp from the comment in the first line.
returned: O(gather_subset) contains V(config) returned: O(gather_subset) contains V(config)
type: str type: str
version_added: 1.2.0 version_added: 1.2.0
@ -589,6 +592,8 @@ FACT_SUBSETS = dict(
VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) VALID_SUBSETS = frozenset(FACT_SUBSETS.keys())
warnings = list()
def main(): def main():
"""main entry point for module execution """main entry point for module execution
@ -651,7 +656,7 @@ def main():
key = 'ansible_net_%s' % key key = 'ansible_net_%s' % key
ansible_facts[key] = value ansible_facts[key] = value
module.exit_json(ansible_facts=ansible_facts) module.exit_json(ansible_facts=ansible_facts, warnings=warnings)
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -31,9 +31,7 @@ class TerminalModule(TerminalBase):
terminal_stdout_re = [ terminal_stdout_re = [
re.compile(br"\x1b<"), re.compile(br"\x1b<"),
re.compile( re.compile(br"\[[\w\-\.]+\@[\w\s\-\.\/]+\] ?(<SAFE)?> ?$"),
br"((\[[\w\-\.]+\@)|(\r\<(([\w\-\.]*\@)|)))"
br"[\w\s\-\.\/]+\] ?(<SAFE)?> ?$"),
re.compile(br"Please press \"Enter\" to continue!"), re.compile(br"Please press \"Enter\" to continue!"),
re.compile(br"Do you want to see the software license\? \[Y\/n\]: ?"), re.compile(br"Do you want to see the software license\? \[Y\/n\]: ?"),
] ]

View file

@ -22,7 +22,7 @@
assert: assert:
that: that:
- >- - >-
"Unexpected end of string during escaped parameter" in result.msg result.msg == "Unexpected end of string during escaped parameter"
- name: "Test quote_argument filter" - name: "Test quote_argument filter"
assert: assert:

View file

@ -4,4 +4,4 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
collections: collections:
- ansible.netcommon - ansible.netcommon

View file

@ -0,0 +1,13 @@
{
"include_symlinks": false,
"prefixes": [
"docs/docsite/",
"plugins/",
"roles/"
],
"output": "path-line-column-message",
"requirements": [
"ansible-core",
"antsibull-docs"
]
}

View file

@ -0,0 +1,29 @@
#!/usr/bin/env python
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
"""Check extra collection docs with antsibull-docs."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import sys
import subprocess
def main():
"""Main entry point."""
env = os.environ.copy()
suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else ''
env['ANSIBLE_COLLECTIONS_PATH'] = '{root}{suffix}'.format(root=os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), suffix=suffix)
p = subprocess.run(
['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--skip-rstcheck', '.'],
env=env,
check=False,
)
if p.returncode not in (0, 3):
print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode))
if __name__ == '__main__':
main()

View file

@ -0,0 +1,4 @@
{
"include_symlinks": false,
"output": "path-message"
}

View file

@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Ansible Project

110
tests/sanity/extra/licenses.py Executable file
View file

@ -0,0 +1,110 @@
#!/usr/bin/env python
# Copyright (c) 2022, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
"""Prevent files without a correct license identifier from being added to the source tree."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import glob
import sys
def format_license_list(licenses):
if not licenses:
return '(empty)'
return ', '.join(['"%s"' % license for license in licenses])
def find_licenses(filename, relax=False):
spdx_license_identifiers = []
other_license_identifiers = []
has_copyright = False
try:
with open(filename, 'r', encoding='utf-8') as f:
for line in f:
line = line.rstrip()
if 'Copyright ' in line:
has_copyright = True
if 'Copyright: ' in line:
print('%s: found copyright line with "Copyright:". Please remove the colon.' % (filename, ))
if 'SPDX-FileCopyrightText: ' in line:
has_copyright = True
idx = line.find('SPDX-License-Identifier: ')
if idx >= 0:
lic_id = line[idx + len('SPDX-License-Identifier: '):]
spdx_license_identifiers.extend(lic_id.split(' OR '))
if 'GNU General Public License' in line:
if 'v3.0+' in line:
other_license_identifiers.append('GPL-3.0-or-later')
if 'version 3 or later' in line:
other_license_identifiers.append('GPL-3.0-or-later')
if 'Simplified BSD License' in line:
other_license_identifiers.append('BSD-2-Clause')
if 'Apache License 2.0' in line:
other_license_identifiers.append('Apache-2.0')
if 'PSF License' in line or 'Python-2.0' in line:
other_license_identifiers.append('PSF-2.0')
if 'MIT License' in line:
other_license_identifiers.append('MIT')
except Exception as exc:
print('%s: error while processing file: %s' % (filename, exc))
if len(set(spdx_license_identifiers)) < len(spdx_license_identifiers):
print('%s: found identical SPDX-License-Identifier values' % (filename, ))
if other_license_identifiers and set(other_license_identifiers) != set(spdx_license_identifiers):
print('%s: SPDX-License-Identifier yielded the license list %s, while manual guessing yielded the license list %s' % (
filename, format_license_list(spdx_license_identifiers), format_license_list(other_license_identifiers)))
if not has_copyright and not relax:
print('%s: found no copyright notice' % (filename, ))
return sorted(spdx_license_identifiers)
def main():
"""Main entry point."""
paths = sys.argv[1:] or sys.stdin.read().splitlines()
# The following paths are allowed to have no license identifier
no_comments_allowed = [
'changelogs/fragments/*.yml',
'changelogs/fragments/*.yaml',
]
# These files are completely ignored
ignore_paths = [
'.ansible-test-timeout.json',
'.reuse/dep5',
'LICENSES/*.txt',
'COPYING',
]
no_comments_allowed = [fn for pattern in no_comments_allowed for fn in glob.glob(pattern)]
ignore_paths = [fn for pattern in ignore_paths for fn in glob.glob(pattern)]
valid_licenses = [license_file[len('LICENSES/'):-len('.txt')] for license_file in glob.glob('LICENSES/*.txt')]
for path in paths:
if path.startswith('./'):
path = path[2:]
if path in ignore_paths or path.startswith('tests/output/'):
continue
if os.stat(path).st_size == 0:
continue
if not path.endswith('.license') and os.path.exists(path + '.license'):
path = path + '.license'
valid_licenses_for_path = valid_licenses
if path.startswith('plugins/') and not path.startswith(('plugins/modules/', 'plugins/module_utils/')):
valid_licenses_for_path = [license for license in valid_licenses if license == 'GPL-3.0-or-later']
licenses = find_licenses(path, relax=path in no_comments_allowed)
if not licenses:
if path not in no_comments_allowed:
print('%s: must have at least one license' % (path, ))
else:
for license in licenses:
if license not in valid_licenses_for_path:
print('%s: found not allowed license "%s", must be one of %s' % (
path, license, format_license_list(valid_licenses_for_path)))
if __name__ == '__main__':
main()

View file

@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2022, Felix Fontein <felix@fontein.de>

View file

@ -0,0 +1,7 @@
{
"include_symlinks": true,
"prefixes": [
"plugins/"
],
"output": "path-message"
}

View file

@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Ansible Project

View file

@ -0,0 +1,58 @@
#!/usr/bin/env python
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
"""Prevent unwanted files from being added to the source tree."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import os.path
import sys
def main():
"""Main entry point."""
paths = sys.argv[1:] or sys.stdin.read().splitlines()
allowed_extensions = (
'.cs',
'.ps1',
'.psm1',
'.py',
)
skip_paths = set([
])
skip_directories = (
)
yaml_directories = (
'plugins/test/',
'plugins/filter/',
)
for path in paths:
if path in skip_paths:
continue
if any(path.startswith(skip_directory) for skip_directory in skip_directories):
continue
if os.path.islink(path):
print('%s: is a symbolic link' % (path, ))
elif not os.path.isfile(path):
print('%s: is not a regular file' % (path, ))
ext = os.path.splitext(path)[1]
if ext in ('.yml', ) and any(path.startswith(yaml_directory) for yaml_directory in yaml_directories):
continue
if ext not in allowed_extensions:
print('%s: extension must be one of: %s' % (path, ', '.join(allowed_extensions)))
if __name__ == '__main__':
main()

View file

@ -0,0 +1,8 @@
{
"include_symlinks": false,
"prefixes": [
"docs/docsite/rst/api-guide.rst",
"plugins/modules/"
],
"output": "path-line-column-message"
}

View file

@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Ansible Project

View file

@ -0,0 +1,21 @@
#!/usr/bin/env python
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
"""Check whether update-docs.py modifies something."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
import subprocess
def main():
"""Main entry point."""
p = subprocess.run(['./update-docs.py'], check=False)
if p.returncode not in (0, 1):
print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode))
if __name__ == '__main__':
main()

View file

@ -1,9 +1,9 @@
docs/docsite/rst/api-guide.rst rstcheck docs/docsite/rst/api-guide.rst rstcheck
docs/docsite/rst/quoting.rst rstcheck docs/docsite/rst/quoting.rst rstcheck
docs/docsite/rst/ssh-guide.rst rstcheck docs/docsite/rst/ssh-guide.rst rstcheck
tests/update-docs.py compile-2.6 update-docs.py compile-2.6
tests/update-docs.py compile-2.7 update-docs.py compile-2.7
tests/update-docs.py compile-3.5 update-docs.py compile-3.5
tests/update-docs.py future-import-boilerplate update-docs.py future-import-boilerplate
tests/update-docs.py metaclass-boilerplate update-docs.py metaclass-boilerplate
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1,6 +1,6 @@
tests/update-docs.py compile-2.6 update-docs.py compile-2.6
tests/update-docs.py compile-2.7 update-docs.py compile-2.7
tests/update-docs.py compile-3.5 update-docs.py compile-3.5
tests/update-docs.py future-import-boilerplate update-docs.py future-import-boilerplate
tests/update-docs.py metaclass-boilerplate update-docs.py metaclass-boilerplate
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +1 @@
tests/update-docs.py shebang update-docs.py shebang

View file

@ -1 +0,0 @@
tests/update-docs.py shebang

View file

@ -1,9 +1,9 @@
docs/docsite/rst/api-guide.rst rstcheck docs/docsite/rst/api-guide.rst rstcheck
docs/docsite/rst/quoting.rst rstcheck docs/docsite/rst/quoting.rst rstcheck
docs/docsite/rst/ssh-guide.rst rstcheck docs/docsite/rst/ssh-guide.rst rstcheck
tests/update-docs.py compile-2.6 update-docs.py compile-2.6
tests/update-docs.py compile-2.7 update-docs.py compile-2.7
tests/update-docs.py compile-3.5 update-docs.py compile-3.5
tests/update-docs.py future-import-boilerplate update-docs.py future-import-boilerplate
tests/update-docs.py metaclass-boilerplate update-docs.py metaclass-boilerplate
tests/update-docs.py shebang update-docs.py shebang

View file

@ -94,52 +94,6 @@ START_IP_FIREWALL_FILTER = [
START_IP_FIREWALL_FILTER_OLD_DATA = massage_expected_result_data(START_IP_FIREWALL_FILTER, ('ip', 'firewall', 'filter'), keep_all=True) START_IP_FIREWALL_FILTER_OLD_DATA = massage_expected_result_data(START_IP_FIREWALL_FILTER, ('ip', 'firewall', 'filter'), keep_all=True)
START_IP_SERVICE = [
# I removed all entryes not for 'api' and 'api-ssl'
{
"certificate": None,
"tls-version": None,
".id": "*7",
"address": "",
"disabled": True,
"dynamic": False,
"invalid": True,
"name": "api",
"port": 8728,
"proto": "tcp",
"vrf": "main"
},
{
".id": "*9",
"address": "192.168.1.0/24",
"certificate": "mycert",
"dynamic": False,
"invalid": False,
"name": "api-ssl",
"port": 8729,
"proto": "tcp",
"tls-version": "only-1.2",
"vrf": "main"
},
{
"address": None,
"certificate": None,
"max-sessions": None,
"tls-version": None,
".id": "*13",
"connection": True,
"dynamic": True,
"invalid": False,
"local": "192.168.1.1",
"name": "api-ssl",
"port": 8729,
"proto": "tcp",
"remote": "192.168.1.2:12346"
}
]
START_IP_SERVICE_OLD_DATA = massage_expected_result_data(START_IP_SERVICE, ('ip', 'service'), keep_all=True)
class TestRouterosApiFindAndModifyModule(ModuleTestCase): class TestRouterosApiFindAndModifyModule(ModuleTestCase):
@ -667,8 +621,6 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'comment': 'defconf', 'comment': 'defconf',
'protocol': 'icmp', 'protocol': 'icmp',
'disabled': False, 'disabled': False,
'log': False,
'log-prefix': '',
}, },
{ {
'.id': '*3', '.id': '*3',
@ -676,8 +628,6 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'chain': 'input', 'chain': 'input',
'comment': 'defconf', 'comment': 'defconf',
'disabled': False, 'disabled': False,
'log': False,
'log-prefix': '',
}, },
{ {
'.id': '*4', '.id': '*4',
@ -685,8 +635,6 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'chain': 'input', 'chain': 'input',
'comment': 'defconf', 'comment': 'defconf',
'disabled': False, 'disabled': False,
'log': False,
'log-prefix': '',
}, },
{ {
'.id': '*7', '.id': '*7',
@ -695,8 +643,6 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'comment': 'defconf', 'comment': 'defconf',
'disabled': False, 'disabled': False,
'in-interface': 'wan', 'in-interface': 'wan',
'log': False,
'log-prefix': '',
}, },
{ {
'.id': '*8', '.id': '*8',
@ -705,8 +651,6 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'comment': 'defconf', 'comment': 'defconf',
'connection-state': 'established', 'connection-state': 'established',
'disabled': False, 'disabled': False,
'log': False,
'log-prefix': '',
}, },
{ {
'.id': '*9', '.id': '*9',
@ -715,8 +659,6 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'comment': 'defconf', 'comment': 'defconf',
'connection-state': 'related', 'connection-state': 'related',
'disabled': False, 'disabled': False,
'log': False,
'log-prefix': '',
}, },
{ {
'.id': '*A', '.id': '*A',
@ -725,35 +667,7 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase):
'comment': 'defconf', 'comment': 'defconf',
'connection-status': 'invalid', 'connection-status': 'invalid',
'disabled': False, 'disabled': False,
'log': False,
'log-prefix': '',
}, },
]) ])
self.assertEqual(result['match_count'], 3) self.assertEqual(result['match_count'], 3)
self.assertEqual(result['modify_count'], 2) self.assertEqual(result['modify_count'], 2)
@patch('ansible_collections.community.routeros.plugins.modules.api_find_and_modify.compose_api_path',
new=create_fake_path(('ip', 'service'), START_IP_SERVICE))
def test_change_ignore_dynamic(self):
with self.assertRaises(AnsibleExitJson) as exc:
args = self.config_module_args.copy()
args.update({
'path': 'ip service',
'find': {
'name': 'api-ssl',
},
'values': {
'address': '192.168.1.0/24',
},
'ignore_dynamic': True,
'_ansible_diff': True,
})
with set_module_args(args):
self.module.main()
result = exc.exception.args[0]
self.assertEqual(result['changed'], False)
self.assertEqual(result['old_data'], [entry for entry in START_IP_SERVICE_OLD_DATA if entry["dynamic"] is False])
self.assertEqual(result['new_data'], [entry for entry in START_IP_SERVICE_OLD_DATA if entry["dynamic"] is False])
self.assertEqual(result['match_count'], 1)
self.assertEqual(result['modify_count'], 0)

View file

@ -4,4 +4,4 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
collections: collections:
- community.internal_test_tools - ansible.netcommon

29
tests/update-docs.py → update-docs.py Normal file → Executable file
View file

@ -11,6 +11,9 @@ Updates DOCUMENTATION of modules using module_utils._api_data with the correct l
import sys import sys
# Ensure that we can import things from ansible_collections
sys.path.append('../../..')
from ansible_collections.community.routeros.plugins.module_utils._api_data import ( from ansible_collections.community.routeros.plugins.module_utils._api_data import (
PATHS, PATHS,
join_path, join_path,
@ -23,34 +26,24 @@ MODULES = [
] ]
def update_file(file: str, begin_line: str, end_line: str, choice_line: str, path_choices: list[str]) -> bool: def update_file(file, begin_line, end_line, choice_line, path_choices):
with open(file, 'r', encoding='utf-8') as f: with open(file, 'r', encoding='utf-8') as f:
lines = f.read().splitlines() lines = f.read().splitlines()
begin_index = lines.index(begin_line) begin_index = lines.index(begin_line)
end_index = lines.index(end_line, begin_index + 1) end_index = lines.index(end_line, begin_index + 1)
new_lines = lines[:begin_index + 1] + [choice_line.format(choice=choice) for choice in path_choices] + lines[end_index:] new_lines = lines[:begin_index + 1] + [choice_line.format(choice=choice) for choice in path_choices] + lines[end_index:]
if lines == new_lines: if lines != new_lines:
return False print(f'{file} has been updated')
print(f'{file} has been updated') with open(file, 'w', encoding='utf-8') as f:
with open(file, 'w', encoding='utf-8') as f: f.write('\n'.join(new_lines) + '\n')
f.write('\n'.join(new_lines) + '\n')
return True
def main(args: list[str]) -> int: def main():
path_choices = sorted([join_path(path) for path, path_info in PATHS.items() if path_info.fully_understood]) path_choices = sorted([join_path(path) for path, path_info in PATHS.items() if path_info.fully_understood])
changes = False
for file in MODULES: for file in MODULES:
changes |= update_file(file, ' # BEGIN PATH LIST', ' # END PATH LIST', ' - {choice}', path_choices) update_file(file, ' # BEGIN PATH LIST', ' # END PATH LIST', ' - {choice}', path_choices)
lint = "--lint" in args
if not lint or not changes:
return 0
print("Run 'nox -Re update-docs'!")
return 1
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main(sys.argv[1:])) main()