Skip to content

Instantly share code, notes, and snippets.

@privateip
Last active October 27, 2016 03:11
Show Gist options
  • Save privateip/ae1994319beda217937fe5affe4e2540 to your computer and use it in GitHub Desktop.
Save privateip/ae1994319beda217937fe5affe4e2540 to your computer and use it in GitHub Desktop.
---
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment