Cannot run remote backup on a server in which ssh is not on port 22

Bug #1986554 reported by Thiago Paiva Brito
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Thiago Paiva Brito

Bug Description

Brief Description
-----------------
According to [1], I should be able to configure ansible on any given host and run the backup playbook remotely, but when I configure ansible to run ssh over a port other than port 22, it fails at playbookconfig/src/playbooks/roles/common/prepare-env/tasks/main.yml at task "Gather remote SSH public key"

[1]https://docs.starlingx.io/developer_resources/backup_restore.html#remote-play-method

Severity
--------
Major: System/Feature is usable with restrictions

Steps to Reproduce
------------------
Setup Virtual AIO-SX and configure port forward to port 22 from any other port (say 11100)
Try to run remote backup according to [1]

Expected Behavior
------------------
Backup succeeds

Actual Behavior
----------------
Backup fails due to invalid argument to ssh-keyscan

Reproducibility
---------------
3/3

System Configuration
--------------------
AIO-SX (should happen on all configurations)

Branch/Pull Time/Commit
-----------------------
2022-08-05

Last Pass
---------
N/A

Timestamp/Logs
--------------
fatal: [lab_vbox_1-debian -> localhost]: FAILED! => {
    "attempts": 6,
    "changed": true,
    "cmd": [
        "ssh-keyscan",
        "-T",
        "20",
        "-t",
        "ecdsa",
        "[10.127.130.10]:11100"
    ],
    "delta": "0:00:00.004154",
    "end": "2022-08-15 14:57:48.355084",
    "invocation": {
        "module_args": {
            "_raw_params": "ssh-keyscan -T 20 -t ecdsa [10.127.130.10]:11100",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": false
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2022-08-15 14:57:48.350930",
    "stderr": "getaddrinfo [10.127.130.10]:11100: Name or service not known",
    "stderr_lines": [
        "getaddrinfo [10.127.130.10]:11100: Name or service not known"
    ],
    "stdout": "",
    "stdout_lines": []
}

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************************
lab_vbox_1-debian : ok=6 changed=1 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0

Test Activity
-------------
Developer Testing

Workaround
----------
N/A

Changed in starlingx:
assignee: nobody → Thiago Paiva Brito (outbrito)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-playbooks (master)
Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/853191
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/e2514700598692d213ff9e122ee660182015b0e0
Submitter: "Zuul (22348)"
Branch: master

commit e2514700598692d213ff9e122ee660182015b0e0
Author: Thiago Brito <email address hidden>
Date: Mon Aug 15 15:01:12 2022 -0300

    Fix running remote play on random ssh port

    This fixes the ability to run the backup play (or any play for that
    matter) remotely when ansible_port is configured on /etc/ansible/hosts

    TEST PLAN
    PASS Remote play of the backup playbook
    PASS Local play of the backup playbook
    PASS Remote play of the restore playbook
    PASS Local play of the restore playbook

    Closes-Bug: #1986554
    Signed-off-by: Thiago Brito <email address hidden>
    Change-Id: I48227d2e00b16aaa595aec6d628ce36ea1c8ba51

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.8.0 stx.update
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.