Bug 1815218

Summary: ExtraHostFileEntries only works for -ONE- entry, not more than one
Product: Red Hat OpenStack Reporter: Vincent S. Cojot <vcojot>
Component: tripleo-ansibleAssignee: Cédric Jeanneret <cjeanner>
Status: CLOSED ERRATA QA Contact: Sasha Smolyak <ssmolyak>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.0 (Train)CC: cjeanner, hjensas, mburns, mgarciac
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tripleo-ansible-0.4.2-0.20200328100137.f15182e.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-14 12:16:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vincent S. Cojot 2020-03-19 19:11:45 UTC
Description of problem:

I'm trying to use this:

===============================================================
parameter_defaults:
  ExtraHostFileEntries:
    - '10.0.128.186 sat6.lasthome.solace.krynn sat6'
    - '10.0.129.186 gitlab.lasthome.solace.krynn gitlab'
    - '10.0.130.186 ca8.lasthome.solace.krynn ca8'
    - '10.0.128.254 imladris.lasthome.solace.krynn imladris'
===============================================================

When I do that, I get all this on a single line on the overcloud nodes( in /etc/hosts):

===============================================================
[...]
10.0.128.186 sat6.lasthome.solace.krynn sat610.0.129.186 gitlab.lasthome.solace.krynn gitlab10.0.130.186 ca8.lasthome.solace.krynn ca810.0.128.254 imladris.lasthome.solace.krynn imladris
===============================================================

I tried " instead of ' but it made no difference. I also tried this syntax (all on one line):
ExtraHostFileEntries: ['10.0.128.186 sat6.lasthome.solace.krynn sat6','10.0.129.186 gitlab.lasthome.solace.krynn gitlab','10.0.130.186 ca8.lasthome.solace.krynn ca8','10.0.128.254 imladris.lasthome.solace.krynn imladris']

but again I got the same results.

If I use a -single- entry, then things work as expected:
===============================================================
parameter_defaults:
  ExtraHostFileEntries:
    - '10.0.128.186 sat6.lasthome.solace.krynn sat6'
===============================================================
or
===============================================================
ExtraHostFileEntries: ['10.0.128.186 sat6.lasthome.solace.krynn sat6']
===============================================================
Then I do get a working /etc/hosts but I suspect this might be just a side-effect of having -ONE- value.

Comment 1 Cédric Jeanneret 2020-03-20 07:24:26 UTC
Hello there,

The following patch should correct the situation hopefully.

I'll put it on test on my lab while CI and reviews provide a verdict.

Cheers,

C.

Comment 2 Cédric Jeanneret 2020-03-23 16:26:25 UTC
Hello,

After some poking around and tests, it appears my change wasn't the most efficient. The new one solves the current issue AND some others, which is of course better.

I'll make sure it's backported in OSP-16.0 asap.

Cheers,

C.

Comment 9 errata-xmlrpc 2020-05-14 12:16:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:2114