Open k-304 opened 2 years ago
@k-304 I am unable to reproduce this issue with the configs you provided.
Following is my env. Let me know if you are still seeing the issue.
[eos]
x.x.x.x
[eos:vars]
ansible_network_os=arista.eos.eos
ansible_user=ansible
ansible_ssh_pass=ansible
ansible_become=true
ansible_become_method=enable
ansible_become_pass=admin
ansible_connection=ansible.netcommon.httpapi
ansible_password: !vault |
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ANSIBLE_EOS_USE_SESSIONS: 1
[all:vars]
ansible_python_interpreter=python
---
- hosts: eos
gather_facts: false
tasks:
- name: Gather facts from Arista Switch
arista.eos.eos_facts:
- arista.eos.eos_banner:
banner: login
text: sometext
ansible [core 2.11.0b4] (ans-2.11 ae90774f2b) last updated 2021/04/06 21:49:40 (GMT -400)
config file = /home/gosriniv/github/ansible.cfg
configured module search path = ['/home/gosriniv/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/gosriniv/Project/ansible/lib/ansible
ansible collection location = /home/gosriniv/.ansible/collections:/usr/share/ansible/collections
executable location = /home/gosriniv/.pyenv/versions/ansible-3.8.0-pyenv-venv/bin/ansible
python version = 3.8.0 (default, Oct 15 2021, 11:50:09) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
jinja version = 3.0.2
libyaml = True
Could be related to this: https://github.com/ansible/ansible/issues/75503
SUMMARY
I use Ansible 2.11 to connect to an Arista Switch (7050) eOS v 1.18.1 using the eAPI. I used the notes at this page to define connection Vars.
I wrote a playbook with 2 simple tasks:
The "Gather Facts" command completes successfully, but the Banner (or any other module used) fails with an "401 Unauthorized". Whenever I add a 2nd or 3rd Task, it seems like it is no longer authenticated. If I Switch banner / get facts, the banner works, the get Facts doesn't anymore.
ISSUE TYPE
COMPONENT NAME
arista.eos arista.eos.eos_facts arista.eos.eos_banner
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible Host: Debian 10 with PyEnv Target: Arista 7050S-64 (eOS 1.18.1.1F)
STEPS TO REPRODUCE
Gonna add some more Playbook data in here: Group_Var/connection.yml
The Playbook:
ACTUAL RESULTS