cfagent script replaces with empty string?

Steffen Grunewald steffen.grunewald at aei.mpg.de
Tue Jun 30 15:44:47 CEST 2009


I'd like to define the network interfaces statically. Therefore, I have
prepared a /etc/network/interfaces file (with the proper class), the
corresponding section reads:

auto eth0
iface eth0 inet static
    address IPADDRESS
    netmask IPNETMASK
    network IPNETWORK

The script reads:

#!/usr/sbin/cfagent -v -f

# modify setup: /etc/network/interfaces

control:
    any::
    actionsequence = ( editfiles )
    EditFileSize = ( 65000 )

editfiles:
# first for all classes
    any::
        { ${target}/etc/network/interfaces
          ReplaceAll                    "IPADDRESS"     With    "${IPADDR}"
          ReplaceAll                    "IPNETMASK"     With    "${NETMASK}"
          ReplaceAll                    "IPNETWORK"     With    "${NETWORK}"
        }

And, of course, the environment variables are set (checked in a shell script
before and after):

Nevertheless, $NETMASK isn't used, and the following fragment results:

auto eth0
iface eth0 inet static
    address 10.100.200.13
    netmask
    network 10.100.0.0

Thanks to the -v option to cfagent, I can see the following:

Begin editing /target/etc/network/interfaces
Checking for global replace/IPADDRESS/10.100.200.13
Inserting #    address 10.100.200.13
Delete Item: #    address IPADDRESS
Inserting     address 10.100.200.13
Delete Item:     address IPADDRESS
Checking for global replace/IPNETMASK/
Inserting #    netmask
Delete Item: #    netmask IPNETMASK
Inserting     netmask
Delete Item:     netmask IPNETMASK
Checking for global replace/IPNETWORK/10.100.0.0
Inserting #    network 10.100.0.0
Delete Item: #    network IPNETWORK
Inserting     network 10.100.0.0
Delete Item:     network IPNETWORK
End editing /target/etc/network/interfaces

With an old version of FAI, and cfengine instead of cfagent, this used to work.

Any suggestions?


Cheers,
 Steffen

-- 
Steffen Grunewald * MPI Grav.Phys.(AEI) * Am Mühlenberg 1, D-14476 Potsdam
Cluster Admin * http://pandora.aei.mpg.de/merlin/ * http://www.aei.mpg.de/
* e-mail: steffen.grunewald(*)aei.mpg.de * +49-331-567-{fon:7233,fax:7298}
No Word/PPT mails - http://www.gnu.org/philosophy/no-word-attachments.html


More information about the linux-fai mailing list