てくなべ (tekunabe)

ansible / network automation / 学習メモ

[nornir] 指定できるプラットフォーム名(ios / junos / eos / vyos など)

■ はじめに

Python 製自動化フレームワークライブラリ nornir は、ネットワーク機器への接続に、 NAPALMnetmiko をデフォルトで利用できます。

接続の際のコネクションパラメーターとして、どのプラットフォームに接続するかを示す platform ( nornir 1.x 系では nornir_nos) 変数を指定します。

たとえば、Juniper Junos をまとめるグループを定義する groups.yaml の場合、以下のような指定になります。

junos: 
  username: root
  password: hogehoge9999
  platform: junos         # プラットフォーム名

このプラットフォーム名の指定は、ネットワーク機器への接続部分に

に依存します。

この記事では、それぞれの場合でどのようなラットフォーム名を利用できるか紹介します。

なお、nornir についての基本情報は以下の記事をご参照ください。 tekunabe.hatenablog.jp


■ NAPALM を利用する場合

NAPALM ドキュメントのGeneral support matrixDriver Name に記載があるもです。

NAPALM 2.3.3 現在は以下の通りです。

  • eos
  • junos
  • iosxr
  • nxos
  • nxos_ssh
  • ios


■ netmiko 利用する場合

netmiko/ssh_dispatcher.pyCLASS_MAPPER で定義されるものです。

netmiko 2.3.0 現在は以下の通りです。( 末尾に _ssh を付けた形も可)

  • a10
  • accedian
  • alcatel_aos
  • alcatel_sros
  • apresia_aeos
  • arista_eos
  • aruba_os
  • avaya_ers
  • avaya_vsp
  • brocade_fastiron
  • brocade_netiron
  • brocade_nos
  • brocade_vdx
  • brocade_vyos
  • calix_b6
  • checkpoint_gaia
  • ciena_saos
  • cisco_asa
  • cisco_ios
  • cisco_nxos
  • cisco_s300
  • cisco_tp
  • cisco_wlc
  • cisco_xe
  • cisco_xr
  • coriant
  • dell_dnos9
  • dell_force10
  • dell_isilon
  • dell_os10
  • dell_os6
  • dell_os9
  • dell_powerconnect
  • eltex
  • enterasys
  • extreme
  • extreme_ers
  • extreme_exos
  • extreme_netiron
  • extreme_nos
  • extreme_slx
  • extreme_vdx
  • extreme_vsp
  • extreme_wing
  • f5_linux
  • f5_ltm
  • f5_tmsh
  • fortinet
  • generic_termserver
  • hp_comware
  • hp_procurve
  • huawei
  • huawei_vrpv8
  • ipinfusion_ocnos
  • juniper
  • juniper_junos
  • linux
  • mellanox
  • mrv_optiswitch
  • netapp_cdot
  • netscaler
  • ovs_linux
  • paloalto_panos
  • pluribus
  • quanta_mesh
  • rad_etx
  • ruckus_fastiron
  • ubiquiti_edge
  • ubiquiti_edgeswitch
  • vyatta_vyos
  • vyos

プラットフォーム名の変換

なお、私が試した限り netmiko にないプラットフォーム名 ios でも netmiko を利用できました。(本来は cisco_ios

plugins/connections/netmiko.py にある以下の変換表によって変換されて利用できたようです。

napalm_to_netmiko_map = {
    "ios": "cisco_ios",
    "nxos": "cisco_nxos",
    "eos": "arista_eos",
    "junos": "juniper_junos",
    "iosxr": "cisco_xr",
}