help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does cfagent determine the hostname?


From: Sami J. Mäkinen
Subject: Re: How does cfagent determine the hostname?
Date: Thu, 23 Sep 2004 08:37:49 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913


Timothy Sven Nelson wrote:

I'm trying to automate a machine installation with kickstart and cfengine. In my %post section, the last two lines are

hostname `hostname --fqdn`
cfagent -Kvq

This approach seems to work on RHAS2.1, but not RHEL3.

How should I set the hostname for cfagent?


    If I recall, what I was doing at my previous workplace was to:
1.    Ensure a working DNS configuration (and IP address) are set up in
    Kickstart somewhere.
2.    Use "host $ip" to get the hostname (you need reverse DNS set up
    for this).

We are using this in our %post section for RHEL3:

--- 8< ---
########################################################################
# Set hostname, needed by cfengine
if [ -f /etc/sysconfig/network ]
then
    . /etc/sysconfig/network
fi
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]
then
    echo "*** No host, can't install ***"
    exit 1
fi
/bin/hostname $HOSTNAME
--- 8< ---

Remember, %post commands are run chrooted to the newly installed system.


--
-- sjm
"Pirättäkää. Nakkeletta nuallen rassukoollen peräkoijasta
 jokuja napollisia opaalia."  - Junttapurin maharatsa



reply via email to

[Prev in Thread] Current Thread [Next in Thread]