What was the hostname that you entered? I was able to successfully set the hostname (i.e. the workaround you mentioned) using just the console option.
Alberto, could you take a look at this when you get a chance? Or maybe JoeV can take a look? It seems like it should be working, but I don't have the environment to try to reproduce it.
This seems to be being caused by the way python's `socket.gethostbyaddr("127.0. 0.1")` command works. For example, that same command run with slightly different /etc/hosts files seems to be causing this issue: /etc/hosts: 127.0.0.1 test.example.com localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@localhost ~]# python Python 2.7.5 (default, Sep 15 2016, 22:37:39) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.gethostbyaddr("127.0.0.1") ('test.example.com', ['localhost', 'localhost.localdomain', 'localhost4', 'localhost4.localdomain4'], ['127.0.0.1']) If I change /etc/hosts to: ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 test.example.com localhost localhost.localdomain localhost4 localhost4.localdomain4 [root@localhost ~]# python Python 2.7.5 (default, Sep 15 2016, 22:37:39) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.gethostbyaddr("127.0.0.1") ('localhost', ['localhost.localdomain', 'localhost6', 'localhost6.localdomain6'], ['127.0.0.1']) For some more reference on how this is relevant https://github.com/ManageIQ/manageiq/pull/5854#issuecomment-165133084 explains how freeipa is using these calls to determine the hostname. I'm not sure what we can/should do to correct this. I don't think socket.gethostbyaddr("127.0.0.1") should ever be returning aliases for ipv6 addresses, but we can't really change that behavior so, maybe we need logic to add the newly set hostname as an alias for ::1 as well when it is set?
Submitted a python bug report for this behavior. http://bugs.python.org/issue28431
Amogh, I was not able to reproduce this issue. I used the appliance_console to set the host name then to configure IPA successfully. Can you PM me the credentials to the system where you produced this? Thank you. JoeV
Joe, This issue is completely dependent on the ordering of the lines in /etc/hosts. Can you be sure your file has the IPv6 address line first like I did here: ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 test.example.com localhost localhost.localdomain localhost4 localhost4.localdomain4 I would expect IPA configuration to fail in that case. I think the only fix we can make for this would be to also set the hostname for ::1 as well as 127.0.0.1 in the console here (https://github.com/ManageIQ/manageiq/blob/master/gems/pending/appliance_console.rb#L242)
(In reply to Nick Carboni from comment #11) > Joe, > > This issue is completely dependent on the ordering of the lines in > /etc/hosts. > > Can you be sure your file has the IPv6 address line first like I did here: > ::1 localhost localhost.localdomain localhost6 > localhost6.localdomain6 > 127.0.0.1 test.example.com localhost localhost.localdomain localhost4 > localhost4.localdomain4 > > I would expect IPA configuration to fail in that case. > > I think the only fix we can make for this would be to also set the hostname > for ::1 as well as 127.0.0.1 in the console here > (https://github.com/ManageIQ/manageiq/blob/master/gems/pending/ > appliance_console.rb#L242) Thank you Nick! I'll investigate. Joe
provided the info requested by JoeV on IRC channel.
https://github.com/ManageIQ/manageiq/pull/12171
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/beb24357317ff8b06d05701e9fe27b53f2c3663d commit beb24357317ff8b06d05701e9fe27b53f2c3663d Author: Joe VLcek <jvlcek> AuthorDate: Tue Oct 25 09:37:13 2016 -0400 Commit: Joe VLcek <jvlcek> CommitDate: Tue Oct 25 11:13:39 2016 -0400 Set hostname on both IPv6 and IPv4 loopback addrs https://bugzilla.redhat.com/show_bug.cgi?id=1360928 gems/pending/Gemfile | 2 +- gems/pending/appliance_console.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
New commit detected on ManageIQ/manageiq/euwe: https://github.com/ManageIQ/manageiq/commit/693e9b8d21abf2625662e54aeba1a03923865df2 commit 693e9b8d21abf2625662e54aeba1a03923865df2 Author: Nick Carboni <ncarboni> AuthorDate: Mon Oct 31 17:21:13 2016 -0400 Commit: Oleg Barenboim <chessbyte> CommitDate: Tue Nov 1 13:41:20 2016 -0400 Merge pull request #12171 from jvlcek/bz1360928_ext_auth_hostname Set hostname on both IPv6 and IPv4 loopback addrs (cherry picked from commit d00ab3e15116132e5b951ab466ef0963f2de2909) https://bugzilla.redhat.com/show_bug.cgi?id=1360928 gems/pending/Gemfile | 2 +- gems/pending/appliance_console.rb | 2 +- gems/pending/appliance_console/cli.rb | 3 +-- gems/pending/spec/appliance_console/cli_spec.rb | 6 ------ 4 files changed, 3 insertions(+), 10 deletions(-)
*** Bug 1291879 has been marked as a duplicate of this bug. ***
Verified on 5.8.0.7