am i impacted with some bug ?

 "VARIABLE IS NOT DEFINED!"

root@eve-ng:/etc/ansible# ansible-playbook test.yaml 

PLAY [collect device facts and display OS version] 
**********************************************************************************************************

TASK [run the show commands] 
********************************************************************************************************************************
 [WARNING]: argument username has been deprecated and will be removed in a 
future version
 [WARNING]: argument host has been deprecated and will be removed in a 
future version
 [WARNING]: argument password has been deprecated and will be removed in a 
future version
ok: [8.8.8.8]
ok: [5.5.5.5]

TASK [debug] 
************************************************************************************************************************************************
ok: [8.8.8.8] => {
    "version.stdout[0].Version": "VARIABLE IS NOT DEFINED!"
}
ok: [5.5.5.5] => {
    "version.stdout[0].Version": "VARIABLE IS NOT DEFINED!"
}

PLAY RECAP 
**************************************************************************************************************************************************
5.5.5.5                    : ok=2    changed=0    unreachable=0    
failed=0   
8.8.8.8                    : ok=2    changed=0    unreachable=0    
failed=0   



root@eve-ng:/etc/ansible# more test.yaml 
---
- name: collect device facts and display OS version
  hosts: "{{ inventory | default('all') }}"
  gather_facts: no
  connection: local

  
  tasks:
    - name: run the show commands
      ios_command:
        commands:
          - show version
        host: "{{ inventory_hostname }}"
        username: cisco
        password: cisco
      register: version
      
    - debug: var=version.stdout[0].Version

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0d8db0ae-b67d-4b73-be92-3c5d5e1133ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to