Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eos_vlans not reporting state parameter #61244

Closed
IPvSean opened this issue Aug 23, 2019 · 4 comments · Fixed by #61432
Closed

eos_vlans not reporting state parameter #61244

IPvSean opened this issue Aug 23, 2019 · 4 comments · Fixed by #61432
Assignees
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.

Comments

@IPvSean
Copy link
Contributor

IPvSean commented Aug 23, 2019

SUMMARY

Arista vEOS reports a state (active) but the eos_facts module is returning nothing

ISSUE TYPE
  • Bug Report
COMPONENT NAME

eos_facts
eos_vlans

ANSIBLE VERSION
[student1@ansible ~]$ ansible --version
ansible 2.9.0.dev0
  config file = /home/student1/.ansible.cfg
  configured module search path = [u'/home/student1/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/student1/.local/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION
[student1@ansible ~]$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/home/student1/.ansible.cfg) = [u'/home/student1/networking-workshop/lab_inventory/hosts']
DEFAULT_STDOUT_CALLBACK(/home/student1/.ansible.cfg) = yaml
DEFAULT_TIMEOUT(/home/student1/.ansible.cfg) = 60
DEPRECATION_WARNINGS(/home/student1/.ansible.cfg) = False
HOST_KEY_CHECKING(/home/student1/.ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/home/student1/.ansible.cfg) = 60
PERSISTENT_CONNECT_TIMEOUT(/home/student1/.ansible.cfg) = 60
RETRY_FILES_ENABLED(/home/student1/.ansible.cfg) = False
OS / ENVIRONMENT
[student1@ansible ~]$ cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Red Hat Enterprise Linux Server release 7.6 (Maipo)
STEPS TO REPRODUCE
[student1@ansible ~]$ cat eos_vlans.yml
---
- hosts: rtr2
  gather_facts: false
  tasks:
    - name: grab info
      eos_facts:
        gather_subset: min
        gather_network_resources: vlans

    - debug:
        var: ansible_network_resources
EXPECTED RESULTS

state: active for corresponding vlans

ACTUAL RESULTS

playbook output

[student1@ansible ~]$ ansible-playbook eos_vlans.yml

PLAY [rtr2] *********************************************************************************************************************

TASK [grab info] ****************************************************************************************************************
 [WARNING]: default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards

ok: [rtr2]

TASK [debug] ********************************************************************************************************************
ok: [rtr2] =>
  ansible_network_resources:
    vlans:
    - vlan_id: 2
    - vlan_id: 3
    - vlan_id: 4
    - vlan_id: 5
    - vlan_id: 100

PLAY RECAP **********************************************************************************************************************
rtr2                       : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

output from switch clearly shows state

[student1@ansible ~]$ ssh rtr2
Last login: Fri Aug 23 19:44:33 2019 from 18.222.116.40
rtr2>en
rtr2#show vlan
VLAN  Name                             Status    Ports
----- -------------------------------- --------- -------------------------------
1     default                          active
2     VLAN0002                         active
3     VLAN0003                         active
4     VLAN0004                         active
5     VLAN0005                         active
100   VLAN0100                         active
@ansibot
Copy link
Contributor

ansibot commented Aug 23, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Aug 23, 2019

@ansibot
Copy link
Contributor

ansibot commented Aug 23, 2019

@IPvSean, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. labels Aug 23, 2019
@IPvSean
Copy link
Contributor Author

IPvSean commented Aug 23, 2019

I still believe this is a bug... b/c we can never read the state parameter if its active... but here is another bug imho

[student1@ansible ~]$ cat vlan.yml
---
- hosts: rtr2
  gather_facts: false
  vars:
    vlans:
      - vlan_id: 2
      - vlan_id: 3
      - vlan_id: 4
      - vlan_id: 100
      - state: suspend
        vlan_id: 5
  tasks:
    - name: grab info
      eos_vlans:
        config: "{{vlans}}"

the data model won't work b/c it EXPECTS A STATE which we can't read:

TASK [grab info] ****************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: rtr2(config-s-ansibl-vlan-100)#
---
fatal: [rtr2]: FAILED! => changed=false
  ansible_facts:
    discovered_interpreter_python: /usr/bin/python
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/student1/.ansible/tmp/ansible-local-7860LpyRj6/ansible-tmp-1566593684.25-260038714733063/AnsiballZ_eos_vlans.py", line 125, in <module>
        _ansiballz_main()
      File "/home/student1/.ansible/tmp/ansible-local-7860LpyRj6/ansible-tmp-1566593684.25-260038714733063/AnsiballZ_eos_vlans.py", line 117, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/student1/.ansible/tmp/ansible-local-7860LpyRj6/ansible-tmp-1566593684.25-260038714733063/AnsiballZ_eos_vlans.py", line 54, in invoke_module
        imp.load_module('__main__', mod, module, MOD_DESC)
      File "/tmp/ansible_eos_vlans_payload_ki7wvS/__main__.py", line 240, in <module>
      File "/tmp/ansible_eos_vlans_payload_ki7wvS/__main__.py", line 235, in main
      File "/tmp/ansible_eos_vlans_payload_ki7wvS/ansible_eos_vlans_payload.zip/ansible/module_utils/network/eos/config/vlans/vlans.py", line 61, in execute_module
      File "/tmp/ansible_eos_vlans_payload_ki7wvS/ansible_eos_vlans_payload.zip/ansible/module_utils/connection.py", line 186, in __rpc__
    ansible.module_utils.connection.ConnectionError: state None
    % Invalid input
    rtr2(config-s-ansibl-vlan-100)#
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

Qalthos added a commit to Qalthos/ansible that referenced this issue Aug 28, 2019
@ansibot ansibot added the has_pr This issue has an associated PR. label Aug 28, 2019
@Qalthos Qalthos removed the needs_triage Needs a first human triage before being processed. label Aug 28, 2019
Qalthos added a commit that referenced this issue Aug 28, 2019
adharshsrivatsr pushed a commit to adharshsrivatsr/ansible that referenced this issue Sep 3, 2019
anas-shami pushed a commit to anas-shami/ansible that referenced this issue Sep 23, 2019
@ansible ansible locked and limited conversation to collaborators Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants