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 support for '/interface pppoe-server server' path #273

Closed samburney closed 6 months ago

samburney commented 6 months ago
SUMMARY

Add support for '/interface pppoe-server server' path.

ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION

Tested in RouterOS 6.49.10 and 7.14.2.

RouterOS 7.x supports two additional fields:

Tasks used for testing:

RouterOS 6.49.10

  tasks:
    - name: Add interface pppoe-server server with defaults (RouterOS 6.x)
      when: "'routeros6' in group_names"
      community.routeros.api_modify:
        path: interface pppoe-server server
        handle_entries_content: remove
        data:
          - interface: ether1

    - name: Add interface pppoe-server server with all values set (RouterOS 6.x)
      when: "'routeros6' in group_names"
      community.routeros.api_modify:
        path: interface pppoe-server server
        handle_entries_content: remove
        data:
          - interface: ether2
#            accept-empty-service: false
            authentication: pap,chap
#            comment: Test PPPoE Server
            default-profile: default-encryption
            disabled: false
            keepalive-timeout: 30
            max-mru: 1500
            max-mtu: 1500
            max-sessions: 10
            mrru: 1500
            one-session-per-host: true
            pado-delay: 100
            service-name: 'test_pppoe_server'

RouterOS 7.14.2

  tasks:
    - name: Add interface pppoe-server server with defaults (RouterOS 7.x)
      when: "'routeros6' not in group_names"
      community.routeros.api_modify:
        path: interface pppoe-server server
        handle_entries_content: remove
        data:
          - interface: ether1

    - name: Add interface pppoe-server server with all values set (RouterOS 7.x)
      when: "'routeros6' not in group_names"
      community.routeros.api_modify:
        path: interface pppoe-server server
        handle_entries_content: remove
        data:
          - interface: ether2
            accept-empty-service: false
            authentication: pap,chap
            comment: Test PPPoE Server
            default-profile: default-encryption
            disabled: false
            keepalive-timeout: 30
            max-mru: 1500
            max-mtu: 1500
            max-sessions: 10
            mrru: 1500
            one-session-per-host: true
            pado-delay: 100
            service-name: 'test_pppoe_server'

Resulting api_info output:

RouterOS 6.49.10

### Only defaults
{
    "!accept-empty-service": null,
    "!comment": null,
    ".id": "*4",
    "interface": "ether1"
},

### All values changed
{
    "!accept-empty-service": null,
    "!comment": null,
    ".id": "*5",
    "authentication": "pap,chap",
    "default-profile": "default-encryption",
    "disabled": false,
    "interface": "ether2",
    "keepalive-timeout": 30,
    "max-mru": 1500,
    "max-mtu": 1500,
    "max-sessions": 10,
    "mrru": 1500,
    "one-session-per-host": true,
    "pado-delay": 100,
    "service-name": "test_pppoe_server"
}

RouterOS 7.14.2

### Only defaults
{
    "!accept-empty-service": null,
    "!comment": null,
    ".id": "*4",
    "interface": "ether1"
},

### All values changed
{
    ".id": "*5",
    "accept-empty-service": false,
    "authentication": "pap,chap",
    "comment": "Test PPPoE Server",
    "default-profile": "default-encryption",
    "disabled": false,
    "interface": "ether2",
    "keepalive-timeout": 30,
    "max-mru": 1500,
    "max-mtu": 1500,
    "max-sessions": 10,
    "mrru": 1500,
    "one-session-per-host": true,
    "pado-delay": 100,
    "service-name": "test_pppoe_server"
}
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 (a0ef18e).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #273 +/- ## ======================================= 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/273/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/273/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/273/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/273/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.

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

felixfontein commented 6 months ago

@samburney thank you!