TABLE OF CONTENTS
- Config/distfile/Makefile
- Config/distfile/Makefile/check
- Config/distfile/Makefile/check-config
- Config/distfile/Makefile/files-report
- Config/distfile/Makefile/host-targets
- Config/distfile/Makefile/settings
Config/distfile/Makefile [ Modules ]
NAME
Makefile -- Makefile for generating distfiles
SYNOPSIS
cd Config/distfile; make
PURPOSE
This target generates and checks the Distfile generated from distfile.base and the report from the database.
Config/distfile/Makefile/check [ Targets ]
NAME
check -- check the Distfile for syntax errors
SYNOPSIS
cd Config/distfile; make [args="rdist args"] check
PURPOSE
This target generates and checks the Distfile generated from distfile.base and the report from the database. It will spit out all the possible commands/files that rdist will push if all files were out of date.
It uses the currently checked out tree, so it may not pass if there isn't a full tree checked out. You can add arguments to the rdist call by passing them on the make command line as the definition of the args variable.
Config/distfile/Makefile/check-config [ Targets ]
NAME
check-config -- check the Distfile for syntax errors using /config
SYNOPSIS
cd Config/distfile; make [ROOT=/other] check-config
PURPOSE
This target generates and checks the Distfile generated from distfile.base and the report from the database. It will spit out all the possible commands/files that rdist will push if all files were out of date.
By default uses the tree checked out to /config, so it may not pass if there isn't a full tree checked out and accessible by the current user. By setting the ROOT variable on the command line other tree roots can be tested against.
Config/distfile/Makefile/files-report [ Targets ]
NAME
files-report -- generate a list of 'host: destination < source' lines
SYNOPSIS
cd Config/distfile; make files-report
PURPOSE
Produces a list of
'host: destination < source' for every pushed
file or directory. Use this to discover what source file goes where or find out what file/directory on a host comes from what source file using grep/sed etc. It also changes unique file names (used for FORCERUN/RUN commands) into the file TrIgGeR so that multiple runs of file-report can be diffed to show actual file changes and not the noise of expected changes.
Config/distfile/Makefile/host-targets [ Targets ]
NAME
host-targets -- Identify entries that push to hosts rather than classes.
SYNOPSIS
cd Config/distfile; make host-targets
PURPOSE
This target lists a portion of the stanza's that use hosts rather than classes in defining the target systems. While it's not wrong to use hosts, it does add a little to the amount of work needed to ferret out the role -> host information.
EXAMPLE
Running make host-targets shows:
cron: $C/cron/nagios/kennebec.example.com -> kennebec.example.com install -ocompare /var/spool/cron/nagios ; special "EDITOR=/bin/touch crontab -u nagios -e" ; -- ntp: $C/ntp/hosts/river.ntp.conf -> river.example.com SAVEINSTALL(/etc/ntp.conf, 10) ; REPORTTARGET; cmdspecial "/etc/rc.d/init.d/ntpd restart" ; -- ntp: $C/ntp/hosts/forth.ntp.conf -> forth.example.com SAVEINSTALL(/etc/ntp.conf, 10) ; REPORTTARGET; cmdspecial "/etc/rc.d/init.d/ntpd restart" ;
So we can see that thames, forth and kennebec all have host unique files being pushed to them.
NOTE The stanzas that are printed may be truncated compared to what is in distfile.base. Also it requires the convention that the hosts must all be on the same line as the -> characters.
Config/distfile/Makefile/settings [ Targets ]
NAME
settings -- generate a shell compatible list of hosts in classes
SYNOPSIS
cd Config/distfile; make settings
PURPOSE
This target generates a file with shell variables set to a list of hosts that have that charasteristic. It is used by the HOST_VERIFY target in rdist to prevent pushing to hosts that are misdefined in the database.
If a service tag includes a -, it is mapped to an _ since - is not a valid character in a shell variable name.
EXAMPLE
A sample entry is:
ALL_HOSTS=" allegheny.example.com amazon.example.com ... xingu.pub.example.com " CENTOS_4_2=" hotel.example.com ... store02.example.com " CENTOS_4_3=" vpn01.example.com cook04.example.com " CENTOS_4_X=" vpn01.example.com hotel.example.com hotel.pub.example.com " CENTOS_HOSTS=" vpn01.example.com hoten.example.com ... store02.example.com " CISCO_IOS_0_0=" chubut.example.com ... sc01.example.com " CISCO_IOS_0_X=" chubut.example.com sc01.example.com "
It is easy to determine if a host is present in the variable by using the exit code of commands like:
echo CENTOS_4_3 | grep " hotel.example.com " > /dev/null
or case "$CENTOS_4_2" in; " hotel.example.com ") echo yes;;esac in both cases the host will have leading and trailing spaces which can be used as delimeters.