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

os10_network_validation : Name or service not known #177

Open
solune opened this issue Jan 31, 2025 · 0 comments
Open

os10_network_validation : Name or service not known #177

solune opened this issue Jan 31, 2025 · 0 comments

Comments

@solune
Copy link

solune commented Jan 31, 2025

Hello,

SUMMARY

Only with the network_validation role, other works very well, ssh is unable to find hostname to connect either with libssh or with paramiko.
I followed the directions in the role readme file.

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible [core 2.16.0]
  config file = /work/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.13/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.13.1 (main, Jan 24 2025, 21:28:37) [GCC 10.2.1 20210110] (/usr/local/bin/python3.13)
  jinja version = 3.1.5
  libyaml = True

COLLECTION VERSION
Collection        Version
----------------- -------
ansible.netcommon 2.6.1  
ansible.utils     5.1.2  
dellemc.os10      1.2.0  
CONFIGURATION
CONFIG_FILE() = /work/ansible.cfg
DEFAULT_VAULT_PASSWORD_FILE(/work/ansible.cfg) = /work/vault_passwd
HOST_KEY_CHECKING(/work/ansible.cfg) = False
OS / ENVIRONMENT

It run in a docker built like this:

RUN apt-get update && apt-get install -y \
    ssh \
    sshpass \
    vim \
    gcc \
    libssh-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /tmp
COPY python-requirements.txt /tmp
RUN pip install -r python-requirements.txt && rm python-requirements.txt

COPY ansible-requirements.yml /home/ansible/requirements.yml
RUN ansible-galaxy install -r /home/ansible/requirements.yml

WORKDIR /work

ansible-requirements.yaml:

  - name: dellemc.os10
  - name: ansible.netcommon

python-requirements.yaml:

paramiko
ansible-pylibssh
xmltodict
lxml
xmltodict
textfsm
units
PyYAML
STEPS TO REPRODUCE

playbook:

---
- name: setup wiring validation
  hosts: localhost
  gather_facts: false
  connection: local
  collections:
    - dellemc.os10
  tasks:
    - import_role:
        name: os10_network_validation
        tasks_from: wiring_validation.yaml

Inventory:

---
all:
    children:
        spines:
            hosts:
                sw5232rc9:
                sw5232rg2:
        leaves:
            hosts:
                sw5296rc9a:
                sw5296rc9b:
                sw5248rg2a:
                sw5248rg2b:
                sw41ilea:
                sw41ileb:
                sw41rc9:

group_vars/all/all.yaml:

---
#Ansible settings
ansible_network_os: dellemc.os10.os10
ansible_network_cli_ssh_type: libssh
ansible_user: admin
ansible_password: "{{ vault_os10_password }}"
ansible_command_timeout: 120

cli:
 username: "{{ os10_cli_user | default('admin') }}"
 password: "{{ os10_cli_pass | default('admin') }}"

os10_cfg_generate: true
os10_cli_user: admin
os10_cli_pass: "{{ vault_os10_password }}"

intended_neighbors:
...

host_vars/sw5232rc9.yaml:

---
hostname: sw5232rc9
ansible_host: 10.19.0.60

cli:
 host: 10.19.0.60
EXPECTED RESULTS
ACTUAL RESULTS
PLAY [setup wiring validation] ***************************************************************************************************************************************
redirecting (type: action) dellemc.os10.os10_command to dellemc.os10.os10

TASK [dellemc.os10.os10_network_validation : Get Dell EMC OS10 wiring info] ******************************************************************************************
task path: /root/.ansible/collections/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/wiring_validation.yaml:2
redirecting (type: action) dellemc.os10.os10_command to dellemc.os10.os10
redirecting (type: action) dellemc.os10.os10_command to dellemc.os10.os10
<10.19.0.60> using connection plugin network_cli
redirecting (type: connection) ansible.builtin.persistent to ansible.netcommon.persistent
The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/ansible/executor/task_executor.py", line 120, in run
    item_results = self._run_loop(items)
  File "/usr/local/lib/python3.13/site-packages/ansible/executor/task_executor.py", line 335, in _run_loop
    res = self._execute(variables=task_vars)
  File "/usr/local/lib/python3.13/site-packages/ansible/executor/task_executor.py", line 641, in _execute
    result = self._handler.run(task_vars=vars_copy)
  File "/root/.ansible/collections/ansible_collections/dellemc/os10/plugins/action/os10.py", line 88, in run
    out = conn.get_prompt()
  File "/usr/local/lib/python3.13/site-packages/ansible/module_utils/connection.py", line 200, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
ansible.module_utils.connection.ConnectionError: [Errno -2] Name or service not known
fatal: [localhost]: FAILED! => {
    "msg": "Unexpected failure during module execution: [Errno -2] Name or service not known",
    "stdout": ""
}

``
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