Dear all, 

I am geting an error during my playbook running . 

i am using ntc-ansible and I want to send command from a text file in a 
Network for routing configuration 

code is like this with ntc ansible 


- name: Inbound command modification
  hosts: ciscors
  strategy: debug
  connection: local
  gather_facts: no
        ciscoios: 'ciscors'
        ciscoiosssh: 'ciscors_ssh'
        localfile: 'C:/Users/sg05477/GNS3/images/IOS.bin'
        remotefile: 'c7200-advipservicesk9-mz.152-4.S5.bin'
   -  name: Send commands from file
        connection: ssh
        platform: cisco_ios        
        commands_file: "send_commands.txt"        
        host: "{{ inventory_hostname }}"
        username: "{{ user }}"
        password: "{{ pass }}"
        secret: "{{ secret }}" 
   - debug: var=hostvars[inventory_hostname]
   #- debug: var=hostvars[user]
   #- debug: var=result.response
   #- debug: var=result.response.stdout      

During running playbook with ansible , i getting error like 

PLAY [Inbound command modification] 

TASK [Send commands from file] 
An exception occurred during task execution. To see the full traceback, use 
-vvv. The error was: UnboundLocalError: local variable 'output' referenced 
before assignment
fatal: []: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "Traceback (most recent call last):\n  File 
\"/tmp/ansible_bJ4FjY/\", line 256, in 
<module>\n    main()\n  File 
\"/tmp/ansible_bJ4FjY/\", line 244, in 
main\n    if (error_params(platform, output)):\nUnboundLocalError: local 
variable 'output' referenced before assignment\n", "module_stdout": "", 
"msg": "MODULE FAILURE", "rc": 0}

Anyone have some solution , how i correct this error. 

it will be very helpful. 


Samya Ghosh 

You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to