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

iosxr_l2_interfaces - issue with multiple action states #379

Closed
KB-perByte opened this issue Apr 21, 2023 · 2 comments · Fixed by #392
Closed

iosxr_l2_interfaces - issue with multiple action states #379

KB-perByte opened this issue Apr 21, 2023 · 2 comments · Fixed by #392
Assignees
Labels
bug This issue/PR relates to a bug. l2_interfaces l2_interfaces resource module

Comments

@KB-perByte
Copy link
Collaborator

KB-perByte commented Apr 21, 2023

SUMMARY

Action states do not produce valid configuration commands and muliple tracebacks

ISSUE TYPE
  • Bug Report
COMPONENT NAME

l2_interfaces

ANSIBLE VERSION
N/R
COLLECTION VERSION
cisco.iosxr 5.0.1
CONFIGURATION

OS / ENVIRONMENT
Cisco IOS XR Software, Version 7.0.2
Copyright (c) 2013-2020 by Cisco Systems, Inc.

Build Information:
 Built By     : ahoang
 Built On     : Fri Mar 13 22:27:54 PDT 2020
 Built Host   : iox-ucs-029
 Workspace    : /auto/srcarchive15/prod/7.0.2/xrv9k/ws
 Version      : 7.0.2
 Location     : /opt/cisco/XR/packages/
 Label        : 7.0.2

cisco IOS-XRv 9000 () processor
System uptime is 9 weeks 5 days 5 hours 6 minutes

STEPS TO REPRODUCE

Playbooks added here are out of module examples

- name: Merge provided configuration with device configuration
  cisco.iosxr.iosxr_l2_interfaces:
    config:
    - name: GigabitEthernet0/0/0/3
      native_vlan: 20
    - name: GigabitEthernet0/0/0/4
      native_vlan: 40
      l2transport: true
      l2protocol:
      - stp: tunnel
    - name: GigabitEthernet0/0/0/3.900
      l2transport: true
      q_vlan:
      - 20
      - 40
    state: merged

errors out as

fatal: [10.0.150.231]: FAILED! => changed=false 
  module_stderr: '''NoneType'' object is not iterable'
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error

replaced state

- name: Replaces device configuration of listed interfaces with provided configuration
  cisco.iosxr.iosxr_l2_interfaces:
    config:
    - name: GigabitEthernet0/0/0/4
      native_vlan: 40
      l2transport: true
      l2protocol:
      - stp: forward
    - name: GigabitEthernet0/0/0/3.900
      q_vlan:
      - 20
      - any
    state: replaced

errors out with q_vlan value as any

  invocation:
    module_args:
      config:
      - encapsulation: null
        l2protocol:
        - cdp: null
          cpsv: null
          pvst: null
          stp: forward
          vtp: null
        l2transport: true
        name: GigabitEthernet0/0/0/4
        native_vlan: 40
        propagate: null
        q_vlan: null
      - encapsulation: null
        l2protocol: null
        l2transport: null
        name: GigabitEthernet0/0/0/3.900
        native_vlan: null
        propagate: null
        q_vlan:
        - 20
      running_config: null
      state: replaced
  msg: 'Elements value for option ''q_vlan'' found in ''config'' is of type <class ''ansible.parsing.yaml.objects.AnsibleUnicode''> and we were unable to convert to int: <class ''ansible.parsing.yaml.objects.AnsibleUnicode''> cannot be converted to an int

also, if any from q_vlan is removed

  module_stderr: |-
    l2transport l2protocol cpsv None
                                                             ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:ios(config-if)#
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error

notes -
the condition gets none at l2protocol
https://github.com/KB-perByte/iosxr/blob/5232275fcae9b9e928e145c74659d4a15e573662/plugins/module_utils/network/iosxr/config/l2_interfaces/l2_interfaces.py#L317

                if l2transport or l2protocol:
                    if not l2protocol:
                        l2protocol = []
                    for each in l2protocol:
                        each = dict(each)
EXPECTED RESULTS
ACTUAL RESULTS

@KB-perByte KB-perByte added the l2_interfaces l2_interfaces resource module label Apr 21, 2023
@ashwini-mhatre
Copy link
Collaborator

@KB-perByte native-vlan, l2protocol cdp,pvst,stp,vtp only available for xr version< 7.0.0

@KB-perByte
Copy link
Collaborator Author

@ashwini-mhatre should we have those options in examples? and what is the sope of the supported versions for XR?

@Qalthos Qalthos added the bug This issue/PR relates to a bug. label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. l2_interfaces l2_interfaces resource module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants