On Thursday, 16 August 2018 04.40.02 CEST nbctcp wrote:
> Hi,
> I have working playbook to cisco on eve-ng.
> It will give error only when I want to run "show run".
> Other commands like "show version" "show clock" all ok
> 
> Please help
> tq
> 
> # cat showrun.yml
> ---
> - name: Run multiple commands
>   connection: network_cli
>   hosts: cisco1
>   gather_facts: true
>   tasks:
>     - name: run multiple commands
>       ios_command:
>         commands:
>         - show run
>         #- show version | i Version
>         #- show clock
>         #- show interfaces
>       register: output
>       #- name: copy output to file
>       #copy: content="{{ output.stdout[0] }}" dest=./output/{{ 
> inventory_hostname }}.txt
>     - debug: var=output.stdout_lines

show run need enable if I remember correctly.
How to use enable with network_cli is documented here
https://docs.ansible.com/ansible/2.6/network/user_guide/platform_ios.html 


-- 
Kai Stian Olstad


-- 
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/1790380.BWmvFHppD6%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to