Possible bug with nxos_reboot module?

22 views
Skip to first unread message

Cody John

unread,
Nov 28, 2016, 12:31:02 PM11/28/16
to Ansible Project
I've run into some issues using nxos_reboot module in 2.2.0.0.  Given a very simple playbook:

---
- name: Reboot TOR B
  hosts: test_b
  gather_facts: no
  connection: local
  vars:
    ansible_python_interpreter: /glide/bin/python27
    cli:
      host: "{{ inventory_hostname }}"

  tasks:
    - name: Rebooting
      nxos_reboot:
        provider: "{{ cli }}"
        confirm: true


I get the following python exception:

TASK [Rebooting] ***************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnboundLocalError: local variable 'body' referenced before assignment
fatal: [asw-004b.sea3.service-now.com]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_tvr_so/ansible_module_nxos_reboot.py\", line 297, in <module>\n    main()\n  File \"/tmp/ansible_tvr_so/ansible_module_nxos_reboot.py\", line 284, in main\n    reboot(module)\n  File \"/tmp/ansible_tvr_so/ansible_module_nxos_reboot.py\", line 217, in reboot\n    disable_confirmation(module)\n  File \"/tmp/ansible_tvr_so/ansible_module_nxos_reboot.py\", line 263, in disable_confirmation\n    body = execute_show_command(command, module, command_type='cli_show_ascii')[0]\n  File \"/tmp/ansible_tvr_so/ansible_module_nxos_reboot.py\", line 258, in execute_show_command\n    return body\nUnboundLocalError: local variable 'body' referenced before assignment\n", "module_stdout": "", "msg": "MODULE FAILURE"}

I've noticed the same error when using nxos_install_os.  Has anybody had success using these new modules?

remy.pou...@blablacar.com

unread,
Dec 1, 2016, 11:16:05 AM12/1/16
to Ansible Project
Hi, I'm hitting the same issue when launching the playbook via Tower 3.0.3, when launching the same playbook via CLI I don't get the "UnboundLocalError: local variable 'body' referenced before assignment" error. Any update on this ?
Reply all
Reply to author
Forward
0 new messages