Ping $(hostname -f) from installer manual

Where does that syntax come from? The manual says to make sure this does
not return 127.0.0.1 (mine DOES do that) I've tried hostname-f and it
returns the name of my computer. putting (hostname -f) on the command line
gets the same result. Putting $(hostname -f) on the command line results in
MY-HOSTNAME: command not found, so I don't see how that syntax supplies a
valid argument to ping, but it does. I am at home on a laptop, so that is
the best that I can do.

I probably have to install foreman on my VPC to get it to work right and
configure the instances on the VPC, right? (Was hoping the laptop would
work :frowning: )

> Where does that syntax come from? The manual says to make sure this does
> not return 127.0.0.1 (mine DOES do that) I've tried hostname-f and it
> returns the name of my computer. putting (hostname -f) on the command line
> gets the same result. Putting $(hostname -f) on the command line results in
> MY-HOSTNAME: command not found, so I don't see how that syntax supplies a
> valid argument to ping, but it does. I am at home on a laptop, so that is
> the best that I can do.
>

This is standard Bash interpolation. The parentheses cause bash to execute
the command and then use the result. So "ping $(hostname -f)" simply means,
in my case "ping emerald.elysium.emeraldreverie.org". It's pinging the
laptop itself, in other words. Obviously once we're talking about ping,
we're talking about DNS and name resolution. Ping always prints the IP,
regardless of whether you're pinging a name or an IP.

The aim of this check is that the Foreman Installer is going to write the
IP that hostname -f resolves to into a bunch of config files, some of which
are used for other hosts to contact Foreman. As such, it's useless if a
newly provisioned host is told to conact Foreman on 127.0.0.1, as that
clearly can't work. So we ask people to ensure that the hostname resolves
to a usable IP before starting.

I probably have to install foreman on my VPC to get it to work right and
> configure the instances on the VPC, right? (Was hoping the laptop would
> work :frowning: )
>
> It will work fine on a laptop (I run development versions on mine). You
probably just need to add a line to your /etc/hosts to fix how it resolves
the local name.

Greg

··· On 18 January 2016 at 17:32, Dennis Gearon wrote:

You need the FQDN of the host. Even if you are just doing a 'standalone'
test install.

The FQDN also becomes the first part of the Puppet certs. When you get
Foreman up and running take a look in /var/lib/puppet/ssl/. Also as Greg
pointed out the FQDN ends up in a few of the Foreman configuration files.

In /etc/hosts you need a line like:

192.168.10.167 foreman110.example.com foreman110

This is something I do for each new release of Foreman on my own laptop
(running VMWare Workstation). Bring up a new VM and check the I get the
FQDN from hostname -f

Regards, Mike.

··· On Monday, January 18, 2016 at 12:32:10 PM UTC-5, Dennis Gearon wrote: > > Where does that syntax come from? The manual says to make sure this does > not return 127.0.0.1 (mine DOES do that) I've tried hostname-f and it > returns the name of my computer. putting (hostname -f) on the command line > gets the same result. Putting $(hostname -f) on the command line results in > MY-HOSTNAME: command not found, so I don't see how that syntax supplies a > valid argument to ping, but it does. I am at home on a laptop,, so that is > the best that I can do. > > I probably have to install foreman on my VPC to get it to work right and > configure the instances on the VPC, right? (Was hoping the laptop would > work :-( ) >

I forgot to mention that the laptop is on a home network, so I have to deal
with the ATT&T supplied router, blah blah blah. I think it will be less
hassle to just put up a micro instance and run foreman oin that.

··· On Mon, Jan 18, 2016 at 1:52 PM, Greg Sutcliffe wrote:

On 18 January 2016 at 17:32, Dennis Gearon gearond@gmail.com wrote:

Where does that syntax come from? The manual says to make sure this does
not return 127.0.0.1 (mine DOES do that) I’ve tried hostname-f and it
returns the name of my computer. putting (hostname -f) on the command line
gets the same result. Putting $(hostname -f) on the command line results in
MY-HOSTNAME: command not found, so I don’t see how that syntax supplies a
valid argument to ping, but it does. I am at home on a laptop, so that is
the best that I can do.

This is standard Bash interpolation. The parentheses cause bash to execute
the command and then use the result. So “ping $(hostname -f)” simply means,
in my case “ping emerald.elysium.emeraldreverie.org”. It’s pinging the
laptop itself, in other words. Obviously once we’re talking about ping,
we’re talking about DNS and name resolution. Ping always prints the IP,
regardless of whether you’re pinging a name or an IP.

The aim of this check is that the Foreman Installer is going to write the
IP that hostname -f resolves to into a bunch of config files, some of which
are used for other hosts to contact Foreman. As such, it’s useless if a
newly provisioned host is told to conact Foreman on 127.0.0.1, as that
clearly can’t work. So we ask people to ensure that the hostname resolves
to a usable IP before starting.

I probably have to install foreman on my VPC to get it to work right and

configure the instances on the VPC, right? (Was hoping the laptop would
work :frowning: )

It will work fine on a laptop (I run development versions on mine). You
probably just need to add a line to your /etc/hosts to fix how it resolves
the local name.

Greg


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/6SsmmjEt-Bk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.