Skip to content

Commit

Permalink
Merge branch 'main' into multiline-code-unit
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausHolbechArista authored May 24, 2024
2 parents 2df7127 + 7a4bf24 commit 12cea9c
Show file tree
Hide file tree
Showing 14 changed files with 315 additions and 190 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ Arista Eos Collection Release Notes
.. contents:: Topics


v9.0.0
======

Major Changes
-------------

- Update the netcommon base version 6.1.0 to support cli_restore plugin.

Minor Changes
-------------

- Add support for cli_restore functionality.
- Please refer the PR to know more about core changes (https://github.com/ansible-collections/ansible.netcommon/pull/618).
- cli_restore module is part of netcommon.

v8.0.0
======

Expand Down Expand Up @@ -501,7 +516,6 @@ New Modules
- eos_acl_interfaces - ACL interfaces resource module
- eos_acls - ACLs resource module
- eos_banner - Manage multiline banners on Arista EOS devices
- eos_bgp - (deprecated, removed after 2023-01-29) Configure global BGP protocol settings on Arista EOS.
- eos_command - Run arbitrary commands on an Arista EOS device
- eos_config - Manage Arista EOS configuration sections
- eos_eapi - Manage and configure Arista EOS eAPI.
Expand All @@ -515,7 +529,6 @@ New Modules
- eos_lldp - Manage LLDP configuration on Arista EOS network devices
- eos_lldp_global - LLDP resource module
- eos_lldp_interfaces - LLDP interfaces resource module
- eos_logging - Manage logging on network devices
- eos_ospfv2 - OSPFv2 resource module
- eos_static_routes - Static routes resource module
- eos_system - Manage the system attributes on Arista EOS devices
Expand Down
20 changes: 12 additions & 8 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ releases:
- description: Manage multiline banners on Arista EOS devices
name: eos_banner
namespace: ""
- description:
(deprecated, removed after 2023-01-29) Configure global BGP protocol
settings on Arista EOS.
name: eos_bgp
namespace: ""
- description: Run arbitrary commands on an Arista EOS device
name: eos_command
namespace: ""
Expand Down Expand Up @@ -55,9 +50,6 @@ releases:
- description: LLDP interfaces resource module
name: eos_lldp_interfaces
namespace: ""
- description: Manage logging on network devices
name: eos_logging
namespace: ""
- description: OSPFv2 resource module
name: eos_ospfv2
namespace: ""
Expand Down Expand Up @@ -632,3 +624,15 @@ releases:
- remove_deprecated.yaml
- trivial_tests_updates.yaml
release_date: "2024-03-27"
9.0.0:
changes:
major_changes:
- Update the netcommon base version 6.1.0 to support cli_restore plugin.
minor_changes:
- Add support for cli_restore functionality.
- Please refer the PR to know more about core changes (https://github.com/ansible-collections/ansible.netcommon/pull/618).
- cli_restore module is part of netcommon.
fragments:
- 218sanity.yml
- add_restore_support.yaml
release_date: "2024-04-13"
3 changes: 0 additions & 3 deletions changelogs/fragments/218sanity.yml

This file was deleted.

3 changes: 3 additions & 0 deletions changelogs/fragments/lldp_timer_bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- This fix make sure to fetch timer with `lldp` string at the start.
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors:
- Ansible Network Community (ansible-network)
dependencies:
"ansible.netcommon": ">=6.0.0"
"ansible.netcommon": ">=6.1.0"
license_file: LICENSE
name: eos
description: Ansible Network Collection for Arista EOS devices.
Expand All @@ -11,4 +11,4 @@ readme: README.md
repository: https://github.com/ansible-collections/arista.eos
issues: https://github.com/ansible-collections/arista.eos/issues
tags: [arista, eos, networking, eapi]
version: 8.0.0
version: 9.0.0
6 changes: 6 additions & 0 deletions plugins/cliconf/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ def run_commands(self, commands=None, check_rc=True):
responses.append(out)
return responses

def restore(self, filename=None, path=""):
if not filename:
raise ValueError("'file_name' value is required for restore")
cmd = f"configure replace {path}{filename} best-effort"
return self.send_command(cmd)

def get_diff(
self,
candidate=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def render_config(self, spec, conf):
config = deepcopy(spec)
config["holdtime"] = utils.parse_conf_arg(conf, "hold-time")
config["reinit"] = utils.parse_conf_arg(conf, "timer reinitialization")
config["timer"] = utils.parse_conf_arg(conf, "timer")
config["timer"] = utils.parse_conf_arg(conf, "lldp timer")
if config.get("timer") and "reinitialization" in config["timer"]:
config["timer"] = None

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- ansible.builtin.debug:
msg:
Start eos_lacp_interfaces _remove_config task with ansible_connection={{
ansible_connection }}

- name: Setup - Remove lacp interfaces config
become: true
arista.eos.eos_config:
lines:
- "interface Ethernet1"
- " no lacp port-priority"
- " no lacp timer"
- "interface Ethernet2"
- " no lacp timer"

- ansible.builtin.debug:
msg: End eos_lacp_interfaces _remove_config ansible_connection={{
ansible_connection }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
- ansible.builtin.debug:
msg: START eos_lacp_interfaces deleted integration tests on connection={{
ansible_connection }}

- ansible.builtin.include_tasks: _remove_config.yaml

- ansible.builtin.include_tasks: _reset_config.yaml

- ansible.builtin.set_fact:
Expand All @@ -7,36 +13,44 @@
other_config:
- name: Ethernet2
timer: fast

- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- name: Returns vlans to default parameters
register: result
become: true
arista.eos.eos_lacp_interfaces:
config: "{{ config }}"
state: deleted

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.before)
== []

- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.after)
== []

- ansible.builtin.set_fact:
expected_config: "{{ other_config }}"

- ansible.builtin.assert:
that:
- expected_config|symmetric_difference(ansible_facts.network_resources.lacp_interfaces)
== []
- block:
- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- name: Returns vlans to default parameters
register: result
become: true
arista.eos.eos_lacp_interfaces:
config: "{{ config }}"
state: deleted

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.before)
== []

- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.after)
== []

- ansible.builtin.set_fact:
expected_config: "{{ other_config }}"

- ansible.builtin.assert:
that:
- expected_config|symmetric_difference(ansible_facts.network_resources.lacp_interfaces)
== []

always:
- ansible.builtin.include_tasks: _remove_config.yaml

- ansible.builtin.debug:
msg:
END eos_lacp_interfaces deleted integration tests on connection={{ ansible_connection
}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
START eos_lacp_interfaces gathered integration tests on connection={{ ansible_connection
}}

- ansible.builtin.include_tasks: _remove_config.yaml

- ansible.builtin.include_tasks: _reset_config.yaml

- block:
Expand All @@ -21,3 +23,10 @@
- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces == result.gathered
always:
- ansible.builtin.include_tasks: _remove_config.yaml

- ansible.builtin.debug:
msg:
END eos_lacp_interfaces gathered integration tests on connection={{ ansible_connection
}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
- ansible.builtin.debug:
msg: START eos_lacp_interfaces merged integration tests on connection={{
ansible_connection }}

- ansible.builtin.include_tasks: _remove_config.yaml

- ansible.builtin.include_tasks: _reset_config.yaml

- ansible.builtin.set_fact:
Expand All @@ -9,38 +15,47 @@
- name: Ethernet2
timer: normal

- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- name: Merge provided configuration with device configuration
register: result
become: true
arista.eos.eos_lacp_interfaces:
config: "{{ config }}"
state: merged

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.before)
== []

- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.after)
== []

- ansible.builtin.set_fact:
expected_config:
- name: Ethernet1
port_priority: 30
timer: fast

- ansible.builtin.assert:
that:
- expected_config|symmetric_difference(ansible_facts.network_resources.lacp_interfaces)
== []
- block:
- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- name: Merge provided configuration with device configuration
register: result
become: true
arista.eos.eos_lacp_interfaces:
config: "{{ config }}"
state: merged

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.before)
== []

- become: true
arista.eos.eos_facts:
gather_network_resources: lacp_interfaces

- ansible.builtin.assert:
that:
- ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.after)
== []

- ansible.builtin.set_fact:
expected_config:
- name: Ethernet1
port_priority: 30
timer: fast

- ansible.builtin.assert:
that:
- expected_config|symmetric_difference(ansible_facts.network_resources.lacp_interfaces)
== []

always:
- ansible.builtin.include_tasks: _remove_config.yaml

- ansible.builtin.debug:
msg:
END eos_lacp_interfaces merged integration tests on connection={{ ansible_connection
}}
Loading

0 comments on commit 12cea9c

Please sign in to comment.