linux-system-roles / network

An ansible role to configure networking
https://linux-system-roles.github.io/network/
BSD 3-Clause "New" or "Revised" License
238 stars 106 forks source link

docs: Add examples using network_state variable #728

Closed liangwen12year closed 3 months ago

liangwen12year commented 3 months ago

Enhancement:

Reason:

Result:

Issue Tracker Tickets (Jira or BZ if any):

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 43.29%. Comparing base (89d7148) to head (398678d). Report is 7 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #728 +/- ## =========================================== + Coverage 20.40% 43.29% +22.88% =========================================== Files 10 12 +2 Lines 1485 3109 +1624 Branches 436 0 -436 =========================================== + Hits 303 1346 +1043 - Misses 1181 1763 +582 + Partials 1 0 -1 ``` | [Flag](https://app.codecov.io/gh/linux-system-roles/network/pull/728/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | Coverage Δ | | |---|---|---| | [sanity](https://app.codecov.io/gh/linux-system-roles/network/pull/728/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | `?` | | 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=linux-system-roles#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.

liangwen12year commented 3 months ago

@tyll , configure vrf interface is not supported in network_connections, besides that, I also added other examples.

liangwen12year commented 3 months ago
    - name: Configure the vrf interface test-vrf0 with vrf port eth1 and vrf route table 101
      vars:
        network_state:
          interfaces:
            - name: test-vrf0
              type: vrf
              state: up
              vrf:
                port:
                  - eth1
                route-table-id: 101
      ansible.builtin.include_role:
        name: linux-system-roles.network

@eliaswimmer, this is the example of configuring vrf interface using the network_state variable.