[fuel-library] Incorrect /etc/hosts file format

Bug #1386632 reported by Michael Polenchuk
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Low
Oleksiy Molchanov

Bug Description

Description of the environment:
All configurations

Steps to reproduce:
Complete netconfig stage of the deployment

Expected result:
Hosts table conforms the RFC 952 original format
  IP_address canonical_hostname [aliases...]

Actual result:
Mixed up hosts fqdn/aliases records
  192.168.0.2 node-6 node-6.domain.tld
  192.168.0.3 node-7 node-7.domain.tld

Workaround:
Swap the fqdn and aliases records

--- a/deployment/puppet/l23network/lib/puppet/parser/functions/nodes_to_hosts.rb
+++ b/deployment/puppet/l23network/lib/puppet/parser/functions/nodes_to_hosts.rb
@@ -11,7 +11,7 @@ module Puppet::Parser::Functions
     hosts=Hash.new
     nodes=args[0]
     nodes.each do |node|
- hosts[node['name']]={:ip=>node['internal_address'],:host_aliases=>[node['fqdn']]}
+ hosts[node['fqdn']] = {:ip => node['internal_address'], :host_aliases => [node['name']]}
       notice("Generating host entry #{node['name']} #{node['internal_address']} #{node['fqdn']}")
     end
     return hosts

Impact:
The facter 'fqdn' relies on the following search order (actually it's domain facter):
hostname -f (empty in case of invalid mixed up fqdn and aliases)
dnsdomainname (the same as above)
/etc/resolv.conf (the last chance to get domain/search data)

If /etc/resolv.conf have no domain/search data we get an empty fqdn facter that could affect the deployment process.
Valid FQDN is required for certain network tools to operate correctly.

Changed in fuel:
assignee: nobody → Oleksiy Molchanov (omolchanov)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (master)

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

Changed in fuel:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/5.1)

Fix proposed to branch: stable/5.1
Review: https://review.openstack.org/132684

no longer affects: fuel/5.1.x
Changed in fuel:
milestone: none → 6.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (master)

Reviewed: https://review.openstack.org/132078
Committed: https://git.openstack.org/cgit/stackforge/fuel-library/commit/?id=b344ec453eed3a37bf247a2ae7d1271bd9fdbe90
Submitter: Jenkins
Branch: master

commit b344ec453eed3a37bf247a2ae7d1271bd9fdbe90
Author: Oleksiy Molchanov <email address hidden>
Date: Thu Oct 30 19:17:25 2014 +0200

    Modify /etc/hosts

    Modify /etc/hosts table to conform the RFC 952 original format

    Change-Id: I3c9ee3153f450553532e139af56cac6fa5c97da3
    Closes-Bug: 1386632

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/5.1)

Change abandoned by Oleksiy Molchanov (<email address hidden>) on branch: stable/5.1
Review: https://review.openstack.org/132684
Reason: We do not backport low priority bugs

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.