NAME

mk_conf - generate configuration files


MODULE

base


SYNOPSIS

  mk_conf [--help] [--db connectstring]
        ( <item>... | --sysarch <name> | --local )
        [ --dryrun | --dump ]
        [--dhcpd] [--hosts] [--ifcfg] [--pxelinux] [--rhosts]
        [--static-routes] [--syslog-ng] [--hostname]
        [--grub] [--fstab] [--raidtab]


DESCRIPTION

This script generates configuration files based on the current settings in the CIToolkit database. If a particular config type requires running a command (such as restarting a daemon) to make the new config take effect, then mk_conf will do so.


OPTIONS - CONFIGURATION TYPES

--dhcpd Generate /etc/dhcpd.conf file for the specified nodes. If a given node is not a leader or an admin node, then the config will be generated for the specified node's leader.

--hosts Generate /etc/hosts file for all Devices in the database. The file will be written into a diskless image based on the 'sysarch' attribute of the specified node, or of it's leader if sysarch is not defined.

--ifcfg Generate network ifcfg-eth* files for the specified nodes.

--hostname Generate /etc/HOSTNAME for the specified nodes.

--pxelinux Generate pxelinux.cfg files for the specified nodes. The file will be written into the diskless image based on the 'sysarch' attribute of the specified node's leader. See PXE INCLUDE FILE section as well.

--rhosts Generate /root/rhosts file for all Devices in the database. The file will be written into a diskless image based on the 'sysarch' attribute of the specified node, or of it's leader if sysarch is not defined.

--hosts-equiv Generate /etc/hosts.equiv file for the specified nodes. The file will be written into a node specific location which is either a node's diskless mount tree or locally on a diskfull node.

--static-routes Generate /etc/sysconfig/static-routes file for the specified nodes.

--syslog-ng Generate /etc/syslog-ng/syslog-ng.conf file for the specified nodes.

--grub Generate /boot/grub/menu.lst file for the specified node. Unlike most other conf files, this should ONLY be run on the node (not the nfs server). (Must be specified with --local)

--fstab Generate /etc/fstab for the specified node, assuming a diskfull boot. (Must be specified with --local)

--fstab Generate /etc/raidtab for the specified node.


OTHER OPTIONS

--local Write files to a local disk, instead of into the diskless hierarchy on the nfs server.

--localroot <path> Use path instead of "/" when writing locally.

--dump Print generated content to STDOUT, instead of writing it to disk.

--dryrun List the files to be changed, don't actually write them.

--sysarch <name> System architecture to generate "global" configs for, like hosts and .rhosts. Either --sysarch or an item list is required.

--db <connectstring> Database type and connection information. For GDBM, "GDBM:" followed by the filename of the cluster database to use. For LDAP, the syntax is "LDAP:host:port:dbname"

--help Print extended usage information

--man Print this manpage.


OBJECT ATTRIBUTES

Configuration contents are based primarily on which object attributes are set and what they are set to. Here is a list of key attributes:

sysarch
The system architecture string. Defines where the configuration file will be written (what image or overlay) and in some cases, like dhcpd.conf which has varying syntax, how it will be generated.

leader
The node device responsible for managing the selected object. Defines where some diskless boot configuration files, like dhcpd.conf and pxelinux.cfg will be written.

role
If set to "leader" or "admin", then a dhcpd.conf file may be generated for the selected object. Otherwise, it may be generated for the object's leader. Objects with role set to "leader" or "admin" are also candidates for inclusion in the .rhosts file.

If set to "monitor", or if set to "admin" if there are no nodes with a role of "monitor", then syslog-ng.conf will be created to write syslog messages to the local disk. Otherwise, messages will be forwarded to the host specified by the leader attribute.

interfaces
A complex attribute, defines hostnames, IP addresses, MACs, netmasks, and the like. Used as necessary to generate multiple config files, too involved to go into here, but mostly intuitive.

image
Kernel image name to be booted via dhcp. (but see the pxeimage attribute below)

pxeimage
pxelinux image to be booted via dhcp. If defined, and image is defined, then the dhcpd.conf "filename" option will be set to the pxeimage, and the kernel specified by the image attributed may be loaded from PXE via the "KERNEL" option in pxelinux.cfg.

bootflags
Specifies parameters to pass to the kernel, aside from those necessary for diskless booting, etc. By default, "console=ttyS0,9600n8" is used. (to allow kernel boot messages to be seen over the serial console)

bootmode
Determines how a node should be booted. Valid values are "diskless", "initrd", "diskfull", "dos", and "hybrid". Defaults to "diskless". Used to generate pxelinux.cfg.

bootaction
Determines if a node should load the OS after being powered on. Valid values are "halt" and ("boot" or any other string). Defaults to loading the OS.

initrd
Defines the initial ramdisk image that should be loaded when the bootmode attribute is set to "initrd".

disks
A complex attribute defining partitions, mountpoints, file system types, etc. Used to generate /boot/grub/menu.lst, /etc/fstab, and /etc/raidtab.


PXE INCLUDE FILE

When PXE config files are generated by mk_conf, a standard set of PXE targets (e.g. diskless, diskfull) are generated based on a given node's attributes. Additional user-configured PXE targets can also be utilized using the PXE include file which is usually setup to be /tftpboot/pxelinux.cfg/CIT_pxe_include in the CConf.pm file. When mk_conf generates a PXE config file and sees the existence of the PXE include file, contents of the file are appended to the PXE config.

The 'bootmode' attribute of a node is what the generated PXE config files use as the DEFAULT parameter.

An example of utilizing the PXE include capability might be for doing firmware upgrades. First, add a PXE target in the PXE include file. For example: LABEL firmware-flash KERNEL /memdisk APPEND initrd=firmware.img

Second, set the 'bootmode' attribute for the node that you want to flash firmware on: device_mgr --set --bootmode firmware-flash node10

Third, generate a new PXE config: mk_conf --pxe node10

Fourth, power cycle the node: power --cycle node10


NOTES

mk_conf will accept multiple devices or collection on the command line.

If no configuration types are specified on the command line, then mk_conf will default to generating all "single node" configs:

  ifcfg static_routes syslog_ng pxelinux hostname

If the --sysarch option is used, then the default config type set will be changed to all "global" configs:

  hosts rhosts

If --local is specified, then there are NO default config types set.

So, the following are equivalent pairs of commands:

  mk_conf node1 node2
  mk_conf --ifcfg --static_routes --syslog_ng --pxelinux node1 node2
  mk_conf --sysarch rh-9.0-i386
  mk_conf --hosts --rhosts --sysarch rh-9.0-i386

And, assuming the sysarch for admin0 is rh-7.2-alpha, then the following commands are also equivalent:

  mk_conf --hosts --sysarch rh-7.2-alpha
  mk_conf --hosts admin0

mk_conf utilizes the MkConf libraries to do the real work of generating each config file (e.g. MkConf::pxelinux deals with mk_conf --pxe).


FILES

The default paths for location of the cluster configuration database, cloned directories, supporting libraries, and other settings are recorded in the CConf.pm config file. Set the environment variable CLUSTER_CONFIG to the location of CConf.pm, or use the default of /cluster/config


SEE ALSO

build_diskless, MkConf