JET is your friend...

One of the challenges in this project is keeping an eye on the evolutionary qualities of the underlying components. In other words, we know that the basic elements of disk layout, packages added, configuration files, etc. will be in flux throughout the development and test cycles. In order to streamline these activities and make them a tad safer, we decided to implement as much as possible with the Jumpstart Enterprise Toolkit (JET).

JET allows you to create template files, describing not only basic Jumpstart configurations, but many of the most common "post install" tasks that administrators do manually. Things like JASS (Solaris Security Toolkit), Solaris Volume Manager (SVM), more complex network configurations like IPMP, and many other goodies are either implemented in JET already, or easily integrated as a repeatable and automated task. In our case, with IPMP, over 200 filesystems using SVM, and some post-install tasks (dropping in config files, setting up some standard /etc/system and ndd settings, etc.), JET is definitely a great first step on our road to our final goal of doing this through N1SPS/N1SM.

I won't cut and paste my whole template file into my blog, but I will note a few of the key sections. We started with an existing JET template from the current production environment. This had the benefit of bringing along several post-install scripts that installed default configuration files for syslog, NTP, and SSH, and gave us standard and proven locations and methods for installing some of the extra software that this project required (expect, some GNU tools, etc.). Since we are working with a flar and not using the standard pkgadd method, this line in the template file (from /opt/SUNWjet/Templates by default) gives us the starting system image that we want:

#       Identify flar to load
#
flash_archive_locations="nfs://10.68.75.23/export/flars/SPARC-App-Tier-19.flar"

That's it. Just that line, and all the stuff from our hand-built machine is installed on the new box. Of course, we still need to specify a bunch of other configuration things, like disk layout, SVM configs, etc., but I'll get to those later.

In addition to our standard flar, we want to install some changes to /etc/system, and twiddle some extra bits. This is accomplished with a script that we wrote and saved in /opt/SUNWjet/Clients/common.files called set_etc_system. We just place that script into the JET common.files directory and configure the template to run it in reboot 1 (JET installs do several reboots after the initial flar load):

#
#  Override default custom scripts.  
#
custom_scripts_1="set_etc_system"
custom_scripts_m=""
#
#  Set default locale to POSIX/C to get around buggy use of "tr"
#
base_config_sysidcfg_system_locale=C

Our set_etc_system script isn't super complicated, or error-proof, but I am using it as a simple example. We wrote it to automate a way around a mistake that we were making, forgetting to clean out settings between flar revisions. So for the settings that we want to be there, if the setting exists, leave it alone. If it doesn't exist in /etc/system, put our setting into the file:

#!/bin/ksh
set -a
#   set_etc_system
#   1.1 - Bill Walker < bill.walker@sun.com >
#   Set some sane /etc/system variables if they don't exist
#
###############################################################
#
BN=`/usr/bin/basename ${0}`
#
cat >> ${ROOTDIR}/etc/system << EOF
\* Added by Jet set_etc_system `date +%d%b%y`
EOF

if grep " autoup" /etc/system >/dev/null
then
        echo "${BN} : autoup already in /etc/system..."
else
cat >> ${ROOTDIR}/etc/system << EOF
set autoup=480
EOF
fi

if  grep " tune_t_fsflushr" /etc/system >/dev/null
then
        echo "${BN} : tune_t_fsflushr already in /etc/system..."
else
cat >> ${ROOTDIR}/etc/system << EOF
set tune_t_fsflushr=60
EOF
fi

if  grep " rlim_fd_cur" /etc/system >/dev/null
then
        echo "${BN} : rlim_fd_cur already in /etc/system..."
else
cat >> ${ROOTDIR}/etc/system << EOF
set rlim_fd_cur=1024
EOF
fi

Simple but repetitive tasks such as this are amazingly easy with JET. Every time you find yourself doing some task more than once on an install or deployment, just take a couple minutes and create a script to do it for you, and add it to the custom_scripts list in your JET template. Things like cleaning out the SSH known_hosts entries for users, creating a complex /etc/resolv.conf file, adding a new service, making sure that some services are disabled or sending an email or message to you to let you know that things succeeded or failed can be great time savers and make deployment safer and faster.

Not much new and exciting information here if you already use JET, but I'll be digging a bit deeper into JET in this blahg later.


bill.


Comments:

Post a Comment:
Comments are closed for this entry.
About

mrbill

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today