ansible-collections / dellemc.os10

GNU General Public License v3.0
40 stars 49 forks source link

Role os10_interface ignore configuration when fanout is used #59

Closed MarkOtii76 closed 3 years ago

MarkOtii76 commented 3 years ago
SUMMARY

When configuring interfaces of some Dell S4112F-ON and Dell S4148F-ON the remaining config keys (e. g. interface description) where not applied, when the key 'fanout' is used.

ISSUE TYPE
COMPONENT NAME

dellemc.os10.os10_interface

ANSIBLE VERSION
ansible 2.10.3
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.8/site-packages/ansible
  executable location = /home/user/.local/bin/ansible
  python version = 3.8.6 (default, Sep 25 2020, 09:36:53) [GCC 10.2.0]
CONFIGURATION
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/home/user/ansible/hosts']
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/ansible.cfg) = /home/user/ansible/ansible-vault.pass
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT

Target Version of OS Version: 10.5.2.0P1 and 10.4.3.4

STEPS TO REPRODUCE
# file: playbook.yaml

# Global configuration of all Dell OS10 based switches
- hosts: dell_os10
  roles:
    - dellemc.os10.os10_interface

---
# file: group_vars/serveraccess/07-os10_interface.yml

os10_interface:
  ethernet 1/1/15:
    desc: "VLTi"
    switchport: False
    fanout: 40g-1x
    state: present
  ethernet 1/1/13:
    desc: "CoreSW01"
    switchport: False
    fanout: 40g-1x
    admin: up
    state: present
  ethernet 1/1/14:
    desc: "CoreSW02"
    switchport: False
    fanout: 40g-1x
    admin: up
    state: present
EXPECTED RESULTS

I am expecting the description on the interface after play ...

ACTUAL RESULTS

... but no configuration of the description happened.

TASK [dellemc.os10.os10_interface : Provisioning interface configuration for os10] *********************************************************************
task path: /home/user/.ansible/collections/ansible_collections/dellemc/os10/roles/os10_interface/tasks/main.yml:11
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<10.0.8.20> attempting to start connection
<10.0.8.20> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /home/user/.local/bin/ansible-connection
<10.0.8.20> found existing local domain socket, using it!
<10.0.8.20> updating play_context for connection
<10.0.8.20>
<10.0.8.20> local domain socket path is /home/user/.ansible/pc/ffd87a4f2f
redirecting (type: action) dellemc.os10.os10_config to dellemc.os10.os10
redirecting (type: action) dellemc.os10.os10_config to dellemc.os10.os10
<10.0.8.20> ESTABLISH LOCAL CONNECTION FOR USER: user
<10.0.8.20> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-local-6422174krdwt `"&& mkdir "` echo /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253 `" && echo ansible-tmp-1608043689.8234322-6524-255594980945253="` echo /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253 `" ) && sleep 0'
Using module file /home/user/.ansible/collections/ansible_collections/dellemc/os10/plugins/modules/os10_config.py
<10.0.8.20> PUT /home/user/.ansible/tmp/ansible-local-6422174krdwt/tmpz00gktqs TO /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253/AnsiballZ_os10_config.py
<10.0.8.20> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253/ /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253/AnsiballZ_os10_config.py && sleep 0'
<10.0.8.20> EXEC /bin/sh -c '/usr/bin/python /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253/AnsiballZ_os10_config.py && sleep 0'
<10.0.8.20> EXEC /bin/sh -c 'rm -f -r /home/user/.ansible/tmp/ansible-local-6422174krdwt/ansible-tmp-1608043689.8234322-6524-255594980945253/ > /dev/null 2>&1 && sleep 0'
changed: [S4112FSW01] => {
    "changed": true,
    "commands": [
        "interface breakout 1/1/15 map 40g-1x",
        "interface breakout 1/1/13 map 40g-1x",
        "interface breakout 1/1/14 map 40g-1x"
    ],
    "invocation": {
        "module_args": {
            "after": null,
            "backup": false,
            "backup_options": null,
            "before": null,
            "config": null,
            "lines": null,
            "match": "line",
            "parents": null,
            "provider": null,
            "replace": "line",
            "save": false,
            "src": "interface breakout 1/1/15 map 40g-1x\ninterface breakout 1/1/13 map 40g-1x\ninterface breakout 1/1/14 map 40g-1x\n",
            "update": "merge"
        }
    },
    "saved": false,
    "updates": [
        "interface breakout 1/1/15 map 40g-1x",
        "interface breakout 1/1/13 map 40g-1x",
        "interface breakout 1/1/14 map 40g-1x"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP *********************************************************************************************************************************************
S4112FSW01                  : ok=2    changed=1    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0
gunasekaran-t commented 3 years ago

@MarkOtii76 Other configurations are skipped based on the assumption that breakout will eventually make the interface name invalid and create new interfaces. As a workaround you can do fanout using os10_config module as below and keep the interface configs to os10_interface role.

    - os10_config:
        commands:
          - interface breakout 1/1/15 map 40g-1x
          - interface breakout 1/1/13 map 40g-1x
          - interface breakout 1/1/14 map 40g-1x

I understand this includes some additional steps. We will try to come up with better approach for breakouts.