Bug 1545957

Summary: Entries in /etc/hosts file can be overwritten by playbook due to bad regex
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Dustin Black <dblack>
Component: gluster-colonizerAssignee: Dustin Black <dblack>
Status: CLOSED ERRATA QA Contact: Nag Pavan Chilakam <nchilaka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rhgs-3.3CC: dblack, japplewh, nchilaka, rcyriac, rhs-bugs, rreddy
Target Milestone: ---Keywords: Rebase, ZStream
Target Release: RHGS 3.3.1 Async   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gluster-colonizer-1.0.3-1.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-12 12:06:14 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:
Bug Depends On:    
Bug Blocks: 1542835    

Description Dustin Black 2018-02-15 23:55:34 UTC
Description of problem:
Enumerated host names like g1, g2, g3, etc can cause entries in /etc/hosts to get overwritten when numbers are in double digits and the order of assignment in the ansible play puts a smaller number after a bigger number. For instance, if g12 is populated in the hosts file first, then g1 would overwrite that entry because of a bad regex match.

Version-Release number of selected component (if applicable):
v1.0.2

How reproducible:
Mostly consistently, but could vary with random-ish order of play operations

Steps to Reproduce:
1. Deploy colonizer to 12 nodes
2. Enumerate hostnames g{1..12}

Actual results:
Colonizer fails, possibly at variable plays after the hosts file is populated.

Expected results:
Colonizer populates the hosts file correctly and completes

Additional info:

Comment 2 Dustin Black 2018-02-15 23:58:42 UTC
Upstream merge commit corrects this problem:

https://github.com/gluster/gluster-colonizer/commit/cb9f5a36b7471af95857c4af8debc73185a934a8

Comment 3 Nag Pavan Chilakam 2018-02-21 14:56:58 UTC
Dustin,
How do i verify this as I have only 6 nodes?

Comment 4 Dustin Black 2018-02-21 16:52:26 UTC
Try manually naming the nodes:

node1
node10
node100
node1000
node10000
node100000

Prior to the fix, this will almost definitely trigger the problem.

Comment 6 Nag Pavan Chilakam 2018-03-07 21:01:09 UTC
i see that colonizer is able to take names bigger than 2 letters.
However , for some reason i am seeing failures in deployment not completing.
I guess the last entry is not getting peer probed

Comment 7 Nag Pavan Chilakam 2018-03-08 02:25:37 UTC
i see hostnames being taken with as big as even 10 letters and /etc/hosts not having any descrepencies , hence moving to verified

however raised a new bz#1553011 - Colonizer seems to be failing when hostnames are entered manuall

Comment 10 errata-xmlrpc 2018-03-12 12:06:14 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/RHEA-2018:0477