Kolla-ansible's keystone role connects via ssh when generate cron for keystone-fernet

Bug #2004224 reported by Michal Arbet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Undecided
Unassigned
Antelope
Fix Released
Undecided
Unassigned
Yoga
Confirmed
Undecided
Unassigned
Zed
Fix Released
Undecided
Unassigned

Bug Description

Hi,

I'm using kolla-ansible in container, and when cron for fernet-token is generated in task [1]

"Generate the required cron jobs for the node"

Kolla-ansible is just failing ..because it is connecting via ssh but there is no need to do it via ssh, connection local is enough.

TASK [keystone : Generate the required cron jobs for the node] ****************************************************************************************************************************************************
fatal: [controller2 -> localhost]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python3", "/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py", "-t", "4320", "-i", "2", "-n", "3"], "delta": "0:00:00.067710", "end": "2023-01-30 20:09:02.238704", "msg": "non-zero return code", "rc": 2, "start": "2023-01-30 20:09:02.170994", "stderr": "/usr/bin/python3: can't open file '/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py': [Errno 2] No such file or directory", "stderr_lines": ["/usr/bin/python3: can't open file '/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py': [Errno 2] No such file or directory"], "stdout": "", "stdout_lines": []}
fatal: [controller0 -> localhost]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python3", "/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py", "-t", "4320", "-i", "0", "-n", "3"], "delta": "0:00:00.063431", "end": "2023-01-30 20:09:02.266345", "msg": "non-zero return code", "rc": 2, "start": "2023-01-30 20:09:02.202914", "stderr": "/usr/bin/python3: can't open file '/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py': [Errno 2] No such file or directory", "stderr_lines": ["/usr/bin/python3: can't open file '/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py': [Errno 2] No such file or directory"], "stdout": "", "stdout_lines": []}
fatal: [controller1 -> localhost]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python3", "/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py", "-t", "4320", "-i", "1", "-n", "3"], "delta": "0:00:00.090240", "end": "2023-01-30 20:09:02.292091", "msg": "non-zero return code", "rc": 2, "start": "2023-01-30 20:09:02.201851", "stderr": "/usr/bin/python3: can't open file '/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py': [Errno 2] No such file or directory", "stderr_lines": ["/usr/bin/python3: can't open file '/opt/kolla-ansible/ansible/roles/keystone/files/fernet_rotate_cron_generator.py': [Errno 2] No such file or directory"], "stdout": "", "stdout_lines": []}

I have kolla-ansible installed in /opt ..

Changed in kolla-ansible:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/872215
Committed: https://opendev.org/openstack/kolla-ansible/commit/78cf9585b78a5e3e9b771664838f40afc9702686
Submitter: "Zuul (22348)"
Branch: master

commit 78cf9585b78a5e3e9b771664838f40afc9702686
Author: Michal Arbet <email address hidden>
Date: Mon Jan 30 21:15:47 2023 +0100

    Trivial: Add connection: local for keystone-fernet cron generate task

    This patch add connection local for above mentioned task as
    kolla-ansible can be executed in docker container as in
    my case.

    When there is no connection: local, ansible is trying to connect
    to localhost via ssh where specified python script is not available.

    After connection: local everything is working as expected as file
    is found inside container

    Closes-Bug: #2004224

    Change-Id: I219a958b4f101efb71a2935e6d910dae5c65f0be

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 16.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 16.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/897442

no longer affects: kolla-ansible/xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/897442
Committed: https://opendev.org/openstack/kolla-ansible/commit/8ee98726c468de8fbcc42f689cba584c2096d2d4
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 8ee98726c468de8fbcc42f689cba584c2096d2d4
Author: Michal Arbet <email address hidden>
Date: Mon Jan 30 21:15:47 2023 +0100

    Trivial: Add connection: local for keystone-fernet cron generate task

    This patch add connection local for above mentioned task as
    kolla-ansible can be executed in docker container as in
    my case.

    When there is no connection: local, ansible is trying to connect
    to localhost via ssh where specified python script is not available.

    After connection: local everything is working as expected as file
    is found inside container

    Closes-Bug: #2004224

    Change-Id: I219a958b4f101efb71a2935e6d910dae5c65f0be
    (cherry picked from commit 78cf9585b78a5e3e9b771664838f40afc9702686)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 15.4.0

This issue was fixed in the openstack/kolla-ansible 15.4.0 release.

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.