ReleaseEngineering/PuppetAgain/Modules/packages

From MozillaWiki
Jump to navigation Jump to search

This module manages the installation of packages. It provides the level of abstraction between "NRPE should be installed" (include packages::nrpe) and the details of that installation, which will vary widely between linux, OSX, and Windows-based systems.

Most packages will have a dedicated module which abstracts the configuration of that package across operating systems -- for example, NRPE plugins may be installed in different directories on different operating systems.

"Installation" here is taken to mean getting the package installed, along with any supporting files (e.g., NRPE plugins).

tips for a successful patch review

Note that no other actions are appropriate for package modules. If it's not installing a package, it shouldn't be here. Classes in this module should be *extremely* boring and generic.

Implementation

In general, package management resources get set up in the 'packagesetup' stage (see [ReleaseEngineering/PuppetAgain#Stages]), so that subsequent uses of the package manager can assume it is configured. This is done with an invocation of packages::setup from the toplevel::base class.

CentOS

On CentOS, packages are installed with the yum provider, and the relevant repositories are added to yum in the packagesetup stage.

Setup

The packages::yumrepo class is used from packages::setup to install yum repositories. It takes

$repo_name
name of the repo
$url_path
path to the repo on the repo server (starting with repos/yum)
$gpg_key
(optional) puppet location of the gpg key for the repo
$gpg_key_pkg
(required if $gpg_key given) gpg-pubkey package that appears when the key is installed (use 'rpm -q gpg-pubkey' to find this)

Packages

The following packages are available:

  • packages::ntp - installs the NTP daemon
  • packages::python - installs all available versions of python (below)
  • packages::python26 - Python-2.6 in /tools/python26, including devel headers
  • packages::python27 - Python-2.7 in /tools/python27, including devel headers
  • packages::mock - installs the Fedora mock tool
  • packages::mozilla-tools - un-abstracted class that will go away
  • packages::tooltool - install tooltool, a toolchain-downloading tool. This is a simple Python script that ends up at /tools/tooltool.sh.

Mozilla-Built Packages

In many cases, we want customized or patched packages. Those should be under packages::mozilla. Packages in this space have more requirements, since they are not simply pulling in a publicly available package. See ReleaseEngineering/PuppetAgain/HowTo/Hack on PuppetAgain#Custom Packages.

packages::mozilla::git

This is a customized build of Git without various GUI things and installed with a prefix of /tools/git, so that the git binary is at /tools/git/bin/git with a symlink at /usr/local/bin/git. The GUI utilities are not necessary on a buildslave, and pull in lots of unnecessary packages.

packages::mozilla::mock_mozilla

This is a build of a forked of fedora's mock - see the github page. The package:

  • installs a number of mock profiles in /etc/mock_mozilla (see /etc/mock_mozilla in the project)
  • installs /usr/sbin/mock_mozilla (and a consolehelper script in /usr/bin/mock_mozilla that authorizes users via the mock_mozilla group)
  • creates /builds/mock_mozilla
  • installs a bunch of python modules into the system python (*not* a mozilla python)

packages::mozilla::python26

This is a custom build of Python-2.6.7, primarily to put the binaries out of the way of the system python. It installs to /tools/python26, with python at /tools/python26/bin/python, and a symlink at /usr/local/bin/python2.6.

packages::mozilla::python27

Same, but for Python-2.7.2.

packages::mozilla::py27_mercurial

Installs Mercurial, built against packages::mozilla::python27. This installs a symlink at /usr/local/bin/hg.

packages::mozilla::py27_virtualenv

Installs virtualenv, built against packages::mozilla::python27. Note that virtualenv is a single .py file, and thus does not need to be built at all. The python::virtualenv puppet module does not use this package. This installs a symlink at /usr/local/bin/virtualenv.

packages::mozilla::tooltool

This installs the tooltool script at /tools/tooltool.py; it is built from a template to use packages::mozilla::python27.