*Oh. of course.*
*The router is virtual image - IOL.*
*Cisco IOS Software Version 15.4(1)T (I86BI_LINUX-ADVENTERPRISEK9-M)*

*Full code is:*

*/etc/ansible/roles/new_vlan/new_vlan_playbook.yml:*
---
  - name: 
---------------   1. Applying Layer 2 Configuration   ---------------
    hosts: Snif_TEST
    connection: local
    tasks:
    - include_vars:
        dir: /etc/ansible/roles/new_vlan/vars/
    - include_role:
        name: new_vlan
        tasks_from: show_vlan.yml


*/etc/ansible/roles/new_vlan/tasks/show_vlan.yml*
---
  - name: ---------------   1. Show VLAN   ----------------------
    ios_command:
      commands: 
        - show ip int br
    register: show_vlan

  - debug: msg="{{ show_vlan.stdout_lines }}"


* /etc/ansible/roles/new_vlan/vars/new_vlan_vars.yml*
  ansible_ssh_common_args: 
-o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts 
  ansible_user: ansible
  ansible_password: ansible

*/etc/ansible/inventory/POC_ENV.yml*
all:
  children:
    POC_ENV:
      hosts:
        TEST-NXOS2:
        TEST-NXOS3:
    Snif_TEST:
      hosts:
        R-TEST-SNIF:

*Ill mention again that when i add this configuration on the router ansible 
works perfectly:*

  ip ssh pubkey-chain

  username ansible

  key-string

  ssh-rsa 
AAAAB3NzaC1yc2EAAAADAQABAAABAQDuKpCznL9Gb7L/jVypzsHxFcceKBL2Xg0Enjr5XnGtaAsycD+ToiXYANzn2J21z3IqxyVG7NELLkW03CCclBVMCkdbzD8sRaVuIZCjYdzD4KX7O8goBXnz0+sPO4FhccSBhMfAO/IphliQ0oFBM26OG8UsxZISI5/04GdObk6AwM7jDk6Fga1Wcmqpo0P2XfarXckbL0LxAYEaGr5JR6X4p

n+0x4C/DuOIIKQuvDyiaWTlD+ewRW6kMUUgo8AnVcHekZG+7GDzS4yVuAKZ73pl+Pe8EBa2eUP4FSE1ZXqnQvunKyGo7ifrZCcbikAnkB2is48Y67E3c21ZxhSkI36P
 
ansible@Netauto-Dev


*What do you think?*





-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a7f6c8a5-e945-4fa0-a3e6-ce11934427ac%40googlegroups.com.

Reply via email to