Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: veos01
- gather_facts: no
- connection: local
- vars:
- eapi:
- host: "{{ inventory_hostname }}"
- username: admin
- password: admin
- authorize: yes
- transport: eapi
- tasks:
- - name: collect eos facts
- eos_facts:
- gather_subset: all
- provider: "{{ eapi }}"
- register: facts
- - name: write facts to file
- copy:
- content: "{{ facts.ansible_facts | to_nice_yaml }}"
- dest: ./facts.txt
- - name: show version
- eos_command:
- commands: show running-config
- provider: "{{ eapi }}"
- register: output
- - name: write output to file
- copy:
- content: "{{ output.stdout[0] | to_nice_yaml }}"
- dest: ./show_version.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement