Skip to content

Instantly share code, notes, and snippets.

@hpreston
Created April 25, 2020 16:32
Show Gist options
  • Save hpreston/8811359b4c472df2c924020ceec6591c to your computer and use it in GitHub Desktop.
Save hpreston/8811359b4c472df2c924020ceec6591c to your computer and use it in GitHub Desktop.
Example Ansible IOS Config
# command to run ansible-playbook -i inventory.yml ansible_config.yaml
---
- hosts: sandbox-iosxe-latest
gather_facts: false
connection: network_cli
tasks:
- name: facts
ios_facts:
gather_subset: all
- name: Source Test
ios_config:
src: test.txt
all:
hosts:
sandbox-iosxe-latest:
ansible_host: ios-xe-mgmt-latest.cisco.com
ansible_network_os: ios
ansible_user: developer
ansible_password: C1sco12345
ansible_become: yes
ansible_become_method: enable
ansible_ssh_port: 8181
interface Loopback 1234
description Test Loopback
ip address 172.19.32.1 255.255.255.255
no shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment