From afacd339fece3ed5694a00f3d009de77dbccb813 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Mon, 24 Jun 2024 16:56:00 +0200 Subject: [PATCH] arista-switch: Fix eos_config call eos_config does not support provider, nor connection: local from at least 2022 [1] - since ansible>=7 (ansible-core 2.14). [1]: https://github.com/ansible-collections/arista.eos/commit/588d94b2ed22817b63f996187e7d757d3ebad725 Closes-Bug: #2058365 Change-Id: Ief37b7bee758e34dddb881a9e68728013861c0ec (cherry picked from commit 32489a45874f34414fb442cc6009857648ff25f8) --- .../inventory/group_vars/all/switches/arista | 22 ------------------- ansible/roles/arista-switch/tasks/main.yml | 4 +--- .../reference/physical-network.rst | 11 ++++------ .../notes/bug-2058365-a9acdb3cdf2a29f9.yaml | 7 ++++++ 4 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 ansible/inventory/group_vars/all/switches/arista create mode 100644 releasenotes/notes/bug-2058365-a9acdb3cdf2a29f9.yaml diff --git a/ansible/inventory/group_vars/all/switches/arista b/ansible/inventory/group_vars/all/switches/arista deleted file mode 100644 index 37d38e6de..000000000 --- a/ansible/inventory/group_vars/all/switches/arista +++ /dev/null @@ -1,22 +0,0 @@ ---- -# Switch configuration. - -############################################################################### -# Authentication configuration. - -# For Arista switches, this defines a 'provider' argument to the eos_* -# modules. -switch_arista_provider: - host: "{{ ansible_host }}" - username: "{{ ansible_user }}" - password: "{{ ansible_ssh_pass }}" - transport: cli - authorize: yes - auth_pass: "{{ switch_auth_pass }}" - timeout: "{{ switch_arista_timeout }}" - -############################################################################### -# Timeout in seconds for completion of the switch config as a transaction -switch_arista_timeout: 60 - -... diff --git a/ansible/roles/arista-switch/tasks/main.yml b/ansible/roles/arista-switch/tasks/main.yml index 7566cbfb2..7f56008df 100644 --- a/ansible/roles/arista-switch/tasks/main.yml +++ b/ansible/roles/arista-switch/tasks/main.yml @@ -1,6 +1,4 @@ --- - name: Ensure Arista switches are configured - local_action: - module: eos_config - provider: "{{ arista_switch_provider }}" + eos_config: src: arista-config.j2 diff --git a/doc/source/configuration/reference/physical-network.rst b/doc/source/configuration/reference/physical-network.rst index ef5de6f14..d7721ded8 100644 --- a/doc/source/configuration/reference/physical-network.rst +++ b/doc/source/configuration/reference/physical-network.rst @@ -193,16 +193,13 @@ modules. ``switch_type`` should be set to ``arista``. -Provider -^^^^^^^^ - * ``ansible_host`` is the hostname or IP address. Optional. - * ``ansible_user`` is the SSH username. - * ``ansible_ssh_pass`` is the SSH password. - -* ``switch_auth_pass`` is the 'enable' password. +* ``ansible_connection`` should be ``ansible.netcommon.network_cli``. +* ``ansible_network_os`` should be ``arista.eos.eos``. +* ``ansible_become`` should be ``true``. +* ``ansible_become_method`` should be ``enable``. Cumulus Linux (with NCLU) ------------------------- diff --git a/releasenotes/notes/bug-2058365-a9acdb3cdf2a29f9.yaml b/releasenotes/notes/bug-2058365-a9acdb3cdf2a29f9.yaml new file mode 100644 index 000000000..54f0bc098 --- /dev/null +++ b/releasenotes/notes/bug-2058365-a9acdb3cdf2a29f9.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + ``eos_config`` does not support the ``provider`` parameter since Ansible 7. + Users are required to update their configuration according to `Arista EOS + documentation + `_.