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

[BUG]: sonic_vrfs module doesn't work with the "state: overridden" #292

Closed
guertinf opened this issue Aug 24, 2023 · 5 comments
Closed

[BUG]: sonic_vrfs module doesn't work with the "state: overridden" #292

guertinf opened this issue Aug 24, 2023 · 5 comments
Assignees

Comments

@guertinf
Copy link

Bug Description

this ansible task, similar to the one in documentation", fails

- name: Configure vrf
  dellemc.enterprise_sonic.sonic_vrfs:
    state: "overridden"
    config:
      - name: Vrf-1G
        members:
          interfaces:
            - name: "Eth1/3"

with this message

fatal: [dell-sonic]: FAILED! => {
"changed": false,
"module_stderr": "argument of type 'NoneType' is not iterable",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}

The same task is working with the state set to deleted or merged.

Product Name

Dell Enterprise Sonic

Component or Module Name

dellemc.enterprise_sonic.sonic_vrfs

DellEMC Enterprise SONiC Ansible Collection Version

dellemc.enterprise_sonic 2.2.0

SONiC Software Version

Software Version : 4.1.0-Edge_Standard

Configuration

CONFIG_FILE() = /home/guertinf/reseautique-CQ/ansible.cfg
DEFAULT_HOST_LIST(/home/guertinf/reseautique-CQ/ansible.cfg) = ['/home/guertinf/reseautique-CQ/inventory']
DEFAULT_ROLES_PATH(/home/guertinf/reseautique-CQ/ansible.cfg) = ['/home/guertinf/reseautique-CQ/roles']
PARAMIKO_HOST_KEY_AUTO_ADD(/home/guertinf/reseautique-CQ/ansible.cfg) = True
PERSISTENT_CONNECT_TIMEOUT(/home/guertinf/reseautique-CQ/ansible.cfg) = 120

Steps to Reproduce

The ansible playbook

---
- name: "Sonic playbook"
  hosts: sonic
  remote_user: admin
  gather_facts: false
  connection: httpapi
  vars:
    ansible_network_os: dellemc.enterprise_sonic.sonic
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
  roles:
    - sonic_vrf

and this role/task

- name: Configure vrf
  dellemc.enterprise_sonic.sonic_vrfs:
    state: "overridden"
    config:
      - name: Vrf-1G
        members:
          interfaces:
            - name: "Eth1/3"

See the result in the log boxe.

Expected Behavior

The sonic_vrfs module works fine with the staes "merged" and "deleted". The vrf is created or remove as expected.

Actual Behavior

It crashes with the state "overridden" with the message

fatal: [dell-sonic]: FAILED! => {
    "changed": false,
    "module_stderr": "argument of type 'NoneType' is not iterable",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}

Logs

$ ANSIBLE_NETWORK_GROUP_MODULES=sonic ansible-playbook playbook/sonic.yml --limit dell-sonic --ask-vault-pass --ask-become --ask-pass -vvvv
ansible-playbook [core 2.15.0]
  config file = /home/guertinf/reseautique-CQ/ansible.cfg
  configured module search path = ['/home/guertinf/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/guertinf/ansible2.15/lib64/python3.11/site-packages/ansible
  ansible collection location = /home/guertinf/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/guertinf/ansible2.15/bin/ansible-playbook
  python version = 3.11.2 (main, Feb 18 2023, 08:12:16) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/home/guertinf/ansible2.15/bin/python)
  jinja version = 3.1.2
  libyaml = True
Using /home/guertinf/reseautique-CQ/ansible.cfg as config file
SSH password: 
BECOME password[defaults to SSH password]: 
Vault password: 
setting up inventory plugins
Loading collection ansible.builtin from 
host_list declined parsing /home/guertinf/reseautique-CQ/inventory as it did not pass its verify_file() method
script declined parsing /home/guertinf/reseautique-CQ/inventory as it did not pass its verify_file() method
auto declined parsing /home/guertinf/reseautique-CQ/inventory as it did not pass its verify_file() method
Parsed /home/guertinf/reseautique-CQ/inventory inventory source with ini plugin
Loading collection dellemc.enterprise_sonic from /home/guertinf/.ansible/collections/ansible_collections/dellemc/enterprise_sonic
redirecting (type: action) dellemc.enterprise_sonic.sonic_vrfs to dellemc.enterprise_sonic.sonic
Loading callback plugin default of type stdout, v2.0 from /home/guertinf/ansible2.15/lib64/python3.11/site-packages/ansible/plugins/callback/default.py
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: sonic.yml ***********************************************************************************************************************************************************
Positional arguments: playbook/sonic.yml
verbosity: 4
connection: smart
timeout: 10
ask_pass: True
become_method: sudo
become_ask_pass: True
tags: ('all',)
inventory: ('/home/guertinf/reseautique-CQ/inventory',)
subset: dell-sonic
ask_vault_pass: True
forks: 5
1 plays in playbook/sonic.yml

PLAY [Sonic playbook] *********************************************************************************************************************************************************
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f52af002910> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f52af002910> for vault_id=default
redirecting (type: action) dellemc.enterprise_sonic.sonic_vrfs to dellemc.enterprise_sonic.sonic
Loading collection ansible.netcommon from /home/guertinf/.ansible/collections/ansible_collections/ansible/netcommon

TASK [sonic_vrf : Configure vrf] **********************************************************************************************************************************************
task path: /home/guertinf/reseautique-CQ/roles/sonic_vrf/tasks/main.yml:1
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.utils from /home/guertinf/.ansible/collections/ansible_collections/ansible/utils
<dell-sonic> attempting to start connection
<dell-sonic> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /home/guertinf/ansible2.15/bin/ansible-connection
<dell-sonic> local domain socket does not exist, starting it
<dell-sonic> control socket path is /home/guertinf/.ansible/pc/c906188db7
<dell-sonic> Loading collection ansible.builtin from 
<dell-sonic> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<dell-sonic> Loading collection ansible.netcommon from /home/guertinf/.ansible/collections/ansible_collections/ansible/netcommon
<dell-sonic> Loading collection ansible.utils from /home/guertinf/.ansible/collections/ansible_collections/ansible/utils
<dell-sonic> Loading collection dellemc.enterprise_sonic from /home/guertinf/.ansible/collections/ansible_collections/dellemc/enterprise_sonic
<dell-sonic> local domain socket listeners started successfully
<dell-sonic> loaded API plugin ansible_collections.dellemc.enterprise_sonic.plugins.httpapi.sonic from path /home/guertinf/.ansible/collections/ansible_collections/dellemc/enterprise_sonic/plugins/httpapi/sonic.py for platform type dellemc.enterprise_sonic.sonic
<dell-sonic> Loading collection ansible.builtin from 
<dell-sonic> local domain socket path is /home/guertinf/.ansible/pc/c906188db7
redirecting (type: action) dellemc.enterprise_sonic.sonic_vrfs to dellemc.enterprise_sonic.sonic
redirecting (type: action) dellemc.enterprise_sonic.sonic_vrfs to dellemc.enterprise_sonic.sonic
<dell-sonic> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<dell-sonic> ANSIBLE_NETWORK_IMPORT_MODULES: found dellemc.enterprise_sonic.sonic_vrfs  at /home/guertinf/.ansible/collections/ansible_collections/dellemc/enterprise_sonic/plugins/modules/sonic_vrfs.py
<dell-sonic> ANSIBLE_NETWORK_IMPORT_MODULES: running dellemc.enterprise_sonic.sonic_vrfs
<dell-sonic> ANSIBLE_NETWORK_IMPORT_MODULES: complete
fatal: [dell-sonic]: FAILED! => {
    "changed": false,
    "module_stderr": "argument of type 'NoneType' is not iterable",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}

PLAY RECAP ********************************************************************************************************************************************************************
dell-sonic                 : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Screenshots

No response

Additional Information

No response

@jeff-yin
Copy link
Collaborator

@kerry-meyer can you take a look and re-assign as necessary?

@kerry-meyer
Copy link
Collaborator

Please append to this issue the output from the following command:

cat /home/guertinf/.ansible/collections/ansible_collections/dellemc/enterprise_sonic/MANIFEST.json

@guertinf
Copy link
Author

$ cat /home/guertinf/.ansible/collections/ansible_collections/dellemc/enterprise_sonic/MANIFEST.json
{
 "collection_info": {
  "namespace": "dellemc",
  "name": "enterprise_sonic",
  "version": "2.2.0",
  "authors": [
   "Senthil Kumar Ganesan <Senthil_Kumar_Ganesa@Dell.com>",
   "Abirami <Abirami_N@Dell.com>",
   "Dhivya <Dhivya_P@Dell.com>",
   "Mohamed Javeed <Mohamed_Javeed_Faroo@Dell.com>",
   "Nirai Madai <Niraimadaiselvam_Mar@Dell.com>",
   "Shade Talabi <Shade_Talabi@Dell.com>",
   "Kerry Meyer <Kerry_Meyer@Dell.com>",
   "Mingjun Zhang <Mingjun_Zhang@Dell.com>",
   "Arun Saravanan Balachandran (arun_saravanan_balac@dell.com)",
   "Santhosh Kumar T (santhosh_kumar_t@dell.com)",
   "Divya Balasubramanian <Divya_Balasubramania@DELL.com>",
   "Cypher Miller <Cypher.Miller@Dell.com>"
  ],
  "readme": "README.md",
  "tags": [
   "dellemc",
   "dell",
   "networking",
   "nos",
   "sonic"
  ],
  "description": "Ansible Network Collection for Enterprise SONiC Distribution by Dell Technologies",
  "license": [],
  "license_file": "LICENSE",
  "dependencies": {
   "ansible.netcommon": ">5.0.0"
  },
  "repository": "https://github.com/ansible-collections/dellemc.enterprise_sonic",
  "documentation": null,
  "homepage": null,
  "issues": "https://github.com/ansible-collections/dellemc.enterprise_sonic/issues"
 },
 "file_manifest_file": {
  "name": "FILES.json",
  "ftype": "file",
  "chksum_type": "sha256",
  "chksum_sha256": "d5693d8c9f6f8129c2e762bec52df4fefa9caf0ece545a25f168c17d9676ac05",
  "format": 1
 },
 "format": 1
}

@mingjunzhang2019
Copy link
Collaborator

The fix was mergered by #285

@kerry-meyer
Copy link
Collaborator

kerry-meyer commented Oct 18, 2023

The submitter has verified that this problem has been fixed with the merge of PR #285, #293, and #298.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants