ansible-collections / dellemc.os10

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

dellemc.OS10 version 1.2.0 has an old netcommon version as a dependency #147

Closed irgama closed 9 months ago

irgama commented 1 year ago
SUMMARY

When installing 1.2.0 of this collection, it downloads netcommon 2.6.1 as a dependency. The latest version of netcommon is 4.6.1, which version 1.1.1 would grab as a dependency.

This needs to be changed: dependencies: ansible.netcommon: '>=2.0.0,<3.0.0'

ISSUE TYPE
COMPONENT NAME

galaxy.yaml for the collection

ANSIBLE VERSION

ansible [core 2.14.4] config file = /var/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.9.16 (main, Mar 29 2023, 03:56:49) [GCC 8.5.0 20210514 (Red Hat 8.5.0-16)] (/usr/local/bin/python3.9) jinja version = 3.1.2 libyaml = True

COLLECTION VERSION

1.2.0

OS / ENVIRONMENT

UBI8, configuring Dell OS10 10.5.5

STEPS TO REPRODUCE

ansible-galaxy collection install dellemc.os10

EXPECTED RESULTS

ansible.netcommon 4.1.0

ACTUAL RESULTS

ansible.netcommon 2.6.1

irgama commented 1 year ago

I am going back to 1.1.1, as 1.2.0 has broken a number of very basic functionalities. I noticed this because the old versions of netcommon call for paramiko, while the new versions call for libssh.

If anyone else runs into this issue, the fix is to add the following parameter: ansible_network_cli_ssh_type: libssh

prasadapr commented 1 year ago

Hi @irgama, Pls can you install the latest OS10 collection 1.2.2. we have installed latest collections (1.2.2) on Ansible-core version - 2.14.0 and not observed any issues.

prasadapr commented 1 year ago

Pls find the enclosed logs/details for the details:

root@ubuntu22-vm-38-27:~# ansible  --version
ansible [core 2.14.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
root@ubuntu22-vm-38-27:~# 

root@ubuntu22-vm-38-27:~# cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@ubuntu22-vm-38-27:~# 

root@ubuntu22-vm-38-27:~# 
root@ubuntu22-vm-38-27:~# ansible-galaxy collection install dellemc.os10
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/dellemc-os10-1.2.2.tar.gz to /root/.ansible/tmp/ansible-local-1364499n6arrqy5/tmp5jl4r1q3/dellemc-os10-1.2.2-gcr2mgko
Installing 'dellemc.os10:1.2.2' to '/root/.ansible/collections/ansible_collections/dellemc/os10'
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-netcommon-2.6.1.tar.gz to /root/.ansible/tmp/ansible-local-1364499n6arrqy5/tmp5jl4r1q3/ansible-netcommon-2.6.1-b5lfmaee
dellemc.os10:1.2.2 was installed successfully
Installing 'ansible.netcommon:2.6.1' to '/root/.ansible/collections/ansible_collections/ansible/netcommon'
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-2.11.0.tar.gz to /root/.ansible/tmp/ansible-local-1364499n6arrqy5/tmp5jl4r1q3/ansible-utils-2.11.0-mibkvk4o
ansible.netcommon:2.6.1 was installed successfully
Installing 'ansible.utils:2.11.0' to '/root/.ansible/collections/ansible_collections/ansible/utils'
ansible.utils:2.11.0 was installed successfully
root@ubuntu22-vm-38-27:~# 

root@ubuntu22-vm-38-27:~# ansible-galaxy collection list
# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 2.6.1  
ansible.utils     2.11.0 
dellemc.os10      1.2.2  
root@ubuntu22-vm-38-27:~# 
prasadapr commented 1 year ago

Hi @irgama,

Pls can you share/provide the execution steps, where you have observed the below one as you mentioned above. if you share the execution logs, it will be easy to reproduce. The below line i have copy pasted here: I noticed this because the old versions of netcommon call for paramiko, while the new versions call for libssh

lucastobey commented 1 year ago

@prasadapr He is saying in collection ansible.netcommon v3.0.0+ they have defaulted to using ansible-pylibssh. It's an improvement over paramiko in many ways, see here: https://www.ansible.com/blog/whats-new-network-automation-with-ansible.netcommon-3.0.0

Also on this older 2.6.0 version I am constantly getting the following error after every task using os10_config: [WARNING]: The "network_cli" connection plugin has an improperly configured remote target value, forcing "inventory_hostname" templated value instead of the string

This is using the v1.2.2 of the collection and ansible core 2.15.5

prasadapr commented 1 year ago

Hi @lucastobey, thanks for your update.

From your update, observed two things:

1. regarding the ansible.netcommon version

we can update ansible.netcommon version in the galaxy.com, that's fine. defaulted to using ansible-pylibssh - not getting clearly. It means we have to install "ansible-pylibssh" and execute the playbook.

2. Regarding older 2.6.0 version I am constantly getting the following error after every task using os10_config"

I have executed the playbook with os10_config and not observed any issue. I am not observed any warning message what you have mentioned. Please find my details and any thing missing pls let me know:


root@ubuntu22-vm-38-48:~/os10-collections# ansible --version
ansible [core 2.15.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
root@ubuntu22-vm-38-48:~/os10-collections# 

root@ubuntu22-vm-38-48:~/os10-collections# ansible-galaxy collection list

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 2.6.1  
ansible.utils     2.11.0 
dellemc.os10      1.2.2  
root@ubuntu22-vm-38-48:~/os10-collections# 

root@ubuntu22-vm-38-48:~/os10-collections# cat  os10_config_cmds.yaml 
---
- name: configurep multiple config cmds
  hosts: leaf
  gather_facts: false
  connection: network_cli
  collections:
   - dellemc.os10

  tasks:
   - name: Flowcontrol ethernet 1/1/4
     os10_config:
       lines:
         - flowcontrol receive on
         - flowcontrol transmit off
       before: ['interface ethernet 1/1/4']
root@ubuntu22-vm-38-48:~/os10-collections# 

root@ubuntu22-vm-38-48:~/os10-collections# ansible-playbook -i inventory.yaml os10_config_cmds.yaml  -vvv
ansible-playbook [core 2.15.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /root/os10-collections/inventory.yaml as it did not pass its verify_file() method
script declined parsing /root/os10-collections/inventory.yaml as it did not pass its verify_file() method
Parsed /root/os10-collections/inventory.yaml inventory source with ini plugin
redirecting (type: action) dellemc.os10.os10_config to dellemc.os10.os10
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: os10_config_cmds.yaml ************************************************************************************************************************************************************
1 plays in os10_config_cmds.yaml

PLAY [configurep multiple config cmds] *****************************************************************************************************************************************************
redirecting (type: action) dellemc.os10.os10_config to dellemc.os10.os10

TASK [Flowcontrol ethernet 1/1/4] **********************************************************************************************************************************************************
task path: /root/os10-collections/os10_config_cmds.yaml:10
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
redirecting (type: action) dellemc.os10.os10_config to dellemc.os10.os10
redirecting (type: action) dellemc.os10.os10_config to dellemc.os10.os10
<100.104.94.11> ESTABLISH LOCAL CONNECTION FOR USER: root
<100.104.94.11> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-14258797b_2uv4y `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026 `" && echo ansible-tmp-1698841087.5761042-1425883-221172546959026="` echo /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026 `" ) && sleep 0'
Using module file /root/.ansible/collections/ansible_collections/dellemc/os10/plugins/modules/os10_config.py
<100.104.94.11> PUT /root/.ansible/tmp/ansible-local-14258797b_2uv4y/tmpwm407i8y TO /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026/AnsiballZ_os10_config.py
<100.104.94.11> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026/ /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026/AnsiballZ_os10_config.py && sleep 0'
<100.104.94.11> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026/AnsiballZ_os10_config.py && sleep 0'
<100.104.94.11> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-14258797b_2uv4y/ansible-tmp-1698841087.5761042-1425883-221172546959026/ > /dev/null 2>&1 && sleep 0'
changed: [leaf] => {
    "changed": true,
    "commands": [
        "interface ethernet 1/1/4",
        "flowcontrol receive on",
        "flowcontrol transmit off",
        "commit"
    ],
    "invocation": {
        "module_args": {
            "after": null,
            "backup": false,
            "backup_options": null,
            "before": [
                "interface ethernet 1/1/4"
            ],
            "config": null,
            "lines": [
                "flowcontrol receive on",
                "flowcontrol transmit off"
            ],
            "match": "line",
            "parents": null,
            "provider": null,
            "replace": "line",
            "save": false,
            "src": null,
            "update": "merge"
        }
    },
    "saved": false,
    "updates": [
        "interface ethernet 1/1/4",
        "flowcontrol receive on",
        "flowcontrol transmit off",
        "commit"
    ]
}

PLAY RECAP *********************************************************************************************************************************************************************************
leaf                       : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

root@ubuntu22-vm-38-48:~/os10-collections# 
lucastobey commented 1 year ago

@prasadapr There must be a bug in the network_cli which is part of ansible.netcommon in the older version which is causing my issue as I don't have this warning when using newer versions of netcommon.

prasadapr commented 1 year ago

Hi @lucastobey, still i am not getting how they are getting the issue. if we know the steps to reproduce the issue, we can try to fix the issue. same configuration we are using and not getting the issue.

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 2.6.1  
ansible.utils     2.11.0 
dellemc.os10      1.2.2  
root@ubuntu22-vm-38-48:~/os10-collections# 

Pls can you help me how to reproduce this issue

lucastobey commented 1 year ago

@prasadapr can't say. I'm sure there's a bug in the netcommon collection version that's required today by this dellemc collection. I did a bit of searching and found a few issues in netcommon that potentially point to it, but didn't look into them in great detail. Not sure what's different about my setup vs yours and why I get the warning with network_cli. I do know an upgrade to the netcommon collection fixes the issue which is one of the reasons I suggest to consider upgrading it (alongside the original reasons of @irgama).

Shourai commented 11 months ago

I also came across this and is breaking installs when you add packages that require netcommon versions higher than 3. This means you cannot install this and for example https://github.com/ansible-collections/cisco.ios. Since you cannot meet the requirement ansible.netcommon: '>=2.0.0,<3.0.0' and >=6.0.0

prasadapr commented 9 months ago

Hi @irgama, As per the Issue done the changes and fixed the issue in the latest ansible collection version #1.2.4.


[root@ubuntu22-vm-38-27:~/release_1_2_4/dellemc.os10#](mailto:root@ubuntu22-vm-38-27:~/release_1_2_4/dellemc.os10) cat galaxy.yml 
dependencies:
  ansible.netcommon: '>=2.0.0,<5.0.0'
description: Ansible Network Collection for Dell EMC SmartFabric OS10
license_file: LICENSE
name: os10
namespace: dellemc
readme: README.md
tags: [dell, dellemc, os10, emc, networking]
version: 1.2.4

root@ubuntu22-vm-38-27:~# ansible-galaxy collection install dellemc.os10
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/dellemc-os10-1.2.4.tar.gz to /root/.ansible/tmp/ansible-local-376826zp23aq2u/tmpeoza5avj/dellemc-os10-1.2.4-kke247zq
Installing 'dellemc.os10:1.2.4' to '/root/.ansible/collections/ansible_collections/dellemc/os10'
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-netcommon-4.1.0.tar.gz to /root/.ansible/tmp/ansible-local-376826zp23aq2u/tmpeoza5avj/ansible-netcommon-4.1.0-iulwzpxk
dellemc.os10:1.2.4 was installed successfully
Installing 'ansible.netcommon:4.1.0' to '/root/.ansible/collections/ansible_collections/ansible/netcommon'
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-3.0.0.tar.gz to /root/.ansible/tmp/ansible-local-376826zp23aq2u/tmpeoza5avj/ansible-utils-3.0.0-e4z507uu
ansible.netcommon:4.1.0 was installed successfully
Installing 'ansible.utils:3.0.0' to '/root/.ansible/collections/ansible_collections/ansible/utils'
ansible.utils:3.0.0 was installed successfully
root@ubuntu22-vm-38-27:~# 

root@ubuntu22-vm-38-27:~# ansible-galaxy collection list
# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 4.1.0  
ansible.utils     3.0.0  
dellemc.os10      1.2.4  
root@ubuntu22-vm-38-27:~#
prasadapr commented 9 months ago

Hi @irgama / @lucastobey, issue got addressed. so shall we close this Issue.

irgama commented 9 months ago

Yes

On Thu, Jan 25, 2024, 4:08 AM prasadapr @.***> wrote:

Hi @irgama https://github.com/irgama / @lucastobey https://github.com/lucastobey, issue got addressed. so shall we close this Issue.

— Reply to this email directly, view it on GitHub https://github.com/ansible-collections/dellemc.os10/issues/147#issuecomment-1909708535, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFM6H2ZI72JMYJ5I5T7DSDYQIOJXAVCNFSM6AAAAAA33LVZGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBZG4YDQNJTGU . You are receiving this because you were mentioned.Message ID: @.***>

prasadapr commented 9 months ago

Hi @irgama / @lucastobey, Thanks for the confirmation. so closing this issue.