Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad hostname retrieval #44

Open
tomas321 opened this issue Feb 3, 2022 · 0 comments
Open

Bad hostname retrieval #44

tomas321 opened this issue Feb 3, 2022 · 0 comments

Comments

@tomas321
Copy link

tomas321 commented Feb 3, 2022

Hi,

I'm having troubles when provisioning a Dell switch N1524 with firmware v6.7.1.6. When using the ansible.netcommon.cli_config module I encounter a problem regarding the hostname retrieval fucntion, which I suspect links directly to this:

reply = self.get('show running-config | grep hostname')

ansible error traceback:

Traceback (most recent call last):
  File "<stdin>", line 100, in <module>
  File "<stdin>", line 92, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ansible.netcommon.cli_config_payload_r8tmh5cb/ansible_ansible.netcommon.cli_config_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/cli_config.py", line 475, in <module>
  File "/tmp/ansible_ansible.netcommon.cli_config_payload_r8tmh5cb/ansible_ansible.netcommon.cli_config_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/cli_config.py", line 428, in main
  File "/tmp/ansible_ansible.netcommon.cli_config_payload_r8tmh5cb/ansible_ansible.netcommon.cli_config_payload.zip/ansible/module_utils/connection.py", line 195, in __rpc__
ansible.module_utils.connection.ConnectionError: show running-config | grep hostname
                                       ^
% Invalid input detected at '^' marker.

sw-access-lan-07#

It's clear on my switch that the correct command should be show running-config | include hostname, since no grep is present. Am I just using a unsupported switch series or is it a legit finding?

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant