Thank you for your replies.
First, I have to explain more about these nodes.
They are redhat virtual servers on vmware.
I can’t modify the network parameters, eth0 is the default route and eth1 is my management interface.
The node has an official hostname and an alias for the management interface.
For my example I called “servername” the official hostname, IP 10.2.2.2 configured on eth0, the default route.
The management hostname “management-hostname”, IP 10.5.5.5.5 on eth1
I found a first caveat :
after the bootstrap the node had an empty FQDN:
chefserver$>knife node show management-hostname
Node Name: management-hostname
Environment: _default
FQDN:
IP: 10.2.2.2
Run List:
Roles:
Recipes:
Platform: redhat 7.3
Bootstrap with -VV returned me:
DEBUG: Plugin Hostname: ran 'hostname --fqdn' and returned 1
DEBUG: Plugin Hostname: hostname --fqdn returned an empty string twice and will not be set.
indeed, logged on the server I had :
servername#>hostname --fqdn
hostname: Name or service not known
I fixed this problem modifying a line in /etc/nsswitch.conf :
hosts: files dns myhostname
And now it’s ok ;
#>hostname --fqdn
servername.xx.yy.zzz
After a new bootstrap I have my attributes set :
chefserver$>knife node show management-hostname
Node Name: management-hostname
Environment: _default
FQDN: servername.xx.yy.zzz
IP: 10.2.2.2
Run List:
Roles:
Recipes:
Platform: redhat 7.3
Tags:
However…
chefserver$>knife -VV ssh "name:management-hostname" -a network.interfaces.eth1.addresses.first
[... All seems Ok ...]
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
DEBUG: Decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
DEBUG: Using node attribute network.interfaces.eth1.addresses.first:
FATAL: 1 node found, but does not have the required attribute to establish the connection. Try setting another attribute to open the connection using --attribute.
Extracts from knife node show -l management-hostname :
network:
default_gateway: 10.2.2.1
default_interface: eth0
interfaces:
eth0:
addresses:
00:50:02:02:02:02:
family: lladdr
10.2.2.2:
[...]
eth1:
addresses:
00:50:56:55:55:55:
family: lladdr
10.5.5.5:
[...]
routes:
destination: my_chefserver_IP/24
family: inet
via: 10.5.5.5
[...]
state: up
transceiver: internal
type: eth
Sorry for my long post, but I’m stuck here.
Is it possible to force the FQDN and the IP attributes without changing the server configuration ?
Or another way ?
For information and to avoid wrong tracks, ssh configuration works well :
chefserver$>ssh management-hostname "chef-client -v"
Chef: 13.2.20