This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: ios01 | |
connection: local | |
tasks: | |
- ios_facts: | |
host: "{{ inventory_hostname }}" | |
username: cisco | |
password: cisco | |
register: output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: nxos01 | |
tasks: | |
- name: return native objects from cli | |
nxos_command: | |
commands: | |
- command: show version | |
output: json | |
provider: "{{ cli }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: ios | |
connection: local | |
vars: | |
backup_root: /tmp/backups | |
cli: | |
host: "{{ inventory_hostname }}" | |
username: cisco |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: veos01 | |
gather_facts: no | |
connection: local | |
vars: | |
eapi: | |
host: "{{ inventory_hostname }}" | |
username: admin | |
password: admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: demo playbook | |
hosts: all | |
gather_facts: no | |
connection: local | |
tasks: | |
- name: show version | |
eos_command: | |
commands: show running-config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Test SROS in lab | |
hosts: lab-12e | |
connection: local | |
vars: | |
cli: | |
host: "{{ inventory_hostname }}" | |
username: ansible | |
ssh_keyfile: /home/nkeeling/ansible/rsa-keys/ansible_rsa.pub | |
transport: cli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ansible) [ansible-ios]$ grep ansible.log -e "^<" | |
<ios01> using connection network_cli | |
<ios01> ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO ios01 | |
<ios01> Authentication failed. | |
<ios01> using connection network_cli | |
<ios01> ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO ios01 | |
<ios01> shutting down control socket, connection was active for 0:00:59.872472 secs | |
<ios01> closing connection | |
<ios01> using connection network_cli | |
<ios01> ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO ios01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# This file is part of Ansible | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# Ansible is distributed in the hope that it will be useful, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ansible) [ansible-junos]$ cat syslog.yaml | |
--- | |
- hosts: vsrx01 | |
connection: local | |
gather_facts: no | |
tasks: | |
- junos_command: | |
commands: show configuration system syslog | |
provider: "{{ cli }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# This parser will parse the output from 'show running-config' on Cisco NXOS. | |
# | |
# Command: show running-config | |
# Platform: nxos | |
# | |
# Returns: | |
# interfaces: | |
# name: The name of the interface | |
# ipv4: The IPv4 address (if configured) |