mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-29 12:29:10 -07:00
adds feature to try to auto determine network_os (#18674)
This updates the network_cli connection plugin to attempt to automatically determine the remote device os. The device network os discovery can be overridden by setting the ansible_network_os value.
This commit is contained in:
parent
6fe9a5e40c
commit
8137c7207d
8 changed files with 56 additions and 7 deletions
|
@ -80,3 +80,9 @@ class TerminalModule(TerminalBase):
|
|||
self._exec_cli_command('disable')
|
||||
|
||||
|
||||
@staticmethod
|
||||
def guess_network_os(conn):
|
||||
stdin, stdout, stderr = conn.exec_command('show version')
|
||||
if 'Cisco IOS Software' in stdout.read():
|
||||
return 'ios'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue