ssh_known_hosts tasks fail in check mode

Bug #1817765 reported by Oliver Walsh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Oliver Walsh

Bug Description

As the tempfile step is skipped in check mode, the resulting path is undefined. e.g:

(undercloud) [stack@undercloud ~]$ ansible-playbook --check foo.yaml
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost
does not match 'all'

PLAY [localhost] ****************************************************************************************

TASK [Gathering Facts] **********************************************************************************
ok: [localhost]

TASK [Create temporary file for ssh_known_hosts] ********************************************************
skipping: [localhost]

TASK [Create a temporary copy of ssh_known_hosts] *******************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'path'\n\nThe error appears to have been in '/home/stack/foo.yaml': line 13, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n register: ssh_known_hosts_tmp\n - name: Create a temporary copy of ssh_known_hosts\n ^ here\n"}
 to retry, use: --limit @/home/stack/foo.retry

PLAY RECAP **********************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1

The entire block of tasks should be skipped in check mode.

Oliver Walsh (owalsh)
Changed in tripleo:
milestone: none → stein-3
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/639402

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

Reviewed: https://review.openstack.org/639402
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=6f538dc820f0a0117c33b933fc21d0d8406d5638
Submitter: Zuul
Branch: master

commit 6f538dc820f0a0117c33b933fc21d0d8406d5638
Author: Oliver Walsh <email address hidden>
Date: Tue Feb 26 17:51:15 2019 +0000

    Skip ssh_known_hosts tasks in check mode

    The tempfile task is skipped in check mode so we need to skip all tasks to
    avoid referencing the undefined temp file path.

    Change-Id: I87a4b40387cabed86e04efa64ddc19f117693589
    Closes-Bug: 1817765

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/639695

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/rocky)

Reviewed: https://review.openstack.org/639695
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=f965b037b718d8839d4ff25275b2dd60416d66b7
Submitter: Zuul
Branch: stable/rocky

commit f965b037b718d8839d4ff25275b2dd60416d66b7
Author: Oliver Walsh <email address hidden>
Date: Tue Feb 26 17:51:15 2019 +0000

    Skip ssh_known_hosts tasks in check mode

    The tempfile task is skipped in check mode so we need to skip all tasks to
    avoid referencing the undefined temp file path.

    Change-Id: I87a4b40387cabed86e04efa64ddc19f117693589
    Closes-Bug: 1817765
    (cherry picked from commit 6f538dc820f0a0117c33b933fc21d0d8406d5638)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 10.5.0

This issue was fixed in the openstack/tripleo-common 10.5.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 9.6.0

This issue was fixed in the openstack/tripleo-common 9.6.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.