Re: localhost.localdomain showing when salt-key -L [SOLVED]

228 views
Skip to first unread message

Zippy Zeppoli

unread,
Oct 16, 2012, 9:26:22 PM10/16/12
to salt-...@googlegroups.com
Hi Jeff,
I like this suggestion.
http://docs.saltstack.org/en/latest/ref/configuration/minion.html#std:conf_minion-id

Thanks to everyone who commented and offered your input, all of it was helpful!

Thanks,
M

On Tue, Oct 16, 2012 at 9:02 AM, Jeff Bauer <jba...@rubic.com> wrote:
Lately my preference has been to just set the id in /etc/salt/minion.
Explicit better than implicit, etc.

Jeff Bauer
Rubicon, Inc.


On Tue, Oct 16, 2012 at 02:33:08AM -0700, Umberto Nicoletti wrote:
> Happened to me too (on centos): some minions reported localhost.localdomain
> instead of the correct hostname.
> To fix it I had to edit /etc/hosts on the minion, remove the real hostname (in
> both unqualified and qualified form) from 127.0.0.1 and ::1 lines, and then
> restart salt-minion.
> The mismatched key can be removed from the master with:
>
> salt-key -r localhost.localdomain
>
> hth,
> Umberto
>
> Il giorno lunedě 15 ottobre 2012 20:25:47 UTC+2, Zippy Zeppoli ha scritto:
>
>     Hi List,
>     I am on ec2, I am seeing localhost.localdomain showing up for a host I
>     registered with my master, but I look on the host itself, and the hostname
>     is set.
>
>     /etc/sysconfig/network = set
>     hostname = shows output
>     PS1 variable = shows proper hostname
>
>     What else should I check?
>     Is there a way for me to add this to the minion config manually as a last
>     resort?
>
>     Thanks in advance.
>

Jeff Bauer

unread,
Oct 17, 2012, 12:41:44 AM10/17/12
to salt-...@googlegroups.com
I'd almost go so far to suggest that explicitly assigning
the minion id might be considered a "best practices" idiom.
It would certainly save some hair pulling for new users, or
old users who deploy minions in new environments.

I know I had to write a special sed command to fix /etc/hosts on
ec2 instance creation until I just thought "the hell with it" and
assigned ids to all my minions.

Jeff Bauer
Rubicon, Inc.
> > Il giorno lunedA:* 15 ottobre 2012 20:25:47 UTC+2, Zippy Zeppoli ha
> scritto:
> >
> > A A Hi List,
> > A A I am on ec2, I am seeing localhost.localdomain showing up for a
> host I
> > A A registered with my master, but I look on the host itself, and
> the hostname
> > A A is set.
> >
> > A A /etc/sysconfig/network = set
> > A A hostname = shows output
> > A A PS1 variable = shows proper hostname
> >
> > A A What else should I check?
> > A A Is there a way for me to add this to the minion config manually
> as a last
> > A A resort?
> >
> > A A Thanks in advance.
> >

Ben Hosmer

unread,
Oct 17, 2012, 7:12:21 AM10/17/12
to salt-...@googlegroups.com
That is generally the first thing I do with a new minion before I even accept the keys on the master. All of my minions are in EC2 and I haven't had any issues using this method.
--
Ben Hosmer

Brevard Tech - Brevard County Florida's Tech User Group

Dan Garthwaite

unread,
Oct 17, 2012, 9:43:24 AM10/17/12
to salt-...@googlegroups.com
I gave up fighting and now consider the id: field in /etc/salt/minion to be The Truth.  I have a salt state to configure /etc/hostname and /etc/hosts based on that.

Thomas S Hatch

unread,
Oct 17, 2012, 11:39:48 AM10/17/12
to salt-...@googlegroups.com
Just for the record, we have made Salt Cloud use the id field in the minion config to define the ultimate truth for minions.

Jeff Bauer

unread,
Oct 17, 2012, 11:50:20 AM10/17/12
to salt-...@googlegroups.com
Thomas,

Following your lead, I may make it mandatory for Shaker which
allows the user to set the hostname.

Jeff Bauer
Rubicon, Inc.
Reply all
Reply to author
Forward
0 new messages