Git Product home page Git Product logo

debian-cookbook's Introduction

Debian Cookbook Build Status

Table of Contents

Description

Chef cookbook for managing Apt sources for official Debian repositories.

This cookbook can be used to configure the whole system for all the wanted sources (stable, security, stable-updates, etc.). Just including the "default" recipe to the run list gives a sensible default.

Individual recipes can also be used by other cookbooks that need packages for example from the backports repository.

Requirements

Intended for use in Debian, but could be modified for other Apt based platforms. Tested on Debian 6.0 Squeeze and Debian 7.0 Wheezy.

Requires apt community cookbook.

Recipes

The default recipe configures /etc/apt/sources.list using the mirror and components specified by node attributes. It also includes other recipes if specified via node attributes.

The other recipes configure apt to use the corresponding Debian repository:

Attributes

Attribute Description Default
node['debian']['mirror'] Default Debian mirror URI "http://http.debian.net/debian"
node['debian']['components'] Default repository components ["main", "contrib", "non-free"]
node['debian']['deb_src'] If true, enables apt source lines by default false

The following attributes specify if the corresponding recipe/repository is included by the default recipe:

Attribute Default
node['debian']['backports'] false
node['debian']['security'] true
node['debian']['stable_proposed_updates'] false
node['debian']['stable_updates'] true
node['debian']['testing'] false
node['debian']['unstable'] false

Resources and Providers

debian_repository

Sets up Debian repository and optionally pinning preferences using apt_repository LWRP. This is used internally by the recipes, but feel free if you find usage for it in your own cookbooks.

Attribute parameters:

  • repo_name - Name_attribute. The name of the repository and configuration files.
  • uri - The base URI of the repository. Defaults to node['debian']['mirror'].
  • distribution - Name attribute. The distribution part of apt source line.
  • components - The components part of apt source line. Defaults to node['debian']['components'].
  • deb_src - If true, enables apt source line too. Defaults to node['debian']['deb_src'].
  • pin_priority - The default pinning priority for the repository. Defaults to nil which means that no preferences are set.

Example:

# feel the history
debian_repository "woody" do
  uri "http://archive.debian.org/debian"
  pin_priority 200
end

Usage

If you want to manage /etc/apt/souces.list with Chef, add the default recipe to the run list, preferably as the first one. The default recipe also includes "apt::default" recipe, so you don't need to add it.

Then you can also specify which additional repositories are configured by setting node['debian']['<repo>'] attributes to true or false. By default a standard set is included. The other option is to add the wanted repositories (e.g. recipe[debian::backports]) directly to the run list.

The default base URI (http.debian.net) should be fine for most cases as it redirects to a geographically closest mirror. You can also to set it explicitly for example in a role:

default_attributes(
  :debian => {
    :mirror => "http://ftp.fi.debian.org/debian"
  }
)

Other cookbooks that need packages from a specific repository should depend on this cookbook, include the corresponding repository recipe and possibly add apt-pinning rules for the packages as needed. Example:

# configure backports.debian.org
include_recipe "debian::backports"

# set apt-pinning rules
%w[thepackage and some dependencies].each do |pkg|
  apt_preference pkg do
    pin "release o=Debian Backports"
    pin_priority "700"
  end
end

# install the package
package "thepackage"

License and Author

Author:: Teemu Matilainen <[email protected]>

Copyright © 2011-2013, Reaktor Innovations Oy

Licensed under the Apache License, Version 2.0. See LICENSE.

debian-cookbook's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.