Hide Forgot
Description of problem: If you set undercloud_hostname in the undercloud.conf, it results in a SECOND 127.0.0.1 entry in /etc/hosts. Not only is this an invalid hosts file, it mucks up stuff like ansible_fqdn which then returns localhost.localdomain instead of the actual FQDN. Version-Release number of selected component (if applicable): I noticed this in OSP10 but it may affect previous releases as well. How reproducible: Steps to Reproduce: 1. Set undercloud_hostname in undercloud.conf 2. Deploy 3. cat /etc/hosts Actual results: [root@darin-undercloud stack]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 darin-undercloud.redhat.local darin-undercloud Expected results: [root@darin-undercloud stack]# cat /etc/hosts 127.0.0.1 darin-undercloud.redhat.local darin-undercloud localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 Additional info:
the code should only added the extra line for the hostname if there isn't already a line for the hostname in /etc/hosts. It was a failsafe that was added since the step was often skipped/forgotten in the docs, and multiple services (particularly rabbitmq) are quite picky about the name being in /etc/hosts: https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html-single/director_installation_and_usage/#sect-Setting_the_Hostname_for_the_System That being said, I didn't realize that technically that syntax with the same IP on multiple lines is invalid. You should be able to workaround the issue if you set it yourself though.
Yes, I completely understand the reasoning behind adding the setting to undercloud.conf. Just wanted to bug report it so it does eventually get fixed. The manpage for /etc/hosts reads: This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information: IP_address canonical_hostname [aliases...]
FailedQA instack-undercloud-7.4.2-2.el7ost.noarch [stack@undercloud-0 ~]$ cat undercloud.conf [DEFAULT] # Network interface on the Undercloud that will be handling the PXE # boots and DHCP for Overcloud instances. (string value) local_interface = eth0 # 192.168.24.0 subnet is by default used since RHOS11 local_ip = 192.168.24.1/24 network_gateway = 192.168.24.1 undercloud_public_vip = 192.168.24.2 undercloud_admin_vip = 192.168.24.3 network_cidr = 192.168.24.0/24 masquerade_network = 192.168.24.0/24 dhcp_start = 192.168.24.5 dhcp_end = 192.168.24.24 inspection_iprange = 192.168.24.100,192.168.24.120 undercloud_hostname = test_for_bz.redhat.local [stack@undercloud-0 ~]$ cat /etc/hosts 127.0.0.1 test_for_bz.redhat.local test_for_bz localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 test_for_bz.redhat.local test_for_bz undercloud-0.redhat.local undercloud-0 [stack@undercloud-0 ~]$ hostname -f test_for_bz.redhat.local undercloud installation failed undercloud_install.log in attachment
FailedQA
Created attachment 1350453 [details] undercloud_install.log
Moving to ON_QA because undercloud deployment failed even with without undercloud_hostname in undercloud.conf
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-2017:3462