Don't assume /etc/hosts exists

Bug #1982837 reported by Mark Goddard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ansible-collection-kolla
Fix Released
Medium
Unassigned

Bug Description

The baremetal role adds entries to /etc/hosts. If the file does not exist, it will fail:

TASK [baremetal : Ensure localhost in /etc/hosts] ****************************************
fatal: [compute2]: FAILED! => {"changed": false, "msg": "Destination /etc/hosts does not exist !", "rc": 257}

Though surprising, this is possible, and we should not assume that /etc/hosts exists.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-collection-kolla (master)
Changed in ansible-collection-kolla:
status: New → In Progress
Mark Goddard (mgoddard)
Changed in ansible-collection-kolla:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-collection-kolla (master)

Reviewed: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/851027
Committed: https://opendev.org/openstack/ansible-collection-kolla/commit/25020e469f4a6f913ebaf21a3dc812d1fcbfa53a
Submitter: "Zuul (22348)"
Branch: master

commit 25020e469f4a6f913ebaf21a3dc812d1fcbfa53a
Author: Mark Goddard <email address hidden>
Date: Tue Jul 26 13:58:38 2022 +0100

    Don't assume /etc/hosts exists

    The baremetal role adds entries to /etc/hosts. If the file does not
    exist, it will fail:

      TASK [baremetal : Ensure localhost in /etc/hosts] ****************************************
      fatal: [compute2]: FAILED! => {"changed": false, "msg": "Destination /etc/hosts does not exist !", "rc": 257}

    Though surprising, this is possible, and we should not assume that
    /etc/hosts exists.

    This change modifies the above task to create the file if it does not
    exist.

    Closes-Bug: #1982837
    Change-Id: Ic419ee13a10b3fa1b890cfec23bab0a67489eb96

Changed in ansible-collection-kolla:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-collection-kolla (stable/yoga)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-collection-kolla (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/857050
Committed: https://opendev.org/openstack/ansible-collection-kolla/commit/69a1460b68577b7100997cd5819bccfb1da06a6f
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 69a1460b68577b7100997cd5819bccfb1da06a6f
Author: Mark Goddard <email address hidden>
Date: Tue Jul 26 13:58:38 2022 +0100

    Don't assume /etc/hosts exists

    The baremetal role adds entries to /etc/hosts. If the file does not
    exist, it will fail:

      TASK [baremetal : Ensure localhost in /etc/hosts] ****************************************
      fatal: [compute2]: FAILED! => {"changed": false, "msg": "Destination /etc/hosts does not exist !", "rc": 257}

    Though surprising, this is possible, and we should not assume that
    /etc/hosts exists.

    This change modifies the above task to create the file if it does not
    exist.

    Closes-Bug: #1982837
    Change-Id: Ic419ee13a10b3fa1b890cfec23bab0a67489eb96
    (cherry picked from commit 25020e469f4a6f913ebaf21a3dc812d1fcbfa53a)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 12.8.0

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

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

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

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

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

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

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

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.