ansible-collections / community.routeros

Ansible modules for managing MikroTik RouterOS instances.
https://galaxy.ansible.com/ui/repo/published/community/routeros/
GNU General Public License v3.0
98 stars 45 forks source link

Add RouterOS 7.x support to '/mpls ldp' path #271

Closed samburney closed 6 months ago

samburney commented 6 months ago
SUMMARY

RouterOS 7.1 completely re-writes the MPLS implementation (As per https://cdn.mikrotik.com/routeros/7.1/CHANGELOG), including support for multiple LDP instances.

This PR implements support for RouterOS 7.x LDP instances while retaining backwards compatibility with 6.x.

Some things to note:

ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION

Test tasks:

  tasks:
    - name: Enable MPLS LDP instance on RouterOS 6.x
      when: "'routeros6' in group_names"
      community.routeros.api_modify:
        path: mpls ldp
        data:
          - enabled: true
            lsr-id: 1.2.3.4

    - name: Enable MPLS LDP instance on RouterOS 7.x
      when: "'routeros6' not in group_names"
      community.routeros.api_modify:
        path: mpls ldp
        handle_entries_content: remove_as_much_as_possible
        data:
          - vrf: main
            lsr-id: 1.2.3.4

Resulting data from api_info:

RouterOS 6.49.10

ok: [testrtr2] => {
    "queue_simple_api_info": {
        "changed": false,
        "failed": false,
        "result": [
            {
                "enabled": true,
                "lsr-id": "1.2.3.4"
            }
        ]
    }
}

RouterOS 7.14.2

ok: [testrtr1] => {
    "queue_simple_api_info": {
        "changed": false,
        "failed": false,
        "result": [
            {
                "!afi": null,
                "!comment": null,
                "!distribute-for-default": null,
                "!hop-limit": null,
                "!loop-detect": null,
                "!path-vector-limit": null,
                "!preferred-afi": null,
                "!transport-addresses": null,
                "!use-explicit-null": null,
                ".id": "*19",
                "lsr-id": "1.2.3.4",
                "vrf": "main"
            }
        ]
    }
}
codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.99%. Comparing base (a3fbe88) to head (554f12d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #271 +/- ## ======================================= Coverage 82.99% 82.99% ======================================= Files 32 32 Lines 4051 4051 Branches 873 873 ======================================= Hits 3362 3362 Misses 506 506 Partials 183 183 ``` | [Flag](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/271/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/271/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | `66.86% <ø> (ø)` | | | [sanity](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/271/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | `22.08% <ø> (ø)` | | | [units](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/271/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | `82.93% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

felixfontein commented 6 months ago

@samburney thanks as well!

github-actions[bot] commented 6 months ago

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main: https://ansible-collections.github.io/community.routeros/branch/main