summaryrefslogtreecommitdiffstats
path: root/config.d/00base.defconf
diff options
context:
space:
mode:
Diffstat (limited to 'config.d/00base.defconf')
-rw-r--r--config.d/00base.defconf546
1 files changed, 0 insertions, 546 deletions
diff --git a/config.d/00base.defconf b/config.d/00base.defconf
deleted file mode 100644
index 5b78545..0000000
--- a/config.d/00base.defconf
+++ /dev/null
@@ -1,546 +0,0 @@
-# Hey Emacs, this is a -*- shell-script -*- !!!
-
-######################################################################
-
-# Cluster
-
-defconf CLUSTERFS_TYPE "gpfs" \
- "<gpfs|?>" "type of cluster filesystem to use"
-
-defconf CLUSTERFS_DEFAULT_MOUNTPOINT "/clusterfs" \
- "<directory>" "mountpoint for default cluster filesystem"
-
-defconf NODES "nas:0-3 rhel_base:4" \
- "<nodes>" "list of node types to create, with associated IP offsets"
-
-# a directory on the host which will be mounted via NFS onto the nodes
-# as $NFS_MOUNTPOINT, giving a nice common area independent of the
-# cluster filesystem. This is useful for compiles, RPMs, devel
-# scripts etc you need to add this to your /etc/exports and run
-# exportfs -av yourself on the virtualisation host
-defconf NFSSHARE "@uto" \
- "<mnt>" "NFS share to mount on each node"
-
-defconf NFS_MOUNTPOINT "/home" \
- "<dir>" "mount point for NFS share"
-
-######################################################################
-
-# Directories and files
-
-# these are the default autocluster config options
-# please override with your own options in your own config file
-
-defconf VIRTBASE /virtual \
- "<path>" "virtual machine directory for this host"
-
-# the name of the base RHEL install image that the nodes will be based on
-# a kvm image called $VIRTBASE/$BASENAME.img will be created
-# that will form the basis file for the images for each of the nodes
-defconf BASENAME "ac-base" \
- "<file>" "filename for cluster base image"
-
-defconf BASE_PER_NODE_TYPE "no" \
- "<yes|no>" "Use per-node-type base images"
-
-defconf DISK_FOLLOW_SYMLINKS "no" \
- "<yes|no>" "If disk images use symlinks then follow them to overwrite"
-
-######################################################################
-
-# Virtualisation
-
-defconf VIRSH "virsh -c qemu:///system" \
- "<cmd>" "how to invoke virsh"
-
-defconf KVM "@uto" \
- "<file>" "location of KVM executable"
-
-defconf KVMLOG "/var/log/kvm" \
- "<dir>" "directory for serial logs"
-
-defconf NODE_TEMPLATE "$installdir/templates/node.xml" \
- "<file>" "libvirt template for nodes"
-
-defconf INSTALL_TEMPLATE "$installdir/templates/install.xml" \
- "<file>" "libvirt template for initial install"
-
-defconf INSTALL_KERNEL_OPTIONS "@uto" \
- "<options>" "installer kernel command-line options"
-
-defconf BOOT_TEMPLATE "$installdir/templates/bootbase.xml" \
- "<file>" "libvirt template for \"bootbase\" command"
-
-defconf BASE_TEMPLATES "$installdir/base" \
- "<dir>" "directory containing base templates"
-
-defconf BASE_FORMAT "qcow2" \
- "<fmt>" "format to use for the qemu base images"
-
-defconf SYSTEM_DISK_TYPE "virtio" \
- "scsi|ide|virtio" "type of disks to use in nodes"
-
-rhel_disk_prefix ()
-{
- case "$1" in
- (scsi|iscsi) echo "sd" ;;
- (virtio) echo "vd" ;;
- ide)
- case "$RHEL_VERSION" in
- (5.*) echo "hd" ;;
- ([67].*) echo "sd" ;;
- (*) die "Unknown RHEL_VERSION in rhel_disk_prefix" ;;
- esac
- ;;
- (*) die "Unknown disk type \"$1\" in rhel_disk_prefix" ;;
-
- esac
-}
-
-defconf SYSTEM_DISK_PREFIX "@uto" \
- "sd|hd|vd" "system disk device prefix"
-
-defconf SYSTEM_DISK_CACHE "writeback" \
- "default|none|writeback|writethrough" "system disk cache type"
-
-defconf SYSTEM_DISK_FORMAT "qcow2" \
- "qcow2|raw|reflink|mmclone|none" "system disk image format"
-
-defconf SYSTEM_DISK_ACCESS_METHOD "@uto" \
- "loopback|guestfish|guestmount" "how to setup up disk images"
-
-system_disk_access_method_hook ()
-{
- if [ "$SYSTEM_DISK_ACCESS_METHOD" = "@uto" ] ; then
- if [ "$SYSTEM_DISK_FORMAT" = "qcow2" ] ; then
- if which guestmount >/dev/null 2>&1 ; then
- SYSTEM_DISK_ACCESS_METHOD="guestmount"
- elif which guestfish >/dev/null 2>&1 ; then
- SYSTEM_DISK_ACCESS_METHOD="guestfish"
- elif which qemu-nbd nbd-client >/dev/null 2>&1 ; then
- SYSTEM_DISK_ACCESS_METHOD="loopback"
- else
- die "Can't determine SYSTEM_DISK_ACCESS_METHOD. Need guestfish or qemu-nbd + nbd-client."
- fi
- else
- SYSTEM_DISK_ACCESS_METHOD="loopback"
- fi
- fi
-}
-
-register_hook post_config_hooks system_disk_access_method_hook
-
-system_disk_mounts ()
-{
- # We could call a function using call_func(). However, we want
- # the options listed in the documentation for
- # SYSTEM_DISK_ACCESS_METHOD, so they need to be hardcoded... so
- # we might as well hardcode this function (for now).
- case "$SYSTEM_DISK_ACCESS_METHOD" in
- loopback)
- case "$RHEL_VERSION" in
- (5.*) echo "/:32256" ;;
- ([67].*) echo "/:1048576" ;;
- (*) die "Unknown RHEL_VERSION in system_disk_mounts" ;;
- esac
- ;;
- (guestfish|guestmount) : ;;
- (*) die "Unknown SYSTEM_DISK_ACCESS_METHOD in system_disk_mounts" ;;
- esac
-}
-
-defconf SYSTEM_DISK_MOUNTS "@uto" \
- "<list>" "list of mountpoints and offsets/devices for mount_disk()"
-
-######################################################################
-
-# Node
-
-# what timezone to put the nodes in
-# leave this empty to base the timezone on the zone that
-# this host is in
-defconf TIMEZONE "" \
- "<tz>" "timezone for each node"
-
-# how much disk space to use on each node
-# note that it will only use what is actually occupied,
-# so start this larger than you think you'll need
-defconf DISKSIZE "20G" \
- "<n>G" "maximum disk size for each node"
-
-defconf ROOTSIZE 15000 \
- "<n>" "size of root partition in MB"
-
-defconf SWAPSIZE 2000 \
- "<n>" "size of swap partition in MB"
-
-rhel_default_mem ()
-{
- case "$RHEL_VERSION" in
- (5.*) echo "262144" ;;
- ([67].*) echo "512000" ;;
- (*) die "Unknown RHEL_VERSION in rhel_default_mem" ;;
- esac
-}
-
-defconf MEM "@uto" \
- "<n>" "memory allocated for each node"
-
-defconf NICMODEL "e1000" \
- "<module>" "choice of KVM network adapter"
-
-defconf ROOTPASSWORD "password" \
- "<string>" "initial root password for each node"
-
-defconf NUMCPUS 2 \
- "<n>" "number of virtual CPUs per node"
-
-# Some machines need "clocksource=jiffies"
-defconf EXTRA_KERNEL_OPTIONS "" \
- "<string>" "extra kernel options for nodes"
-
-defconf HOSTNAME_HACKING_FUNCTION "" \
- "<string>" "function to modify node hostnames, see the code for details"
-
-defconf HOSTS_STATIC_ENTRIES "/dev/null" \
- "<file>" "a file containing extra static entries to add to /etc/hosts"
-
-######################################################################
-
-# Networking
-
-defconf DOMAIN "EXAMPLE.COM" \
- "<dom>" "Windows(TM) domain name for each node"
-
-defconf WORKGROUP "EXAMPLE" \
- "<grp>" "Windows(TM) workgroup for node"
-
-defconf NAMESERVER "@uto" \
- "<ip>" "DNS server for each node"
-
-defconf DNSSEARCH "$DOMAIN" \
- "<dom>" "extra domains for DNS search list"
-
-# Networks:
-# * First network is private and contains the CTDB node addresses.
-# * Items look like: net/bits,dev[,nat|bridge=host_iface][,gw=gateway_ip]
-
-defconf NETWORKS "10.0.0.0/24,eth0,gw=10.0.0.1 10.0.1.0/24,eth1 10.0.2.0/24,eth2" \
- "<list>" "description of IP networks"
-
-defconf NETWORK_STACK "ipv4" \
- "ipv4|dual|ipv6" "Configure IPv4/IPv6 stacks"
-
-make_public_addresses()
-{
- local firstip="${1:-$[${FIRSTIP} + ${PUBLIC_IP_OFFSET}]}"
- local num_addrs="$2"
-
- # By default the number of addresses on each public network is
- # the same as the number of nodes
- if [ -z "$num_addrs" ] ; then
- num_addrs=0
- _count_ctdb_nodes ()
- {
- if [ "$4" = "1" ] ; then
- num_addrs=$(($num_addrs + 1))
- fi
- }
- for_each_node _count_ctdb_nodes
- fi
-
- if [ $(( $firstip + $num_addrs - 1 )) -gt 254 ]; then
- die "make_public_addresses: last octet > 254 - change PUBLIC_IP_OFFSET"
- fi
-
- local n
- for n in $NETWORKS_PUBLIC ; do
- local dev="${n#*,}" # Strip address, comma
- dev="${dev%,*}" # Strip comma, interface
- echo -ne "${n%.*}.${firstip},${num_addrs},${dev} "
- done
- echo
-}
-
-networks_post_config_hook ()
-{
- [ -z "$IPBASE" -a -z "$IPNET0" -a -z "$IPNET1" -a -z "$IPNET2" ] || \
- die "Configuration variables IPBASE, IPNET0/1/2 unsupported - please use NETWORKS"
-
- # Convenience variables
- set -- $NETWORKS
- NETWORK_PRIVATE="$1" ; shift
- local t="${NETWORK_PRIVATE%%,*}"
- NETWORK_PRIVATE_PREFIX="${t%.*}"
- NETWORKS_PUBLIC="$*"
-}
-
-register_hook post_config_hooks networks_post_config_hook
-
-defconf NETWORK_TEMPLATE "|network_template" \
- "<file>" "libvirt template fragment for networks"
-
-network_template ()
-{
- local netname dev ip ipv6 mac opts
- while read netname dev ip ipv6 mac opts ; do
- cat <<EOF
- <interface type='network'>
- <mac address='${mac}'/>
- <model type='@@NICMODEL@@'/>
- <source network='${netname}'/>
- </interface>
-EOF
- done <"$network_map"
-}
-
-
-# the nodes will get IPs starting at this number
-# the TSM server will get $FIRSTIP, then the first node will get
-# the next IP etc
-# so if the private network is 10.0.0.0/24,eth0 and FIRSTIP is 20 then
-# you will get nodes like this:
-# tsmserver 10.0.0.20
-# 1st node 10.0.0.21
-# 2nd node 10.0.0.22
-# etc etc
-defconf FIRSTIP "20" \
- "<n>" "final octet for the 1st IP of the cluster"
-
-# Public addresses managed by CTDB.
-defconf PUBLIC_IP_OFFSET 100 \
- "<n>" "offset from FIRSTIP of public IP addresses"
-
-defconf PUBLIC_ADDRESSES "|make_public_addresses" \
- "<cmd>" "template for public address entry in nas.conf"
-
-# a caching web proxy that can get to the install server from the
-# nodes. If you don't have one on the local network then look in
-# host_setup/etc/squid for an example setup you can install on the kvm
-# host. The web proxy must cache large objects, and have room for
-# several G of cache You can choose to have no web proxy at all, in
-# which case set it to the empty string, and hope you have a fast
-# network connection to the install server
-defconf WEBPROXY "" \
- "<url>" "URL of a caching web proxy"
-
-defconf KVMHOST "10.0.0.1" \
- "<ip>" "KVM host - provides things like NTP, iSCSI targets, ..."
-
-defconf KDC_NAME "example-ad" \
- "<name>" "prefix of the name of the KDC"
-
-######################################################################
-
-# RHEL
-
-rhel_print_iso ()
-{
- # Uses: RHEL_VERSION, RHEL_ARCH
- # Prints: a value for ISO
-
- local datever
-
- case "$RHEL_VERSION" in
- (5.1) datever="20071017.0";;
- (5.2) datever="20080430.0";;
- (5.3) datever="20090106.0";;
- (5.4) datever="20090819.0";;
- (5.5) datever="20100322.0";;
- (5.6) datever="20110106.0";;
- (5.7) datever="20110711.5";;
- (5.8) datever="20120202.0";;
- (6.0) datever="20100922.1";;
- (6.1) datever="20110510.1";;
- (6.2) datever="20111117.0";;
- (6.3) datever="20120613.2";;
- (6.4) datever="20130130.0";;
- (6.5) datever="20131111.0";;
- (6.6) datever="20140926.0";;
- (6.7) datever="20150702.0";;
- (6.8) datever="20160414.0";;
- (6.9) datever="20170309.0";;
- (6.10) datever="20180525.0";;
- (7.0) datever="20140507.0";;
- (7.1) datever="20150219.1";;
- (7.2) datever="20151030.0";;
- (7.3) datever="20161019.0";;
- (7.4) datever="20170711.0";;
- (7.5) datever="20180322.0";;
- (*) die "Unknown RHEL_VERSION in rhel_print_iso" ;;
- esac
-
- case "$RHEL_VERSION" in
- (5.*) echo "RHEL${RHEL_VERSION}-Server-${datever}-${RHEL_ARCH}-DVD.iso" ;;
- (6.[0-5]) echo "RHEL${RHEL_VERSION}-${datever}-Server-${RHEL_ARCH}-DVD1.iso" ;;
- ([67].*) echo "RHEL-${RHEL_VERSION}-${datever}-Server-${RHEL_ARCH}-dvd1.iso" ;;
- esac
-}
-
-# yum repo infrastructure
-_YUM_TEMPLATE="$installdir/templates/RHEL.repo" # Private - used below!
-rhel_gen_yum_repos ()
-{
- echo "# Generated by autocluster."
-
- for repo ; do
-# Repo IDs can not contain slashes, so replace slashes with dashes.
-cat <<EOF
-[${repo//\//-}]
-name=${repo}
-baseurl=@@INSTALL_SERVER@@/${repo}
-enabled=1
-gpgcheck=0
-
-EOF
- done
-
-cat <<EOF
-@@@_YUM_TEMPLATE@@@
-EOF
-}
-
-get_kvm_path ()
-{
- local t
-
- if t=$(which qemu-kvm 2>/dev/null) ; then
- echo "$t"
- elif t=$(which kvm 2>/dev/null) ; then
- echo "$t"
- elif [ -x "/usr/libexec/qemu-kvm" ] ; then
- echo "/usr/libexec/qemu-kvm"
- else
- die "Could not find KVM executable"
- fi
-
-}
-
-rhel_get_install_kernel_options ()
-{
- case "$RHEL_VERSION" in
- (7.*) echo "ks=hd:LABEL=KICKSTART inst.stage2=hd:LABEL=RHEL-${RHEL_VERSION}\\\\x20Server.${RHEL_ARCH}" ;;
- (*) echo "ks=floppy" ;;
- esac
-}
-
-rhel_get_install_ks_device_xml ()
-{
- if [ ${RHEL_VERSION%%.*} -le 6 ] ; then
- cat <<EOF
- <disk type='file' device='floppy'>
- <source file='@@PWD@@/tmp/floppy.img'/>
- <target dev='fda'/>
- <readonly/>
- </disk>
-EOF
- else
- cat <<EOF
- <disk type='file' device='disk'>
- <source file='@@PWD@@/tmp/floppy.img'/>
- <target dev='@@SYSTEM_DISK_PREFIX@@b' bus='@@SYSTEM_DISK_TYPE@@'/>
- <driver name='qemu' type='raw'/>
- </disk>
-EOF
- fi
-}
-
-rhel_get_multipath_magic ()
-{
- if [ ${RHEL_VERSION%%.*} -le 6 ] ; then
- cat <<EOF
- udev_dir /dev
- getuid_callout "$SHARED_DISK_MULTIPATH_CALLOUT"
-EOF
- fi
-}
-
-rhel_post_config_hook ()
-{
- if [ "$ISO" = "@uto" ] ; then
- ISO=$(rhel_print_iso) || exit $?
- fi
-
- if [ "$SYSTEM_DISK_MOUNTS" = "@uto" ] ; then
- SYSTEM_DISK_MOUNTS=$(system_disk_mounts) || exit $?
- fi
-
- if [ "$MEM" = "@uto" ] ; then
- MEM=$(rhel_default_mem) || exit $?
- fi
-
- if [ "$SYSTEM_DISK_PREFIX" = "@uto" ] ; then
- SYSTEM_DISK_PREFIX=$(rhel_disk_prefix $SYSTEM_DISK_TYPE) || exit $?
- fi
-
- if [ "$KVM" = "@uto" ] ; then
- KVM=$(get_kvm_path) || exit $?
- fi
-
- if [ "$INSTALL_KERNEL_OPTIONS" = "@uto" ] ; then
- INSTALL_KERNEL_OPTIONS=$(rhel_get_install_kernel_options) || exit $?
- fi
-
- if [ "$INSTALL_KS_DEVICE_TEMPLATE" = "@uto" ] ; then
- INSTALL_KS_DEVICE_TEMPLATE=$(rhel_get_install_ks_device_xml) || exit $?
- fi
-
- if [ "$RHEL_MULTIPATH_MAGIC" = "@uto" ] ; then
- RHEL_MULTIPATH_MAGIC=$(rhel_get_multipath_magic) || exit $?
- fi
-
- if [ "$NAMESERVER" = "@uto" ] ; then
- NAMESERVER="$KVMHOST"
- fi
-
- if [ "$INSTALL_SERVER" = "@uto" ] ; then
- INSTALL_SERVER="http://${KVMHOST}/mediasets"
- fi
-
- if [ "$NFSSHARE" = "@uto" ] ; then
- NFSSHARE="10.0.0.1:/home"
- fi
-}
-
-register_hook post_config_hooks rhel_post_config_hook
-
-defconf RHEL_ARCH "x86_64" \
- "<arch>" "The RHEL operating system architecture to configure"
-
-defconf RHEL_VERSION "6.2" \
- "<version>" "version of Red Hat Enterprise Linux to configure"
-
-defconf RHEL_MULTIPATH_MAGIC "@uto"
-
-defconf ISO_DIR "/virtual/ISO" \
- "<dir>" "directory for ISO images, prepended to $ISO if not absolute"
-
-defconf ISO "@uto" \
- "<file>" "ISO image for base image creation"
-
-# the install server where we will get local packages from
-defconf INSTALL_SERVER "@uto" \
- "<url>" "URL of install server"
-
-defconf CONFIG_EXTRA_PACKAGES "" \
- "<packages>" "list of extra packages to install at configuration time"
-
-# the yum repositories to use. Choose the one appropriate for the
-# system you are installing
-defconf YUM_TEMPLATE "$_YUM_TEMPLATE" \
- "<file>" "location of template for yum repositories"
-
-defconf INSTALL_KS_DEVICE_TEMPLATE "@uto"
-
-##############################
-
-defconf CREATE_BASE_TIMEOUT 3600 \
- "<seconds>" "time to wait for base image install before aborting"
-
-##############################
-
-# Authentication method
-defconf AUTH_METHOD "files" \
- "files|winbind" "authentication method"
-
-##############################