salt.proxy.netmiko_px
Netmiko
New in version 2019.2.0.
Proxy module for managing network devices via Netmiko.
- codeauthor
-
Mircea Ulinic <ping@mirceaulinic.net> & Kirk Byers <ktbyers@twb-tech.com>
- maturity
-
new
- depends
-
netmiko
- platform
-
unix
Dependencies
The netmiko
proxy modules requires Netmiko to be installed: pip install netmiko
.
Pillar
The netmiko
proxy configuration requires the following parameters in order to connect to the network device:
-
device_type
- Class selection based on device type. Supported options:a10
: A10 Networksaccedian
: Accedian Networksalcatel_aos
: Alcatel AOSalcatel_sros
: Alcatel SROSapresia_aeos
: Apresia AEOSarista_eos
: Arista EOSaruba_os
: Arubaavaya_ers
: Avaya ERSavaya_vsp
: Avaya VSPbrocade_fastiron
: Brocade Fastironbrocade_netiron
: Brocade Netironbrocade_nos
: Brocade NOSbrocade_vdx
: Brocade NOSbrocade_vyos
: VyOScheckpoint_gaia
: Check Point GAiAcalix_b6
: Calix B6ciena_saos
: Ciena SAOScisco_asa
: Cisco SAcisco_ios
: Cisco IOScisco_nxos
: Cisco NX-oScisco_s300
: Cisco S300cisco_tp
: Cisco TpTcCecisco_wlc
: Cisco WLCcisco_xe
: Cisco IOScisco_xr
: Cisco XRcoriant
: Coriantdell_force10
: Dell Force10dell_os10
: Dell OS10dell_powerconnect
: Dell PowerConnecteltex
: Eltexenterasys
: Enterasysextreme
: Extremeextreme_wing
: Extreme Wingf5_ltm
: F5 LTMfortinet
: Fortinetgeneric_termserver
: TerminalServerhp_comware
: HP Comwarehp_procurve
: HP Procurvehuawei
: Huaweihuawei_vrpv8
: Huawei VRPV8juniper
: Juniper Junosjuniper_junos
: Juniper Junoslinux
: Linuxmellanox
: Mellanoxmrv_optiswitch
: MrvOptiswitchnetapp_cdot
: NetAppcDotnetscaler
: Netscalerovs_linux
: OvsLinuxpaloalto_panos
: PaloAlto Panospluribus
: Pluribusquanta_mesh
: Quanta Meshruckus_fastiron
: Ruckus Fastironubiquiti_edge
: Ubiquiti Edgeubiquiti_edgeswitch
: Ubiquiti Edgevyatta_vyos
: VyOSvyos
: VyOSbrocade_fastiron_telnet
: Brocade Fastiron over Telnetbrocade_netiron_telnet
: Brocade Netiron over Telnetcisco_ios_telnet
: Cisco IOS over Telnetapresia_aeos_telnet
: Apresia AEOS over Telnetarista_eos_telnet
: Arista EOS over Telnethp_procurve_telnet
: HP Procurve over Telnethp_comware_telnet
: HP Comware over Telnetjuniper_junos_telnet
: Juniper Junos over Telnetcalix_b6_telnet
: Calix B6 over Telnetdell_powerconnect_telnet
: Dell PowerConnect over Telnetgeneric_termserver_telnet
: TerminalServer over Telnetextreme_telnet
: Extreme Networks over Telnetruckus_fastiron_telnet
: Ruckus Fastiron over Telnetcisco_ios_serial
: Cisco IOS over serial port
ip
- IP address of target device (not required ifhost
is provided)host
- Hostname of target device (not required ifip
is provided)username
- Username to authenticate against target device, if requiredpassword
- Password to authenticate against target device, if requiredsecret
- The enable password if target device requires oneport
- The destination port used to connect to the target deviceglobal_delay_factor
- Multiplication factor affecting Netmiko delays (default:1
)use_keys
- Connect to target device using SSH keys (default:False
)key_file
- Filename path of the SSH key file to useallow_agent
- Enable use of SSH key-agentssh_strict
- Automatically reject unknown SSH host keys (default:False
, which means unknown SSH host keys will be accepted)system_host_keys
- Load host keys from the user's "known_hosts" file (default:False
)alt_host_keys
- IfTrue
, host keys will be loaded from the file specified inalt_key_file
(default:False
)alt_key_file
- SSH host key file to use (ifalt_host_keys=True
)ssh_config_file
- File name of OpenSSH configuration filetimeout
- Connection timeout, in seconds (default:90
)session_timeout
- Set a timeout for parallel requests, in seconds (default:60
)keepalive
- Send SSH keepalive packets at a specific interval, in seconds. Currently defaults to0
, for backwards compatibility (it will not attempt to keep the connection alive using the KEEPALIVE packets).default_enter
- Character(s) to send to correspond to enter key (default:\n
)response_return
- Character(s) to use in normalized return data to represent enter key (default:\n
)always_alive
- In certain less dynamic environments, maintaining the remote connection permanently open with the network device is not always beneficial. In that case, the user can select to initialize the connection only when needed, by setting this option toFalse
. By default this option is set toTrue
(maintains the connection with the remote network device)multiprocessing
- Overrides themultiprocessing
option, per proxy minion, as the Netmiko communication channel is mainly SSH (default:False
)connection_timeout
- The number of seconds to attempt to connect to the device in seconds. (default:300
)
Proxy Pillar Example
proxy: proxytype: netmiko device_type: juniper_junos host: router1.example.com username: example password: example
proxy: proxytype: netmiko device_type: cisco_ios ip: 1.2.3.4 username: test use_keys: true secret: w3@k
-
Return the connection status with the network device.
salt.proxy.netmiko_px.alive(opts)
-
Return the Netmiko device args.
salt.proxy.netmiko_px.args()
-
Calls an arbitrary netmiko method.
salt.proxy.netmiko_px.call(method, *args, **kwargs)
-
Return the connection object.
salt.proxy.netmiko_px.conn()
salt.proxy.netmiko_px.connection(connection_timeout=300)
-
Open the connection to the network device managed through netmiko.
salt.proxy.netmiko_px.init(opts)
-
Connection finished initializing?
salt.proxy.netmiko_px.initialized()
salt.proxy.netmiko_px.make_con(connection_timeout=300)
-
Connection open successfully?
salt.proxy.netmiko_px.ping()
-
Closes connection with the device.
salt.proxy.netmiko_px.shutdown(opts)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/proxy/all/salt.proxy.netmiko_px.html