mk_conf - generate configuration files
base
mk_conf [--help] [--db connectstring] ( <item>... | --sysarch <name> | --local ) [ --dryrun | --dump ] [--dhcpd] [--hosts] [--ifcfg] [--pxelinux] [--rhosts] [--static-routes] [--syslog-ng] [--hostname] [--grub] [--fstab] [--raidtab]
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.
--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.
--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.
Configuration contents are based primarily on which object attributes are set and what they are set to. Here is a list of key attributes:
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.
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
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).
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
build_diskless, MkConf