Skip to content

ktbyers/napalm-ansible

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

napalm-ansible

Collection of ansible modules that use napalm to retrieve data or modify configuration on netwroking devices.

Modules

The following modules are currenty available:

  • napalm_get_facts
  • napalm_install_config

Install

To install, clone the library directory into your ansible path.

OR

Add the following in requirements.yml

- src: https://github.com/napalm-automation/napalm-ansible/
  version: master
  name: napalm
  path: roles

Then execute:

ansible-galaxy install -r requirements.yml --force

Dependencies

Examples

Example to retreive facts from a device

 - name: get facts from device
   napalm_get_facts:
     hostname={{ inventory_hostname }}
     username={{ user }}
     dev_os={{ os }}
     password={{ passwd }}
     filter='facts,interfaces,bgp_neighbors'
   register: result

 - name: print data
   debug: var=result

Example to install config on a device

- assemble:
    src=../compiled/{{ inventory_hostname }}/
    dest=../compiled/{{ inventory_hostname }}/running.conf

 - napalm_install_config:
    hostname={{ inventory_hostname }}
    username={{ user }}
    dev_os={{ os }}
    password={{ passwd }}
    config_file=../compiled/{{ inventory_hostname }}/running.conf
    commit_changes={{ commit_changes }}
    replace_config={{ replace_config }}
    get_diffs=True
    diff_file=../compiled/{{ inventory_hostname }}/diff

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%