Yum Add-on Creation tool to install/update ZLM 7.3 Agent (RHEL) from Yum Repository

0 Likes
over 10 years ago


Contents:












Abstract





In the typical environment, where a ZLM supported operating system is installed on a device, a user can install ZLM 7.3.x Agent software to manage the devices using equivalent ZLM Server. But deploying ZLM agent software on a supported RHEL 5 Server device platform requires you to use the entire ZLM Agent media every time which is a 700 MB image. This scripting tool zlm-create-yum-addon-rhel allows you to create an ISO image with reduced size for installing or upgrading to ZLM 7.3 IR3 (7.3.3) agent on the supported Red Hat Enterprise Linux (RHEL) 5 Server platform. The ISO created from the ZLM agent media contains only the agent packages for deployment on the supported RHEL 5 Server platform (x86 and x86_64). It includes the ZLM agent packages for RHEL 5 as a ‘Package Group’ which can be installed or updated using the Yum tool.



The ISO created should be mounted on the device (ZLM Server or any Web Server), which can host or publish the ISO packages (FTP/HTTP) in a Yum repository structure and finally the ZLM Agent can be installed, updated, or removed on the device using the Yum tool. A user can automate it further to deploy and install ZLM agent using the Yum add-on on a large number of RHEL devices in their environment.




System Environment




Novell ZENworks 7.3.3 (IR3) Linux Management Server.
RHEL 5.x Server ( x86 and x86_64) - to install or update to ZLM 7.3.3 (IR3) Agent.






ZLM Agent Yum add-on Creation






  • Download and mount the latest ZLM7.3 IR3 Agent ISO or media to a temporary mount point, to create the yum add-on image.



mount –o loop /backup/ZLM73_Agent_with_IR3.iso /mnt/zlm-install/




  • Install the createrepo rpm package on the RHEL or SLES Server device, required to create the add-on image which is published as the Yum repository structure.

    The package createrepo can be installed from the OS or Distribution media for RHEL platform and from SDK media for SLES platform.

    To know more about createrepo tool, refer to http://createrepo.baseurl.org



  • Now create the Yum add-on ISO for installing ZLM agent on the RHEL 5 platforms



./zlm-create-yum-addon-rhel 'Arguments'

Usage: ./zlm-create-yum-addon-rhel -i 'zlm-addon-iso-name' -m 'zlm-agent-mount-path' -g 'yum_package_group_file' -v 'RHEL-Version' -o 'output-directory'





For Example: To create a zlm agent yum add-on ISO image with the name zlm-agent-rhel5.iso for RHEL 5 platform using group file zlm-agent-yum-addon-rhel5-group.xml and store the generated ISO in the /tmp/zlm-agent-yum path.


# zlm-create-yum-addon-rhel -i zlm-agent-rhel5 -m /mnt/zlm-install -g /root/zlm-agent-yum-addon-rhel5-group.xml -v 5 -o /tmp/zlm-agent-yum




Generating rpm-md/yum metadata type repository : /root/zlm-agent-rhel-dir
52/52 - x86_64/novell-zenworks-zmglibs-7.3.3-0.0.0.i586.rpm
Saving Primary metadata..
Saving file lists metadata..
Saving other metadata..






The following table describes the options that can be used with the command:




Option Description

-i zlm-addon-iso-name The name of the ISO image to be created. The default ISO name created is zlm-agent-yum-addon-rhel is selected.


-m zlm-agent-mount-path The path where the ZENworks 7.3.x Linux Management Agent Image or media is mounted. Ex : /mnt/install/zlm-agent

-o output_directory The directory to which the ISO image is written. If you do not specify an output directory, the ISO image is copied to the /tmp directory.


-g yum_package_group_file The Path to the Yum package group file for the supported RHEL 5 server platform.


-v RHEL-Version RHEL major version. Use value 5 to create Add-on image for RHEL 5.x Server on both 32bit or 64bit platforms.






Note: As a requirement , the 'createrepo' package should be pre-installed.





Setup Yum Repository Server and Add-on Client Configuration





    Setting up Server with a Yum source repository:

    Copy the ZLM agent add-on image created earlier to any Web Server (HTTP/FTP) and mount it under a path to publish or host it as the Yum source repository for the RHEL devices to install agent.





    Setting up a Yum repo Client :

    Add a new repository file named zlm-create-yum-addon-rhel.repo to the /etc/yum.repos.d directory of RHEL 5 device with the following content:





    For RHEL-5–i386 (x86) platform :



    [zlm-agent-yum-addon-rhel]
    name=zlm-agent-yum-addon-rhel
    baseurl=http://server-ip/yum-repo-path
    gpgcheck=0
    enabled=1




    For RHEL-5–x86_64 platform:



    [zlm-agent-yum-addon-rhel]
    name=zlm-agent-yum-addon-rhel
    baseurl=http://server-ip/yum-repo-path
    gpgcheck=0
    enabled=1
    exclude=novell-zenworks*.i386,hwinfo*.i386,xinetd*.i386,novell-zenworks-mono*.i586






The server-ip and yum-repo-path needs to be replaced so that client can access it remotely via HTTP.







Note:
Yum 'groupinstall' also includes 32bit equivalent packages along with 64bit packages for installation on the RHEL5 x86_64 device from the Yum hosted repository. This is because multiple architectures(32bit and 64bit) of same packages present in the repository. To remove these duplicate 32bit packages, the exclude attribute is defined with packages pattern to exclude from the installation list on RHEL 5 Server x86_64 device.

Also the repo file is configured with setting gpgcheck=0, to skip checking of the GPG signatures on all the packages in the published repository .



To verify if the repo file is correctly used, you can obtain the lists of all available/installed groups using the command:
yum grouplist

You can gather information about all packages that belong to a group using the command:
yum groupinfo zlm-agent-yum-addon-rhel



Yum 'Package Group' for ZLM Agent on RHEL 5 platform:


The Package Group installed/updated via yum client, provides the following packages during ZLM Agent install on RHEL 5 Server platform :



<comps>
<group>
<id>zlm-agent-yum-addon-rhel</id>
<name>zlm-agent-yum-addon-rhel</name>
<default>true</default>
<description>Default RPMS for ZLM 7.3.3 Agent Yum package group </description>
<uservisible>true</uservisible>
<packagelist>
<packagereq type="default">novell-zenworks-zmd</packagereq>
<packagereq type="default">novell-zenworks-zmd-inventory</packagereq>
<packagereq type="default">novell-zenworks-zmd-imgagent</packagereq>
<packagereq type="default">novell-zenworks-utilities</packagereq>
<packagereq type="default">novell-zenworks-zmd-settings</packagereq>
<packagereq type="default">novell-zenworks-zmd-actions</packagereq>
<packagereq type="default">novell-zenworks-rug</packagereq>
<packagereq type="default">novell-zenworks-zmd-tess</packagereq>
<packagereq type="default">novell-zenworks-zmd-gconfpolicyenforcers</packagereq>
<packagereq type="default">novell-zenworks-zmd-rmagent</packagereq>
<packagereq type="default">novell-zenworks-zlm-release2</packagereq>
<packagereq type="default">novell-zenworks-zmd-policyenforcers</packagereq>
<packagereq type="default">novell-zenworks-zmd-policymanager</packagereq>
<packagereq type="default">novell-zenworks-client-gui</packagereq>
<packagereq type="default">novell-zenworks-install</packagereq>
<packagereq type="default">novell-zenworks-zmglibs</packagereq>
<packagereq type="default">novell-zenworks-zislnx</packagereq>
<packagereq type="default">novell-zenworks-zmgweb</packagereq>
<packagereq type="default">novell-zenworks-mono</packagereq>
<packagereq type="default">novell-zenworks-sqlite</packagereq>
<packagereq type="default">novell-zenworks-x11vnc</packagereq>
<packagereq type="default">/novell-zenworks-gtk-sharp</packagereq>
<packagereq type="default">novell-zenworks-tightvnc</packagereq>
<packagereq type="default">xinetd</packagereq>
<packagereq type="default">compat-libstdc </packagereq>
<packagereq type="default">hwinfo</packagereq>
</packagelist>
</group>
</comps>


These packages are included in the Yum package group file (zlm-agent-yum-addon-rhel5-group.xml) to be used with the tool.



Install, Update or Remove ZLM7.3 Agent on RHEL 5 Server using Yum tool





  • Installing the new ZLM 7.3.3 (IR3) Agent:




~# yum groupinstall zlm-agent-yum-addon-rhel



Output :
Dependencies Resolved..

==========================================================
Package Arch Version Repository Size
==========================================================
Installing:
hwinfo x86_64 8.62-0.novell.2.1 zlm-agent-yum-addon-rhelx64 407 k
novell-zenworks-client-gui x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 238 k
novell-zenworks-install x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 189 k
novell-zenworks-mono x86_64 1.2.6-0.0.0 zlm-agent-yum-addon-rhelx64 19 M
novell-zenworks-rug x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 192 k
novell-zenworks-sqlite x86_64 3.2.7-2 zlm-agent-yum-addon-rhelx64 718 k
novell-zenworks-tightvnc i386 1.2.9-6.novell.1.7 zlm-agent-yum-addon-rhelx64 806 k
novell-zenworks-utilities x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 16 k
novell-zenworks-x11vnc i386 0.6.1-2.novell.2.9 zlm-agent-yum-addon-rhelx64 764 k
novell-zenworks-zislnx i586 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 29 k
novell-zenworks-zlm-release2 noarch 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 5.5 k
novell-zenworks-zmd x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 1.2 M
novell-zenworks-zmd-actions x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 14 k
novell-zenworks-zmd-gconfpolicyenforcers x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 68 k
novell-zenworks-zmd-imgagent x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 4.4 k
novell-zenworks-zmd-inventory x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 36 k
novell-zenworks-zmd-policyenforcers x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 40 k
novell-zenworks-zmd-policymanager x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 25 k
novell-zenworks-zmd-rmagent x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 44 k
novell-zenworks-zmd-settings x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 18 k
novell-zenworks-zmd-tess x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 17 k
novell-zenworks-zmglibs i586 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 1.5 M
novell-zenworks-zmgweb i586 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 20 k
xinetd x86_64 2:2.3.14-10.el5 zlm-agent-yum-addon-rhelx64 125 k
Installing for dependencies:
compat-libstdc -33 i386 3.2.3-63 zlm-agent-yum-addon-rhelx64 230 k
novell-zenworks-gtk-sharp x86_64 2.4.0-1.novell.11.7 zlm-agent-yum-addon-rhelx64 473 k

Transaction Summary
==========================================================
Install 26 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 26 M
Is this ok [y/N]:y



Upgrading the existing ZLM Agent to 7.3.3 (IR3) Agent:




~# yum groupupdate zlm-agent-yum-addon-rhel



Output :
Dependencies Resolved

==========================================================
Package Arch Version Repository Size
==========================================================
Updating:
novell-zenworks-client-gui x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 238 k
novell-zenworks-install x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 189 k
novell-zenworks-rug x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 192 k
novell-zenworks-utilities x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 16 k
novell-zenworks-zislnx i586 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 29 k
novell-zenworks-zlm-release2 noarch 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 5.5 k
novell-zenworks-zmd x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 1.2 M
novell-zenworks-zmd-actions x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 14 k
novell-zenworks-zmd-gconfpolicyenforcers x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 68 k
novell-zenworks-zmd-imgagent x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 4.4 k
novell-zenworks-zmd-inventory x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 36 k
novell-zenworks-zmd-policyenforcers x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 40 k
novell-zenworks-zmd-policymanager x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 25 k
novell-zenworks-zmd-rmagent x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 44 k
novell-zenworks-zmd-settings x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 18 k
novell-zenworks-zmd-tess x86_64 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 17 k
novell-zenworks-zmglibs i586 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 1.5 M
novell-zenworks-zmgweb i586 7.3.3-0.0.0 zlm-agent-yum-addon-rhelx64 20 k

Transaction Summary
==========================================================
Install 0 Package(s)
Update 18 Package(s)
Remove 0 Package(s)

Total download size: 3.7 M

Is this ok [y/N]:y
....
Complete!.




The installation requires about 26MB of content download on device while updating existing ZLM agent requires only 3.7 MB of data to update each RHEL 5 device.

You can verify the Yum package transaction log /var/log/yum.log to ensure that the agent packages are correctly installed, updated, or removed . You can list the installed Yum package groups using the command: yum grouplist.




Removing the existing ZLM 7.3.3 (IR3) Agent:



To remove all the ZLM agent packages from the managed device installed as part of Yum package group.

Note: Yum is not able to remove a package without also removing packages which depend on it. This type of operation can only be performed by RPM, is not advised, and can potentially leave your system in a non-functioning state or cause applications to misbehave and/or crash.



~#] yum groupremove zlm-agent-yum-addon-rhel





Output :
Dependencies Resolved

==========================================================
Package Arch Version Repository Size
==========================================================
Removing:
hwinfo x86_64 8.62-0.novell.2.1 installed 1.1 M
novell-zenworks-client-gui x86_64 7.3.3-0.0.0 installed 552 k
novell-zenworks-install x86_64 7.3.3-0.0.0 installed 717 k
novell-zenworks-mono x86_64 1.2.6-0.0.0 installed 52 M
novell-zenworks-rug x86_64 7.3.3-0.0.0 installed 628 k
novell-zenworks-sqlite x86_64 3.2.7-2 installed 2.0 M
novell-zenworks-tightvnc i386 1.2.9-6.novell.1.7 installed 1.6 M
novell-zenworks-utilities x86_64 7.3.3-0.0.0 installed 41 k
novell-zenworks-x11vnc i386 0.6.1-2.novell.2.9 installed 1.4 M
novell-zenworks-zislnx i586 7.3.3-0.0.0 installed 75 k
novell-zenworks-zlm-release2 noarch 7.3.3-0.0.0 installed 6.1 k
novell-zenworks-zmd x86_64 7.3.3-0.0.0 installed 3.1 M
novell-zenworks-zmd-actions x86_64 7.3.3-0.0.0 installed 29 k
novell-zenworks-zmd-gconfpolicyenforcers x86_64 7.3.3-0.0.0 installed 210 k
novell-zenworks-zmd-imgagent x86_64 7.3.3-0.0.0 installed 5.5 k
novell-zenworks-zmd-inventory x86_64 7.3.3-0.0.0 installed 92 k
novell-zenworks-zmd-policyenforcers x86_64 7.3.3-0.0.0 installed 103 k
novell-zenworks-zmd-policymanager x86_64 7.3.3-0.0.0 installed 53 k
novell-zenworks-zmd-rmagent x86_64 7.3.3-0.0.0 installed 111 k
novell-zenworks-zmd-settings x86_64 7.3.3-0.0.0 installed 57 k
novell-zenworks-zmd-tess x86_64 7.3.3-0.0.0 installed 32 k
novell-zenworks-zmglibs i586 7.3.3-0.0.0 installed 3.9 M
novell-zenworks-zmgweb i586 7.3.3-0.0.0 installed 47 k
xinetd x86_64 2:2.3.14-10.el5 installed 255 k
Removing for dependencies:
novell-zenworks-gtk-sharp x86_64 2.4.0-1.novell.11.7 installed 1.4 M

Transaction Summary
==========================================================

Install 0 Package(s)
Update 0 Package(s)
Remove 25 Package(s)

Is this ok [y/N]:y
...
Complete!






Start Agent (ZMD) and Register it to the ZLM Server





After all the agent packages are installed or upgraded on the device, start the ZMD service on the agent using the “/etc/init.d/novell-zmd retstart” command.

Change the ZMD preference for "require-verified-certs" from True to False using the command rug set-prefs require-verified-certs False .

Now, register the managed device to the ZLM Server using the command “ rug sa https://ZLMServer_DNS_name_or_IP ” if the zenworks service is not added and verify the status using the rug sl command.




Tool





The content below is part of the zlm-create-yum-addon-rhel file and executed as bash script to create the Yum add-on image for installing ZLM7.3 (IR3) agent on a supported RHEL 5 device.


Usage:

./zlm-create-yum-addon-rhel -i 'zlm-addon-iso-name' -m 'zlm-agent-mount-path' -g 'yum_package_group_file' -v 'RHEL-Version' -o 'output-directory'







#######################################################
#License : GPLv2 , Novell Inc.
#Author : tarvindkumar@novell.com
#######################################################

#!/bin/sh
# ZLM YUM ADD ON

outputDir="/tmp";
ver="5";
iso_name="zlm-agent-yum-addon-rhel";
arch_list="i586 x86_64";
repo_name="zlm-agent-yum-addon-rhel"
src_rpm_dir=
current_dir=`pwd`;
iso_temp_dir="$outputDir/$repo_name";

usage()
{
echo " Usage: $0 -i 'zlm-addon-iso-name' -m 'zlm-agent-mount-path' -g 'yum_package_group_file' -v 'RHEL-Version' -o 'output-directory'";
echo "";
echo "-i 'zlm-addon-iso-name' : Name of the iso default is zlm-add-on.";
echo "-m 'zlm-agent-mount-path' : Path of directory where the ZLM Agent ISO is mounted.";
echo "-g 'yum-package-group-file' : Path to the Yum package group file";
echo "-v 5 : Version as 5 ,for RHEL 5 Server (x86 and x86_64) ";
echo "-o 'output-directory' : Output directory. Default is /tmp";
echo "-h : Display the options menu.";

echo "Note: createrepo package should be installed (Requirement)."
exit -1;
}


parse_args()
{

while getopts i:m:g:v:o:h inp
do
case $inp in
h ) usage $0 ;
;;
i ) iso_name=$OPTARG;
;;
m ) src_rpm_dir=$OPTARG;
mvalue=1;
if [ ! -d $src_rpm_dir/data ];then
echo "Error: Invalid mount point";
exit -1;
fi
;;
g ) group_file=$OPTARG;
;;
v ) ver=$OPTARG;
if [ ! $ver == 5 ] ; then
if [ ! $ver == 6 ] ; then
echo "Please input RHEL version as either 5 or 6" ;
exit -1;
fi fi
;;
o ) outputDir=$OPTARG;;
[?] ) usage $0;;

esac ;
done

if [ -z $mvalue ];
then
usage $0;
elif [ -z $src_rpm_dir ];
then
echo "You should provide zlm-agent mount path";
exit -1;
fi


if [ $outputDir == "./" -o $outputDir == "." ];then
outputDir=`pwd`;
fi
iso_temp_dir="$outputDir/$iso_name";
}


prepare_dir()
{
#Preparing the directory structure
mkdir -p $iso_temp_dir;
rm -rf $iso_temp_dir/*;
cd $iso_temp_dir
cp $group_file .

case $ver in

4) arch_list="i386 x86_64"
;;
5) arch_list="i386 x86_64"
;;
esac ;

for arch in $arch_list
do
mkdir -p $iso_temp_dir/$arch ;
done

}

copy_rpms()
{
ver=$1;

for arch in $arch_list
do
cp $src_rpm_dir/data/packages/client/rhel-$ver-$arch/*.rpm $iso_temp_dir/$arch 2>/dev/null ;
rm -f $iso_temp_dir/$arch/novell-zenworks-zmd-oem*.rpm 2>/dev/null ;
rm -f $iso_temp_dir/$arch/novell-zenworks-libredcarpet*.rpm 2>/dev/null ;
cp $src_rpm_dir/data/packages/mono/rhel-$ver-$arch/*mono*.rpm $iso_temp_dir/$arch 2>/dev/null ;
cp $src_rpm_dir/data/packages/runtime-deps/rhel-$ver-$arch/*.rpm $iso_temp_dir/$arch 2>/dev/null;
cp $src_rpm_dir/data/packages/imaging/rhel-$ver-$arch/*.rpm $iso_temp_dir/$arch 2>/dev/null;
cp $src_rpm_dir/data/packages/rhel-$ver-$arch/rhel-$ver-$arch/xinetd*.rpm $iso_temp_dir/$arch 2>/dev/null;
done

}

process_directory()
{
#generate metadata and create yum repo
echo "Generating rpm-md/yum metadata type repo : $iso_temp_dir "
cd $iso_temp_dir
group=`echo ${group_file##*/}`
createrepo --database -g $group .
}

MakeIso()
{
# Make iso image.
mkisofs -f -o $outputDir/$iso_name.iso -R $iso_temp_dir > /var/log/zlm-yum-add-on.log 2>&1 ;
if [ $? -gt 0 ];then
echo "Error in creating the iso file : $outputDir/$iso_name.iso ! "
exit -1;
fi
}


remove_rpms()
{

if [ -d $iso_temp_dir ];then
rm -rf $iso_temp_dir;
fi
}

parse_args $@;
prepare_dir;
copy_rpms $ver ;
process_directory;
MakeIso;
remove_rpms;




Note: The support for ZLM Agent on a RHEL 6 Server (x86,x86_64,s390x) would be provided in this tool post ZLM7.3 IR4 release.


Labels:

Collateral
How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended