Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. ---
  2. - hosts: veos01
  3. gather_facts: no
  4. connection: local
  5.  
  6. vars:
  7. eapi:
  8. host: "{{ inventory_hostname }}"
  9. username: admin
  10. password: admin
  11. authorize: yes
  12. transport: eapi
  13.  
  14. tasks:
  15. - name: collect eos facts
  16. eos_facts:
  17. gather_subset: all
  18. provider: "{{ eapi }}"
  19. register: facts
  20.  
  21. - name: write facts to file
  22. copy:
  23. content: "{{ facts.ansible_facts | to_nice_yaml }}"
  24. dest: ./facts.txt
  25.  
  26. - name: show version
  27. eos_command:
  28. commands: show running-config
  29. provider: "{{ eapi }}"
  30. register: output
  31.  
  32. - name: write output to file
  33. copy:
  34. content: "{{ output.stdout[0] | to_nice_yaml }}"
  35. dest: ./show_version.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement