diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1ef863c..9e62248 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,215 +1,233 @@ ============================= Vyos Collection Release Notes ============================= .. contents:: Topics +v2.5.0 +====== + +Minor Changes +------------- + +- vyos_logging_global logging resource module. + +Deprecated Features +------------------- + +- The vyos_logging module has been deprecated in favor of the new vyos_logging_global resource module and will be removed in a release after "2023-08-01". + +Bugfixes +-------- + +- fix issue in route-maps facts code when route-maps facts are empty. + v2.4.0 ====== Minor Changes ------------- - Add vyos_prefix_lists Resource Module. New Modules ----------- - vyos_prefix_lists - Prefix-Lists resource module for VyOS v2.3.1 ====== Bugfixes -------- - Fix KeyError 'source' - vyos_firewall_rules - Updated docs resolving spelling typos - change interface to next-hop-interface while generating static_routes nexthop command. v2.3.0 ====== Minor Changes ------------- - Add vyos_route_maps resource module (https://github.com/ansible-collections/vyos.vyos/pull/156.). Bugfixes -------- - change admin_distance to distance while generating static_routes nexthop command. - firewall_global - port-groups were not added (https://github.com/ansible-collections/vyos.vyos/issues/107) New Modules ----------- - vyos_route_maps - Route Map Resource Module. v2.2.0 ====== Minor Changes ------------- - Add support for available_network_resources key, which allows to fetch the available resources for a platform (https://github.com/ansible-collections/vyos.vyos/issues/138). Security Fixes -------------- - Mask values of sensitive keys in module result. v2.1.0 ====== Minor Changes ------------- - Add regex for delete failures to terminal_stderr_re - Add vyos BGP address_family resource module (https://github.com/ansible-collections/vyos.vyos/pull/132). - Enabled addition and parsing of wireguard interface. New Modules ----------- - vyos_bgp_address_family - BGP Address Family Resource Module. v2.0.0 ====== Major Changes ------------- - Please refer to ansible.netcommon `changelog `_ for more details. - Requires ansible.netcommon v2.0.0+ to support `ansible_network_single_user_mode` and `ansible_network_import_modules` - ipaddress is no longer in ansible.netcommon. For Python versions without ipaddress (< 3.0), the ipaddress package is now required. Minor Changes ------------- - Add support for configuration caching (single_user_mode). - Add vyos BGP global resource module.(https://github.com/ansible-collections/vyos.vyos/pull/125). - Re-use device_info dictionary in cliconf. Bugfixes -------- - Update docs to clarify the idemptonecy related caveat and add it in the output warnings (https://github.com/ansible-collections/ansible.netcommon/pull/189) - cliconf plugin - Prevent `get_capabilities()` from getting larger every time it is called New Modules ----------- - vyos_bgp_global - BGP Global Resource Module. v1.1.1 ====== Bugfixes -------- - Add version key to galaxy.yaml to work around ansible-galaxy bug - Enable configuring an interface which is not present in the running config. - vyos_config - Only process src files as commands when they actually contain commands. This fixes an issue were the whitespace preceding a configuration key named 'set' was stripped, tripping up the parser. v1.1.0 ====== Minor Changes ------------- - Added ospf_interfaces resource module. New Modules ----------- - vyos_ospf_interfaces - OSPF Interfaces resource module v1.0.5 ====== Bugfixes -------- - Added openvpn vtu interface support. - Update network integration auth timeout for connection local. - terminal plugin - Overhaul ansi_re to remove more escape sequences v1.0.4 ====== Minor Changes ------------- - Moved intent testcases from integration suite to unit tests. - Reformatted files with latest version of Black (20.8b1). v1.0.3 ====== v1.0.2 ====== Minor Changes ------------- - Fixed the typo in the modulename of ospfv2 and ospfv3 unit tests. - Updated docs. - terminal plugin - Added additional escape sequence to be removed from terminal output. Bugfixes -------- - Added workaround to avoid set_fact dynamically assigning value. This behavior seems to have been broken after ansible2.9. - Make `src`, `backup` and `backup_options` in vyos_config work when module alias is used (https://github.com/ansible-collections/vyos.vyos/pull/67). - vyos_config - fixed issue where config could be saved while in check mode (https://github.com/ansible-collections/vyos.vyos/pull/53) v1.0.1 ====== Minor Changes ------------- - Add doc plugin fixes (https://github.com/ansible-collections/vyos.vyos/pull/51) v1.0.0 ====== New Plugins ----------- Cliconf ~~~~~~~ - vyos - Use vyos cliconf to run command on VyOS platform New Modules ----------- - vyos_banner - Manage multiline banners on VyOS devices - vyos_command - Run one or more commands on VyOS devices - vyos_config - Manage VyOS configuration on remote device - vyos_facts - Get facts about vyos devices. - vyos_firewall_global - FIREWALL global resource module - vyos_firewall_interfaces - FIREWALL interfaces resource module - vyos_firewall_rules - FIREWALL rules resource module - vyos_interface - (deprecated, removed after 2022-06-01) Manage Interface on VyOS network devices - vyos_interfaces - Interfaces resource module - vyos_l3_interface - (deprecated, removed after 2022-06-01) Manage L3 interfaces on VyOS network devices - vyos_l3_interfaces - L3 interfaces resource module - vyos_lag_interfaces - LAG interfaces resource module - vyos_linkagg - (deprecated, removed after 2022-06-01) Manage link aggregation groups on VyOS network devices - vyos_lldp - (deprecated, removed after 2022-06-01) Manage LLDP configuration on VyOS network devices - vyos_lldp_global - LLDP global resource module - vyos_lldp_interface - (deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on VyOS network devices - vyos_lldp_interfaces - LLDP interfaces resource module - vyos_logging - Manage logging on network devices - vyos_ospfv2 - OSPFv2 resource module - vyos_ospfv3 - OSPFV3 resource module - vyos_ping - Tests reachability using ping from VyOS network devices - vyos_static_route - (deprecated, removed after 2022-06-01) Manage static IP routes on Vyatta VyOS network devices - vyos_static_routes - Static routes resource module - vyos_system - Run `set system` commands on VyOS devices - vyos_user - Manage the collection of local users on VyOS device - vyos_vlan - Manage VLANs on VyOS network devices diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index cd6764c..76d67c8 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -1,276 +1,289 @@ ancestor: null releases: 1.0.0: modules: - description: Manage multiline banners on VyOS devices name: vyos_banner namespace: '' - description: Run one or more commands on VyOS devices name: vyos_command namespace: '' - description: Manage VyOS configuration on remote device name: vyos_config namespace: '' - description: Get facts about vyos devices. name: vyos_facts namespace: '' - description: FIREWALL global resource module name: vyos_firewall_global namespace: '' - description: FIREWALL interfaces resource module name: vyos_firewall_interfaces namespace: '' - description: FIREWALL rules resource module name: vyos_firewall_rules namespace: '' - description: (deprecated, removed after 2022-06-01) Manage Interface on VyOS network devices name: vyos_interface namespace: '' - description: Interfaces resource module name: vyos_interfaces namespace: '' - description: (deprecated, removed after 2022-06-01) Manage L3 interfaces on VyOS network devices name: vyos_l3_interface namespace: '' - description: L3 interfaces resource module name: vyos_l3_interfaces namespace: '' - description: LAG interfaces resource module name: vyos_lag_interfaces namespace: '' - description: (deprecated, removed after 2022-06-01) Manage link aggregation groups on VyOS network devices name: vyos_linkagg namespace: '' - description: (deprecated, removed after 2022-06-01) Manage LLDP configuration on VyOS network devices name: vyos_lldp namespace: '' - description: LLDP global resource module name: vyos_lldp_global namespace: '' - description: (deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on VyOS network devices name: vyos_lldp_interface namespace: '' - description: LLDP interfaces resource module name: vyos_lldp_interfaces namespace: '' - description: Manage logging on network devices name: vyos_logging namespace: '' - description: OSPFv2 resource module name: vyos_ospfv2 namespace: '' - description: OSPFV3 resource module name: vyos_ospfv3 namespace: '' - description: Tests reachability using ping from VyOS network devices name: vyos_ping namespace: '' - description: (deprecated, removed after 2022-06-01) Manage static IP routes on Vyatta VyOS network devices name: vyos_static_route namespace: '' - description: Static routes resource module name: vyos_static_routes namespace: '' - description: Run `set system` commands on VyOS devices name: vyos_system namespace: '' - description: Manage the collection of local users on VyOS device name: vyos_user namespace: '' - description: Manage VLANs on VyOS network devices name: vyos_vlan namespace: '' plugins: cliconf: - description: Use vyos cliconf to run command on VyOS platform name: vyos namespace: null release_date: '2020-06-23' 1.0.1: changes: minor_changes: - Add doc plugin fixes (https://github.com/ansible-collections/vyos.vyos/pull/51) fragments: - 51-doc-plugin-fixes.yaml release_date: '2020-06-23' 1.0.2: changes: bugfixes: - Added workaround to avoid set_fact dynamically assigning value. This behavior seems to have been broken after ansible2.9. - Make `src`, `backup` and `backup_options` in vyos_config work when module alias is used (https://github.com/ansible-collections/vyos.vyos/pull/67). - vyos_config - fixed issue where config could be saved while in check mode (https://github.com/ansible-collections/vyos.vyos/pull/53) minor_changes: - Fixed the typo in the modulename of ospfv2 and ospfv3 unit tests. - Updated docs. - terminal plugin - Added additional escape sequence to be removed from terminal output. fragments: - 65-remove-unwanted-terminal-chars.yaml - 70-workaround-set_fact.yaml - 72-modulename-typofix.yaml - 73-update-docs.yaml - fix_src_backup_with_module_alias.yaml - prevent-vyos_config-saving-in-check-mode.yaml release_date: '2020-07-31' 1.0.3: fragments: - 1.0.3.yaml release_date: '2020-08-06' 1.0.4: changes: minor_changes: - Moved intent testcases from integration suite to unit tests. - Reformatted files with latest version of Black (20.8b1). fragments: - 71-refactor-interface-test.yaml - 80-reformat-files.yaml release_date: '2020-08-27' 1.0.5: changes: bugfixes: - Added openvpn vtu interface support. - Update network integration auth timeout for connection local. - terminal plugin - Overhaul ansi_re to remove more escape sequences fragments: - 86-openvpn_vtu_interface.yaml - local_auth_timeout.yaml - terminal-escape-codes.yaml release_date: '2020-10-08' 1.1.0: changes: minor_changes: - Added ospf_interfaces resource module. fragments: - vyos_ospf_interfaces_rm.yaml modules: - description: OSPF Interfaces resource module name: vyos_ospf_interfaces namespace: '' release_date: '2020-10-30' 1.1.1: changes: bugfixes: - Add version key to galaxy.yaml to work around ansible-galaxy bug - Enable configuring an interface which is not present in the running config. - vyos_config - Only process src files as commands when they actually contain commands. This fixes an issue were the whitespace preceding a configuration key named 'set' was stripped, tripping up the parser. fragments: - 91-new-interface.yaml - config-processed-as-command.yaml - galaxy-version.yaml release_date: '2021-01-27' 2.0.0: changes: bugfixes: - Update docs to clarify the idemptonecy related caveat and add it in the output warnings (https://github.com/ansible-collections/ansible.netcommon/pull/189) - cliconf plugin - Prevent `get_capabilities()` from getting larger every time it is called major_changes: - Please refer to ansible.netcommon `changelog `_ for more details. - Requires ansible.netcommon v2.0.0+ to support `ansible_network_single_user_mode` and `ansible_network_import_modules` - ipaddress is no longer in ansible.netcommon. For Python versions without ipaddress (< 3.0), the ipaddress package is now required. minor_changes: - Add support for configuration caching (single_user_mode). - Add vyos BGP global resource module.(https://github.com/ansible-collections/vyos.vyos/pull/125). - Re-use device_info dictionary in cliconf. fragments: - 120-remove-ipaddress.yaml - 122-rpc-unbloat.yaml - bgp_global_resource_module.yaml - fix_docker_sanity_test_failures.yaml - major_release_2.0.0.yaml - modify_resource_module_class_import.yaml - single_user_mode.yaml - vyos_config_diff_doc_update.yaml modules: - description: BGP Global Resource Module. name: vyos_bgp_global namespace: '' release_date: '2021-02-24' 2.1.0: changes: minor_changes: - Add regex for delete failures to terminal_stderr_re - Add vyos BGP address_family resource module (https://github.com/ansible-collections/vyos.vyos/pull/132). - Enabled addition and parsing of wireguard interface. fragments: - 128-remove_tests_sanity_requirements.yml - 132-add-vyos-bgp-address-family.yml - parse_wireguard_interface.yml - replace-check_required.yaml - skip_no_log_sanity_error.yaml - terminal_stderr_delete.yml modules: - description: BGP Address Family Resource Module. name: vyos_bgp_address_family namespace: '' release_date: '2021-03-30' 2.2.0: changes: minor_changes: - Add support for available_network_resources key, which allows to fetch the available resources for a platform (https://github.com/ansible-collections/vyos.vyos/issues/138). security_fixes: - Mask values of sensitive keys in module result. fragments: - 147-add_ignore_txt.yml - 160_available_network_resources.yaml - no_log_mask.yaml - remove-old-test-deps.yml release_date: '2021-04-27' 2.3.0: changes: bugfixes: - change admin_distance to distance while generating static_routes nexthop command. - firewall_global - port-groups were not added (https://github.com/ansible-collections/vyos.vyos/issues/107) minor_changes: - Add vyos_route_maps resource module (https://github.com/ansible-collections/vyos.vyos/pull/156.). fragments: - changelog_doc_path_update.yaml - fix_delete_route_maps.yaml - fix_port_groups.yaml - fix_static_routes_distance.yaml - vyos-route-maps.yaml modules: - description: Route Map Resource Module. name: vyos_route_maps namespace: '' release_date: '2021-05-18' 2.3.1: changes: bugfixes: - Fix KeyError 'source' - vyos_firewall_rules - Updated docs resolving spelling typos - change interface to next-hop-interface while generating static_routes nexthop command. fragments: - 172-fix-source-keyerror-firewallrules.yml - docs_common_error_correction.yaml - fix_static_routes_next_hop_interface.yaml - update_readme_freenode_to_liberachat.yml release_date: '2021-06-22' 2.4.0: changes: minor_changes: - Add vyos_prefix_lists Resource Module. fragments: - vyos_prefix_lists.yml modules: - description: Prefix-Lists resource module for VyOS name: vyos_prefix_lists namespace: '' release_date: '2021-07-06' + 2.5.0: + changes: + bugfixes: + - fix issue in route-maps facts code when route-maps facts are empty. + deprecated_features: + - The vyos_logging module has been deprecated in favor of the new vyos_logging_global + resource module and will be removed in a release after "2023-08-01". + minor_changes: + - vyos_logging_global logging resource module. + fragments: + - fix_issue_vyos_facts.yaml + - vyos_logging_global_module.yaml + release_date: '2021-07-26' diff --git a/changelogs/fragments/fix_issue_vyos_facts.yaml b/changelogs/fragments/fix_issue_vyos_facts.yaml deleted file mode 100644 index 81653a0..0000000 --- a/changelogs/fragments/fix_issue_vyos_facts.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -bugfixes: - - fix issue in route-maps facts code when route-maps facts are empty. diff --git a/changelogs/fragments/vyos_logging_global_module.yaml b/changelogs/fragments/vyos_logging_global_module.yaml deleted file mode 100644 index d9f2c8f..0000000 --- a/changelogs/fragments/vyos_logging_global_module.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -minor_changes: - - vyos_logging_global logging resource module. -deprecated_features: - - The vyos_logging module has been deprecated in favor of the new vyos_logging_global resource module and will be removed in a release after "2023-08-01". diff --git a/docs/vyos.vyos.vyos_ping_module.rst b/docs/vyos.vyos.vyos_ping_module.rst index 59e4a74..a1674b5 100644 --- a/docs/vyos.vyos.vyos_ping_module.rst +++ b/docs/vyos.vyos.vyos_ping_module.rst @@ -1,422 +1,422 @@ .. _vyos.vyos.vyos_ping_module: ******************* vyos.vyos.vyos_ping ******************* **Tests reachability using ping from VyOS network devices** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Tests reachability using ping from a VyOS device to a remote destination. - Tested against VyOS 1.1.8 (helium) - For a general purpose network module, see the :ref:`net_ping ` module. - For Windows targets, use the :ref:`win_ping ` module instead. - For targets running Python, use the :ref:`ping ` module instead. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
count
integer
Default:
5
Number of packets to send to check reachability.
dest
string / required
The IP Address or hostname (resolvable by the device) of the remote node.
interval
integer
Determines the interval (in seconds) between consecutive pings.
provider
dictionary
Deprecated
Starting with Ansible 2.5 we recommend using connection: network_cli.
For more information please see the Network Guide.

A dict object containing connection details.
host
string
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.
password
string
Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead.
port
integer
Specifies the port to use when building the connection to the remote device.
ssh_keyfile
path
Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
timeout
integer
Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error.
username
string
Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead.
size
integer
Determines the size (in bytes) of the ping packet(s).
source
string
The source interface or IP Address to use while sending the ping packet(s).
state
string
    Choices:
  • absent
  • present ←
Determines if the expected result is success or fail.
ttl
integer
The time-to-live value for the ICMP packet(s).

Notes ----- .. note:: - Tested against VyOS 1.1.8 (helium). - For a general purpose network module, see the :ref:`net_ping ` module. - For Windows targets, use the :ref:`win_ping ` module instead. - For targets running Python, use the :ref:`ping ` module instead. - This module works with connection ``network_cli``. See `the VyOS OS Platform Options <../network/user_guide/platform_vyos.html>`_. - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide ` Examples -------- .. code-block:: yaml - name: Test reachability to 10.10.10.10 vyos.vyos.vyos_ping: dest: 10.10.10.10 - name: Test reachability to 10.20.20.20 using source and ttl set vyos.vyos.vyos_ping: dest: 10.20.20.20 source: eth0 ttl: 128 - name: Test reachability to 10.30.30.30 using interval vyos.vyos.vyos_ping: dest: 10.30.30.30 interval: 3 state: absent - name: Test reachability to 10.40.40.40 setting count and source vyos.vyos.vyos_ping: dest: 10.40.40.40 source: eth1 count: 20 size: 512 Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
commands
list
always
List of commands sent.

Sample:
['ping 10.8.38.44 count 10 interface eth0 ttl 128']
packet_loss
string
always
Percentage of packets lost.

Sample:
0%
packets_rx
integer
always
Packets successfully received.

Sample:
20
packets_tx
integer
always
Packets successfully transmitted.

Sample:
20
rtt
dictionary
when ping succeeds
The round trip time (RTT) stats.

Sample:
-
{'avg': 2, 'max': 8, 'min': 1, 'mdev': 24}
+
AnsibleMapping([('avg', 2), ('max', 8), ('min', 1), ('mdev', 24)])


Status ------ Authors ~~~~~~~ - Nilashish Chakraborty (@NilashishC) diff --git a/docs/vyos.vyos.vyos_route_maps_module.rst b/docs/vyos.vyos.vyos_route_maps_module.rst index 828ce34..c548e9b 100644 --- a/docs/vyos.vyos.vyos_route_maps_module.rst +++ b/docs/vyos.vyos.vyos_route_maps_module.rst @@ -1,2042 +1,2042 @@ .. _vyos.vyos.vyos_route_maps_module: ************************* vyos.vyos.vyos_route_maps ************************* **Route Map Resource Module.** Version added: 2.3.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module manages route map configurations on devices running VYOS. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A list of route-map configuration.
entries
list / elements=dictionary
Route Map rules.

aliases: rules
action
string
    Choices:
  • deny
  • permit
Action for matching routes
call
string
Route map name
continue_sequence
integer
Continue on a different entry within the route-map.
description
string
Description for the rule.
match
dictionary
Route parameters to match.
as_path
string
Set as-path.
community
dictionary
BGP community attribute.
community_list
string
BGP community-list to match
exact_match
boolean
    Choices:
  • no
  • yes
BGP community-list to match
extcommunity
string
Extended community name.
interface
string
First hop interface of a route to match.
ip
dictionary
IP prefix parameters to match.
address
dictionary
IP address of route to match.
list_type
string
    Choices:
  • access-list
  • prefix-list
type of list
value
string
value of access-list and prefix list
next_hop
dictionary
next hop prefix list.
list_type
string
    Choices:
  • access-list
  • prefix-list
type of list
value
string
value of access-list and prefix list
route_source
dictionary
IP route-source to match
list_type
string
    Choices:
  • access-list
  • prefix-list
type of list
value
string
value of access-list and prefix list
ipv6
dictionary
IPv6 prefix parameters to match.
address
dictionary
IPv6 address of route to match.
list_type
string
    Choices:
  • access-list
  • prefix-list
type of list
value
string
value of access-list and prefix list
next_hop
string
next-hop ipv6 address IPv6 <h:h:h:h:h:h:h:h>.
large_community_large_community_list
string
BGP large-community-list to match.
metric
integer
Route metric <1-65535>.
origin
string
    Choices:
  • ebgp
  • ibgp
  • incomplete
bgp origin.
peer
string
Peer IP address <x.x.x.x>.
rpki
string
    Choices:
  • notfound
  • invalid
  • valid
RPKI validation value.
on_match
dictionary
Exit policy on matches.
goto
integer
Rule number to goto on match <1-65535>.
next
boolean
    Choices:
  • no
  • yes
Next sequence number to goto on match.
sequence
integer
Route map rule number <1-65535>.
set
dictionary
Route parameters.
aggregator
dictionary
Border Gateway Protocol (BGP) aggregator attribute.
as
string
AS number of an aggregation.
ip
string
IP address.
as_path_exclude
string
BGP AS path exclude string ex "456 64500 45001"
as_path_prepend
string
Prepend string for a Border Gateway Protocol (BGP) AS-path attribute.
atomic_aggregate
boolean
    Choices:
  • no
  • yes
Border Gateway Protocol (BGP) atomic aggregate attribute.
bgp_extcommunity_rt
string
ExtCommunity in format AS:value
comm_list
dictionary
Border Gateway Protocol (BGP) communities matching a community-list.
comm_list
string
BGP communities with a community-list.
delete
boolean
    Choices:
  • no
  • yes
Delete BGP communities matching the community-list.
community
dictionary
Border Gateway Protocol (BGP) community attribute.
value
string
Community in 4 octet AS:value format or it can be from local-AS, no-advertise,no-expert,internet,additive,none.
extcommunity_rt
string
Set route target value.ASN:nn_or_IP_address:nn VPN extended community.
extcommunity_soo
string
Set Site of Origin value. ASN:nn_or_IP_address:nn VPN extended community
ip_next_hop
string
IP address.
ipv6_next_hop
dictionary
Nexthop IPv6 address.
ip_type
string
    Choices:
  • global
  • local
Global or Local
value
string
ipv6 address
large_community
string
Set BGP large community value.
local_preference
string
Border Gateway Protocol (BGP) local preference attribute.Example <0-4294967295>.
metric
string
Destination routing protocol metric. Example <0-4294967295>.
metric_type
string
    Choices:
  • type-1
  • type-2
Open Shortest Path First (OSPF) external metric-type.
origin
string
    Choices:
  • egp
  • igp
  • incomplete
Set bgp origin.
originator_id
string
Border Gateway Protocol (BGP) originator ID attribute. Originator IP address.
src
string
Source address for route. Example <x.x.x.x> IP address.
tag
string
Tag value for routing protocol. Example <1-65535>
weight
string
Border Gateway Protocol (BGP) weight attribute. Example <0-4294967295>
route_map
string
Route map name.
running_config
string
This option is used only with state parsed.
The value of this option should be the output received from the VYOS device by executing the command show configuration commands | grep route-map.
The state parsed reads the configuration from show configuration commands | grep route-map option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
state
string
    Choices:
  • deleted
  • merged ←
  • overridden
  • replaced
  • gathered
  • rendered
  • parsed
The state the configuration should be left in.

Notes ----- .. note:: - Tested against vyos 1.2. - This module works with connection ``network_cli``. Examples -------- .. code-block:: yaml # Using merged # Before state # vyos@vyos:~$ show configuration commands | match "set policy route-map" # vyos@vyos:~$ - name: Merge the provided configuration with the existing running configuration register: result vyos.vyos.vyos_route_maps: &id001 config: - route_map: test1 entries: - sequence: 1 description: "test" action: permit continue: 2 on_match: next: True - route_map: test3 entries: - sequence: 1 action: permit match: rpki: invalid metric: 1 peer: 192.0.2.32 set: local_preference: 4 metric: 5 metric_type: "type-1" origin: egp originator_id: 192.0.2.34 tag: 5 weight: 4 state: merged # After State # vyos@vyos:~$ show configuration commands | match "set policy route-maps" # set policy route-map test1 rule 1 description test # set policy route-map test1 rule 1 action permit # set policy route-map test1 rule 1 continue 2 # set policy route-map test1 rule 1 on-match next # set policy route-map test3 rule 1 action permit # set policy route-map test3 rule 1 set local-preference 4 # set policy route-map test3 rule 1 set metric 5 # set policy route-map test3 rule 1 set metric-type type-1 # set policy route-map test3 rule 1 set origin egp # set policy route-map test3 rule 1 set originator-id 192.0.2.34 # set policy route-map test3 rule 1 set tag 5 # set policy route-map test3 rule 1 set weight 4 # set policy route-map test3 rule 1 match metric 1 # set policy route-map test3 rule 1 match peer 192.0.2.32 # set policy route-map test3 rule 1 match rpki invalid # "after": [ # { # "entries": [ # { # "action": "permit", # "continue_sequence": 2, # "description": "test", # "on_match": { # "next": true # }, # "sequence": 1 # } # ], # "route_map": "test1" # }, # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 1, # "peer": "192.0.2.32", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "local_preference": "4", # "metric": "5", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "5", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ], - # "before": {}, + # "before": [], # "changed": true, # "commands": [ # "set policy route-map test1 rule 1 description test", # "set policy route-map test1 rule 1 action permit", # "set policy route-map test1 rule 1 continue 2", # "set policy route-map test1 rule 1 on-match next", # "set policy route-map test3 rule 1 action permit", # "set policy route-map test3 rule 1 set local-preference 4", # "set policy route-map test3 rule 1 set metric 5", # "set policy route-map test3 rule 1 set metric-type type-1", # "set policy route-map test3 rule 1 set origin egp", # "set policy route-map test3 rule 1 set originator-id 192.0.2.34", # "set policy route-map test3 rule 1 set tag 5", # "set policy route-map test3 rule 1 set weight 4", # "set policy route-map test3 rule 1 match metric 1", # "set policy route-map test3 rule 1 match peer 192.0.2.32", # "set policy route-map test3 rule 1 match rpki invalid" # ], # Using replaced: # -------------- # Before state: # vyos@vyos:~$ show configuration commands | match "set route-map policy" # set policy route-map test2 rule 1 action 'permit' # set policy route-map test2 rule 1 description 'test' # set policy route-map test2 rule 1 on-match next # set policy route-map test2 rule 2 action 'permit' # set policy route-map test2 rule 2 on-match goto '4' # set policy route-map test3 rule 1 action 'permit' # set policy route-map test3 rule 1 match metric '1' # set policy route-map test3 rule 1 match peer '192.0.2.32' # set policy route-map test3 rule 1 match rpki 'invalid' # set policy route-map test3 rule 1 set community 'internet' # set policy route-map test3 rule 1 set ip-next-hop '192.0.2.33' # set policy route-map test3 rule 1 set local-preference '4' # set policy route-map test3 rule 1 set metric '5' # set policy route-map test3 rule 1 set metric-type 'type-1' # set policy route-map test3 rule 1 set origin 'egp' # set policy route-map test3 rule 1 set originator-id '192.0.2.34' # set policy route-map test3 rule 1 set tag '5' # set policy route-map test3 rule 1 set weight '4' # # - name: Replace the provided configuration with the existing running configuration # register: result # vyos.vyos.vyos_route_maps: &id001 # config: # - route_map: test3 # entries: # - sequence: 1 # action: permit # match: # rpki: invalid # metric: 3 # peer: 192.0.2.35 # set: # local_preference: 6 # metric: 4 # metric_type: "type-1" # origin: egp # originator_id: 192.0.2.34 # tag: 4 # weight: 4 # state: replaced # After state: # vyos@vyos:~$ show configuration commands | match "set policy route-map" # set policy route-map test3 rule 1 set local-preference 6 # set policy route-map test3 rule 1 set metric 4 # set policy route-map test3 rule 1 set tag 4 # set policy route-map test3 rule 1 match metric 3 # set policy route-map test3 rule 1 match peer 192.0.2.35 # vyos@vyos:~$ # # # Module Execution: # # "after": [ # { # "entries": [ # { # "action": "permit", # "description": "test", # "on_match": { # "next": true # }, # "sequence": 1 # }, # { # "action": "permit", # "on_match": { # "goto": 4 # }, # "sequence": 2 # } # ], # "route_map": "test2" # }, # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 3, # "peer": "192.0.2.35", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "local_preference": "6", # "metric": "4", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "4", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ], # "before": [ # { # "entries": [ # { # "action": "permit", # "description": "test", # "on_match": { # "next": true # }, # "sequence": 1 # }, # { # "action": "permit", # "on_match": { # "goto": 4 # }, # "sequence": 2 # } # ], # "route_map": "test2" # }, # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 1, # "peer": "192.0.2.32", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "community": { # "value": "internet" # }, # "ip_next_hop": "192.0.2.33", # "local_preference": "4", # "metric": "5", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "5", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ], # "changed": true, # "commands": [ # "delete policy route-map test3 rule 1 set ip-next-hop 192.0.2.33", # "set policy route-map test3 rule 1 set local-preference 6", # "set policy route-map test3 rule 1 set metric 4", # "set policy route-map test3 rule 1 set tag 4", # "delete policy route-map test3 rule 1 set community internet", # "set policy route-map test3 rule 1 match metric 3", # "set policy route-map test3 rule 1 match peer 192.0.2.35" # ], # # Using deleted: # ------------- # Before state: # vyos@vyos:~$ show configuration commands | match "set policy route-map" # set policy route-map test3 rule 1 set local-preference 6 # set policy route-map test3 rule 1 set metric 4 # set policy route-map test3 rule 1 set tag 4 # set policy route-map test3 rule 1 match metric 3 # set policy route-map test3 rule 1 match peer 192.0.2.35 # vyos@vyos:~$ # # - name: Delete the provided configuration # register: result # vyos.vyos.vyos_route_maps: # config: # state: deleted # After state: # vyos@vyos:~$ show configuration commands | match "set policy route-map" # vyos@vyos:~$ # # # Module Execution: # - # "after": {}, + # "after": [], # "before": [ # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 3, # "peer": "192.0.2.35", # }, # "sequence": 1, # "set": { # "local_preference": "6", # "metric": "4", # "tag": "4", # } # } # ], # "route_map": "test3" # } # ], # "changed": true, # "commands": [ # "delete policy route-map test3" # ], # # using gathered: # -------------- # # Before state: # vyos@vyos:~$ show configuration commands | match "set policy route-maps" # set policy route-map test1 rule 1 description test # set policy route-map test1 rule 1 action permit # set policy route-map test1 rule 1 continue 2 # set policy route-map test1 rule 1 on-match next # set policy route-map test3 rule 1 action permit # set policy route-map test3 rule 1 set local-preference 4 # set policy route-map test3 rule 1 set metric 5 # set policy route-map test3 rule 1 set metric-type type-1 # set policy route-map test3 rule 1 set origin egp # set policy route-map test3 rule 1 set originator-id 192.0.2.34 # set policy route-map test3 rule 1 set tag 5 # set policy route-map test3 rule 1 set weight 4 # set policy route-map test3 rule 1 match metric 1 # set policy route-map test3 rule 1 match peer 192.0.2.32 # set policy route-map test3 rule 1 match rpki invalid # # - name: gather configs # vyos.vyos.vyos_route_maps: # state: gathered # "gathered": [ # { # "entries": [ # { # "action": "permit", # "continue_sequence": 2, # "description": "test", # "on_match": { # "next": true # }, # "sequence": 1 # } # ], # "route_map": "test1" # }, # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 1, # "peer": "192.0.2.32", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "local_preference": "4", # "metric": "5", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "5", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ] # Using parsed: # ------------ # parsed.cfg # set policy route-map test1 rule 1 description test # set policy route-map test1 rule 1 action permit # set policy route-map test1 rule 1 continue 2 # set policy route-map test1 rule 1 on-match next # set policy route-map test3 rule 1 action permit # set policy route-map test3 rule 1 set local-preference 4 # set policy route-map test3 rule 1 set metric 5 # set policy route-map test3 rule 1 set metric-type type-1 # set policy route-map test3 rule 1 set origin egp # set policy route-map test3 rule 1 set originator-id 192.0.2.34 # set policy route-map test3 rule 1 set tag 5 # set policy route-map test3 rule 1 set weight 4 # set policy route-map test3 rule 1 match metric 1 # set policy route-map test3 rule 1 match peer 192.0.2.32 # set policy route-map test3 rule 1 match rpki invalid # # - name: parse configs # vyos.vyos.vyos_route_maps: # running_config: "{{ lookup('file', './parsed.cfg') }}" # state: parsed # tags: # - parsed # # Module execution: # "parsed": [ # { # "entries": [ # { # "action": "permit", # "continue_sequence": 2, # "description": "test", # "on_match": { # "next": true # }, # "sequence": 1 # } # ], # "route_map": "test1" # }, # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 1, # "peer": "192.0.2.32", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "local_preference": "4", # "metric": "5", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "5", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ] # # # Using rendered: # -------------- # - name: Structure provided configuration into device specific commands # register: result # vyos.vyos.vyos_route_maps: &id001 # config: # - route_map: test1 # entries: # - sequence: 1 # description: "test" # action: permit # continue_sequence: 2 # on_match: # next: True # - route_map: test3 # entries: # - sequence: 1 # action: permit # match: # rpki: invalid # metric: 1 # peer: 192.0.2.32 # set: # local_preference: 4 # metric: 5 # metric_type: "type-1" # origin: egp # originator_id: 192.0.2.34 # tag: 5 # weight: 4 # state: rendered # Module Execution: # "rendered": [ # "set policy route-map test1 rule 1 description test", # "set policy route-map test1 rule 1 action permit", # "set policy route-map test1 rule 1 continue 2", # "set policy route-map test1 rule 1 on-match next", # "set policy route-map test3 rule 1 action permit", # "set policy route-map test3 rule 1 set local-preference 4", # "set policy route-map test3 rule 1 set metric 5", # "set policy route-map test3 rule 1 set metric-type type-1", # "set policy route-map test3 rule 1 set origin egp", # "set policy route-map test3 rule 1 set originator-id 192.0.2.34", # "set policy route-map test3 rule 1 set tag 5", # "set policy route-map test3 rule 1 set weight 4", # "set policy route-map test3 rule 1 match metric 1", # "set policy route-map test3 rule 1 match peer 192.0.2.32", # "set policy route-map test3 rule 1 match rpki invalid" # ] # # # Using overridden: # -------------- # Before state: # vyos@vyos:~$ show configuration commands | match "set policy route-map" # set policy route-map test2 rule 1 action 'permit' # set policy route-map test2 rule 1 description 'test' # set policy route-map test2 rule 1 on-match next # set policy route-map test2 rule 2 action 'permit' # set policy route-map test2 rule 2 on-match goto '4' # set policy route-map test3 rule 1 action 'permit' # set policy route-map test3 rule 1 match metric '1' # set policy route-map test3 rule 1 match peer '192.0.2.32' # set policy route-map test3 rule 1 match rpki 'invalid' # set policy route-map test3 rule 1 set community 'internet' # set policy route-map test3 rule 1 set ip-next-hop '192.0.2.33' # set policy route-map test3 rule 1 set local-preference '4' # set policy route-map test3 rule 1 set metric '5' # set policy route-map test3 rule 1 set metric-type 'type-1' # set policy route-map test3 rule 1 set origin 'egp' # set policy route-map test3 rule 1 set originator-id '192.0.2.34' # set policy route-map test3 rule 1 set tag '5' # set policy route-map test3 rule 1 set weight '4' # # - name: Override the existing configuration with the provided running configuration # register: result # vyos.vyos.vyos_route_maps: &id001 # config: # - route_map: test3 # entries: # - sequence: 1 # action: permit # match: # rpki: invalid # metric: 3 # peer: 192.0.2.35 # set: # local_preference: 6 # metric: 4 # metric_type: "type-1" # origin: egp # originator_id: 192.0.2.34 # tag: 4 # weight: 4 # state: overridden # After state: # vyos@vyos:~$ show configuration commands | match "set policy route-map" # set policy route-map test3 rule 1 set metric-type 'type-1' # set policy route-map test3 rule 1 set origin 'egp' # set policy route-map test3 rule 1 set originator-id '192.0.2.34' # set policy route-map test3 rule 1 set weight '4' # set policy route-map test3 rule 1 set local-preference 6 # set policy route-map test3 rule 1 set metric 4 # set policy route-map test3 rule 1 set tag 4 # set policy route-map test3 rule 1 match metric 3 # set policy route-map test3 rule 1 match peer 192.0.2.35 # set policy route-map test3 rule 1 match rpki 'invalid' # Module Execution: # "after": [ # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 3, # "peer": "192.0.2.35", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "local_preference": "6", # "metric": "4", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "4", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ], # "before": [ # { # "entries": [ # { # "action": "permit", # "description": "test", # "on_match": { # "next": true # }, # "sequence": 1 # }, # { # "action": "permit", # "on_match": { # "goto": 4 # }, # "sequence": 2 # } # ], # "route_map": "test2" # }, # { # "entries": [ # { # "action": "permit", # "match": { # "metric": 1, # "peer": "192.0.2.32", # "rpki": "invalid" # }, # "sequence": 1, # "set": { # "community": { # "value": "internet" # }, # "ip_next_hop": "192.0.2.33", # "local_preference": "4", # "metric": "5", # "metric_type": "type-1", # "origin": "egp", # "originator_id": "192.0.2.34", # "tag": "5", # "weight": "4" # } # } # ], # "route_map": "test3" # } # ], # "changed": true, # "commands": [ # "delete policy route-map test2", # "delete policy route-map test3 rule 1 set ip-next-hop 192.0.2.33", # "set policy route-map test3 rule 1 set local-preference 6", # "set policy route-map test3 rule 1 set metric 4", # "set policy route-map test3 rule 1 set tag 4", # "delete policy route-map test3 rule 1 set community internet", # "set policy route-map test3 rule 1 match metric 3", # "set policy route-map test3 rule 1 match peer 192.0.2.35" # ], # Status ------ Authors ~~~~~~~ - Ashwini Mhatre (@amhatre)