MySQL Gem Installation Under RedHat Enterprise Linux

Posted by Tres Mon, 03 Nov 2008 09:34:00 GMT

Installing the mysql Gem under RHEL/CentOS requires you to specify where MySQL is installed. Just point Gem to the mysql-config bin & you’re good to go:

gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

Posted in , , ,  | Tags , , ,

Installing FreeBSD Ports and Packages With CFEngine

Posted by Tres Fri, 07 Jul 2006 12:59:00 GMT

CFEngine has built in functionality to work with RPMS, Debian Packages or Solaris packages, but that doesn’t mean that you can’t use it to manage package installations on FreeBSD.

To manage packages on FreeBSD use group: or class: sections to see whether a package is installed, like this:

groups:
    has_<package> =(  ReturnsZero(/usr/sbin/pkg_info -Eqx <package name>)   )

The x flag will treat the package name as a regular expression, so you don’t need to worry about versions – just use the package name that you’re looking for.

Now, once CFEngine knows the state of the package installation, it needs to take action based upon that state. In the shellcommands: section, we’ll tell CFEngine to run the installer if the package state is not installed.

!has_<package>::
    "/usr/local/sbin/portinstall -y <package name>"

We can use portinstall (part of the portupgrade package) to install packages, or use pkg_add -r install the pre-compiled package.

!has_<package>::
    "/usr/sbin/pkg_add -r <package name>"

This will automatically take care of installing the package.


Example:

Installing bash via CFEngine

To see whether bash was installed, we would use the following line in the group: or class: section of the .cf file:

groups:
    
    has_bash =(  ReturnsZero(/usr/sbin/pkg_info -Eqx bash)   )

And we’d put the following into the shellcommands: section of the file:

shellcommands:
    !has_scdp::
      "/usr/local/sbin/portinstall -y shells/bash"

Posted in ,  | Tags , ,  | no comments