hostlist.cfg

Package: WA2L/edrc 1.5.57
Section: Configuration Files (4)
Updated: 23 March 2013
Index Return to Main Contents

 

NAME

hostlist.cfg - configuration file for hostlist

 

SYNOPSIS

edrc/etc/hostlist.cfg

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

This is the configuration file for the hostlist command.

 

FILEFORMAT

The fileformat is OPTION=VALUE

Between the OPTION, the = and the VALUE are no spaces.

Rows starting with a # are considered as comments.

You should not comment out any OPTION If you like to use default settings simply do not specify a VALUE.

 

OPTIONS

HOSTLIST
Definition of hosts that are returned when invoking hostlist without options.

Example: HOSTLIST="dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32 dcdbsi33"

Default: HOSTLIST=""

HOSTGRPS
Definitions of groups of hosts that are returned when invoking hostlist with the -g @GRPNAME option.

Example: HOSTGRPS="@ADM: adm_db1_mnt adm_db1_tst adm_db1_pre adm_db1_prod
                    @BE: dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32"

Default: HOSTGRPS=""

CACHE
Set this setting to True to cache the resolved HOSTLIST and HOSTGRPS settings, set it to False to not to use a cache.

Example: CACHE=True

Default: CACHE=False

CACHE_DEPENDENCY
List of files on which the cache data depends on. If you specify a relative path name the path is relative to the root of the WA2L/edrc installation. This setting is only active if the CACHE setting is set to True.

Example: CACHE_DEPENDENCY="etc/hostlist.cfg etc/hostlist.dat etc/server_environment.cfg"

Default: CACHE_DEPENDENCY="etc/hostlist.cfg etc/server_environment.cfg"

 

EXAMPLES

1) very simple configuration for one environment

This configuration contains the servers in the environment (PRODUCTION) of an enterprise where WA2L/edrc is installed. If WA2L/edrc is installed in other environments (TEST, PREPRODUCTION), too, a specific edrc/etc/hostlist.cfg configuration file has to be defined for each environment.

#
# Purpose of the different HOSTGRPS:
#
#   @_DIST:     Distribution group where edrc distributes when invoking the
#               edrc 'distribute' command. Do not use this group for manual
#               invocations of rcmd or filedist.

# List of hosts / Groups of hosts
#
HOSTLIST="dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32 dcdbsi33"
HOSTGRPS="@_DIST:
                                        dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32
                                        dcdbsi33
         "

2) advanced config for multiple environments

To have a single edrc/etc/hostlist.cfg configuration file for all environments (TEST, PREPRODUCTION, PRODUCTION) in the enterprise the server_environment(3) command can be used in the configuration file. In this configuration file example the HOSTLIST definition is defined for each environment with the focus to the related environment and because the HOSTGRPS definition is identical for all environments it can be defined once. If HOSTGRPS are different for each environment it has to be defined for each environment, too.

#
# Purpose of the different HOSTGRPS:
#
#   @_DIST:     Distribution group where edrc distributes when invoking the
#               edrc 'distribute' command. Do not use this group for manual
#               invocations of rcmd or filedist.
#   @ALL:       All servers of the whole environment (MAINTENANCE, TEST, 
#               PREPRODUCTION and PRODUCTION)
#

# Groups of hosts
#
HOSTGRPS="@_DIST:
                                        dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32
                                        dcdbsi33 
                                        dcdbsi61 dcdbsi62 dcdbsi63 dcdbsi64
                                        dcdbsi71 dcdbsi72 dcdbsi73 dcdbsi74
                                        dcdbsi50
                  @ALL:
                                        dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32
                                        dcdbsi33 
                                        dcdbsi61 dcdbsi62 dcdbsi63 dcdbsi64
                                        dcdbsi71 dcdbsi72 dcdbsi73 dcdbsi74
                 "

# List of hosts
#
case `server_environment` in
        PRODUCTION)
                        HOSTLIST="dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32 dcdbsi33"
                        ;;
        PREPRODUCTION)
                        HOSTLIST="dcdbsi61 dcdbsi62 dcdbsi71 dcdbsi72"
                        ;;
        TEST)
                        HOSTLIST="dcdbsi63 dcdbsi64 dcdbsi73 dcdbsi74"
                    ;;
esac

3) advanced config for multiple environments with disaster recovery support

The setup in this disaster recovery scenario is, that the PREPRODUCTION is used to recover the PRODUCTION environment to.

If the file /.DISASTER_CASE exists it is assumed that a DISASTER CASE SITUATION exists. In that case the list of hosts is returned that correlated to this situation. To make this happen the configuration edrc/etc/server_environment.cfg has to be replaced by a configuration file that returns PRODUCTION for the hosts being part of the former PREPRODUCTION environment.

# List of hosts / Groups of hosts
#
case `server_environment` in
        PRODUCTION)     
                if [ -f /.DISASTER_CASE ]; then
                        ##
                        ## DISASTER CASE SITUATION
                        ##   All servers from the PREPRODUCTION are used to form the
                        ##   PRODUCTION environment.
                        ##   The HOSTGRPS  are  restricted  PREPRODUCTION  hosts  to 
                        ##   encapsulate  the  'Disaster Recovery Environment'  from
                        ##   the  other  environments  during a 'Disaster Simulation'
                        ##   or a 'Disaster Case'. 
                        ##
                        ##
                        HOSTLIST="dcdbsi61 dcdbsi62 dcdbsi71 dcdbsi72"
                        HOSTGRPS="@_DIST:
                                                                dcdbsi61 dcdbsi62 dcdbsi71 dcdbsi72 
                                                                dcdbsi50
                                          @ALL:
                                                                dcdbsi61 dcdbsi62 dcdbsi71 dcdbsi72 
                                         "
                else
                        ##
                        ## NORMAL OPERATION SITUATION
                        ##
                        HOSTLIST="dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32 dcdbsi33"
                        HOSTGRPS="@_DIST:
                                                                dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32
                                                                dcdbsi33 
                                                                dcdbsi61 dcdbsi62 dcdbsi63 dcdbsi64
                                                                dcdbsi71 dcdbsi72 dcdbsi73 dcdbsi74
                                                                dcdbsi50
                                          @ALL:
                                                                dcdbsi20 dcdbsi21 dcdbsi30 dcdbsi31 dcdbsi32
                                                                dcdbsi33 
                                                                dcdbsi61 dcdbsi62 dcdbsi63 dcdbsi64
                                                                dcdbsi71 dcdbsi72 dcdbsi73 dcdbsi74
                                         "
                fi
                ;;

:
:

esac

4) define hosts in hostlist.dat

This is the definition as documented in edrcsetup(1m) of WA2L/edrc starting with release 1.5.43 and is also the configuration file contents that is distributed with the full application package from now on (see also: edrc/var/samples/hostlist/07/ and edrc/var/samples/hostlist/08/).

To define the hosts and groups in the hostlist.dat file, set the USE_HOSTLIST_DAT setting to True.

:
:

# Set USE_HOSTLIST_DAT to True, if hosts are listed in
# the etc/hostlist.dat file, if hosts are defined directly
# in etc/hostlist.cfg, set USE_HOSTLIST_DAT to False.
#
USE_HOSTLIST_DAT=True


# Define the central administration environment in the 
# format CUSTOMER.NAME as defined in server_environment.cfg.
#
CMAN_ENVIRONMENT="Highlander.ADMIN"


# Read hostlist.dat definitions as resolved.
#
if [ "$USE_HOSTLIST_DAT" = True ]; then
        case `server_environment -C`.`server_environment` in
                $CMAN_ENVIRONMENT)
                        out=`hostlistdat2cfg -o -m MGRPS_LIST=@LINUX,@SOLARIS,@HPUX` ;;
                *)      out=`hostlistdat2cfg -o` ;;
        esac
        . $out; removetemp -q -d `dirname ${out}`; return 0
fi


# List of hosts when defined directly in the hostlist.cfg
# file.
#
case `server_environment -C`.`server_environment` in
        WA2L.EDRC_DVLP)
                HOSTLIST="
                         "
                HOSTGRPS="@_DIST:
                                  @ALL:
                         "
                ;;
esac

 

SEE ALSO

edrcintro(1), hostlist(1), hostlist.dat(4), hostlistdat2cfg(3), server_environment(3), server_environment.cfg(4), edrc/var/samples/hostlist/

 

NOTES

-

 

BUGS

-

 

AUTHOR

hostlist.cfg was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2013 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
FILEFORMAT
OPTIONS
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 00:14:04 GMT, March 08, 2025