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

wait_for_connection not working properly with Juniper QFX #83104

Closed
1 task done
ziyedbe opened this issue Apr 19, 2024 · 2 comments
Closed
1 task done

wait_for_connection not working properly with Juniper QFX #83104

ziyedbe opened this issue Apr 19, 2024 · 2 comments
Labels
affects_2.15 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category

Comments

@ziyedbe
Copy link

ziyedbe commented Apr 19, 2024

Summary

When I reboot my Juniper QFX system and use wait_for_connection using the example playbook below, the wait_for_connection is successful before the system is back online.

Issue Type

Bug Report

Component Name

wait_for_connection

Ansible Version

$ ansible --version
ansible [core 2.15.9]
  config file = /data/scripts/Switch_QFX/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /data/scripts/.venv/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /data/scripts/.venv/bin/ansible
  python version = 3.9.13 (main, Nov  9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] (/data/scripts/.venv/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = /data/scripts/Switch_QFX/ansible.cfg
HOST_KEY_CHECKING(/data/scripts/Switch_QFX/ansible.cfg) = False

CONNECTION:
==========

paramiko_ssh:
____________
host_key_checking(/data/scripts/Switch_QFX/ansible.cfg) = False

ssh:
___
host_key_checking(/data/scripts/Switch_QFX/ansible.cfg) = False

OS / Environment

Target OS versions
JUNOS 18.4 to JUNOS 21.4

Steps to Reproduce

---
- hosts: all
  connection: netconf
  gather_facts: False
  vars_files:
  - ../vars/vars.yml
  tasks:
    - name: request system reboot all-members
      junipernetworks.junos.junos_command:
        commands:
          - "request system reboot all-members"
      register: reboot_command_output
    - name: Wait for Remote host to come online
      wait_for_connection:
        delay: 90 
        timeout: 1600

Expected Results

wait_for_connection is sucessful after system is back online.

Actual Results

wait_for_connection is sucessful before system is back online.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Tasks

No tasks being tracked yet.
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. affects_2.15 module This issue/PR relates to a module. labels Apr 19, 2024
@ansibot
Copy link
Contributor

ansibot commented Apr 19, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

@mkrizek mkrizek added needs_verified This issue needs to be verified/reproduced by maintainer networking Network category and removed needs_triage Needs a first human triage before being processed. labels Apr 23, 2024
@sivel
Copy link
Member

sivel commented Apr 29, 2024

The problem here is in how wait_for_connection operates, and how networking modules are executed. Effectively wait_for_connection is incompatible with most network devices and connection plugins. The wait_for_connection action will ultimately run against localhost and succeed. As of now, this is not feasible. Additionally, the wait_for_connection action plugin executes the ansible.builtin.ping module against the host, which would not be supported by anything that isn't a linux like network device:

<ios-csr1000v> ESTABLISH PARAMIKO SSH CONNECTION FOR USER: user on PORT 22 TO ios-csr1000v
wait_for_connection: attempting ping module test
Using module file /Users/sivel/projects/ansibledev/ansible/lib/ansible/modules/ping.py
Pipelining is enabled.
<ios-csr1000v> ESTABLISH LOCAL CONNECTION FOR USER: sivel
<ios-csr1000v> EXEC /bin/sh -c '/Users/sivel/venvs/ansibledev/bin/python && sleep 0'
ok: [ios-csr1000v] => {
    "changed": false,
    "elapsed": 2
}

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this as completed Apr 29, 2024
@sivel sivel removed the needs_verified This issue needs to be verified/reproduced by maintainer label Apr 29, 2024
@ansible ansible locked and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.15 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category
Projects
None yet
Development

No branches or pull requests

4 participants