Git Product home page Git Product logo

ansible_masterclass's Introduction

ansible_masterclass

csr1000v ssh config

config t Enter configuration commands, one per line. End with CNTL/Z.

csr1000v(config)#username admin privilege 15 secret cisco csr1000v(config)#crypto key generate rsa modulus 2048 general-keys csr1000v(config)#line vty 0 4 csr1000v(config-line)#login local csr1000v(config-line)#transport input ssh

csr1000v(config-line)#^Z csr1000v#copy running-config startup-config

requirements

Install ubuntu on WSL to run ansible on top and integrate with vscode Works but is not supported for ansible VMware player works for images and GNS3 but use hyperV instead Cisco Install csr1000v and configure csr1000v#show ip interface brief Gets dhcp ip for the interface Install python3, pip, create virtual env Install ansible into virtenv pip install --user ansible-pylibssh

pip install --user ansible-pylibssh

ecossytem

ansible-pull can pull playbooks from git repo to then run ansible-playbook with them on the inventory ansible config file, first env var then current dir file (cannot be world writable - security risk)

commands

# change to the python virtual environment
source ~/py_venv/venv1_ansible_latest/bin/activate

# 192.168.1.98 is the csr1000v (with trailing comma)
# note the module cisco and network os of cisco
ansible all -i 192.168.1.98, -c ansible.netcommon.network_cli -u admin -k -m cisco.ios.ios_facts -e ansible_network_os=cisco.ios.ios

# can run arbitrary commands also using the command module with args
ansible all -i 192.168.1.98, -c ansible.netcommon.network_cli -u admin -k -m cisco.ios.ios_command -e ansible_network_os=cisco.ios.ios -a "commands='show ip interface brief'"


inventory

the ansible.cfg can be set to ingore host ssh pub keys host_key_checking=false

ansible_masterclass's People

Contributors

network-evolution avatar joshuajswain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.