Hi Paddy,

Paddy Doyle <[email protected]> writes:

> Hi Loris,
>
> On Tue, Mar 15, 2016 at 11:43:55AM +0100, Loris Bennett wrote:
>
>> Hi,
>> 
>> I'm using ansible to set up two servers and have run into the problem
>> that on one server 'hostname' returns the just the name of the machine,
>> but on the other I get the FQDN:
>> 
>> # hostname -s; hostname -d; hostname -f; hostname 
>> tadmin01
>> test.cluster
>> tadmin01.test.cluster
>> tadmin01
>> 
>> # hostname -s; hostname -d; hostname -f; hostname
>> tadmin02
>> test.cluster
>> tadmin02.test.cluster
>> tadmin02.test.cluster
>> 
>> The following files are identical on both servers
>> 
>> /etc/hosts
>> /etc/resolv.conf
>> 
>> The files
>> 
>> /etc/sysconfig/network
>> 
>> differs just in the following way:
>> 
>> < HOSTNAME=tadmin01
>> ---
>> > HOSTNAME=tadmin02
>> 
>> What other files could have an influence on what 'hostname' returns?
>
> Is caching an issue? E.g. with sssd or nscd? That gave us some trouble with
> ansible iirc.

I also suspected something might be being cached, but I have restarted
all the services I thought might play a role and the difference remains.

> We ended up using an explicit ansible rule to set the FQDN in
> /etc/sysconfig/network just to make sure that every node was consistent. And
> then if necessary use "hostname -s" or "hostname -f" as required.

The problem is that I am setting up DRDB with the following resource
definition:

resource r0 {
  net {
    protocol C;
    allow-two-primaries yes;
  }
  on tadmin01 {
    device   /dev/drbd0;
    disk     /dev/sda1;
    address  10.141.235.254:7789;
    meta-disk internal;
  }
  on tadmin02 {
    device   /dev/drbd0;
    disk     /dev/sda1;
    address  10.141.235.253:7789;
    meta-disk internal;
  }
}

However, when I do

  drbdadm create-md r0

I get the error

  'r0' not defined in your config (for this host).

>From my googling my understanding is that the entry in the DRDB config
must match the result returned by 'hostname'.  I can obviously just
tweak the DRDB config to make it work, but I would really like to
understand why 'hostname' without any options gives me the FQDN in one
case and not in the other 

Cheers,

Loris

-- 
This signature is currently under construction.

Reply via email to