help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DPKGPackageCheck() implementation.


From: Russell Adams
Subject: Re: DPKGPackageCheck() implementation.
Date: Sat, 13 Mar 2004 15:17:02 -0600
User-agent: Mutt/1.4i

I've been testing the enclosed configuration for my network.

I figured this was on topic, but didn't require a module.

Basically I'm maintaining packages by editing the output from "dpkg
--get-selection" kept in a text file. This is imported with
UpdatePackageLists, and any missing packages installed via
DselectUpgrade.

I trigger these using timeclasses tied to a host.

It seems to work well so far.

I've based it on a post from 2003 by Thomas Glanzmann, see it at:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=mailman.1479.1065791230.21628.help-cfengine%40gnu.org

There are additional definable classes to trigger various package
management actions.

-----------------------------
Russell Adams
RLAdams@AdamsInfoServ.com
http://www.adamsinfoserv.com/


---- debian_pkgs.cf ----
# $Id: debian_pkgs.cf,v 1.8 2004/02/18 02:10:18 root Exp $

# This config is to support debian pkgs using apt.

control:

        Access = ( root )

        AddInstallable = (      PackageListsUpdated
                                AptUpdated
                                AptCleaned
                                UpgradedDebian
                                UpgradedDselect
                                )

        actionsequence = (      editfiles
                                copy
                                shellcommands
                                )


editfiles:

        debian::

                # Forget debconf, don't use it.

                { /etc/apt/apt.conf.d/70debconf

                CommentLinesStarting "DPkg::Pre-Install-Pkgs"
                }

                # Dpkg options for config files.

                { /etc/dpkg/dpkg.cfg

                AutoCreate
                AppendIfNoSuchLine 'force-confold'
                AppendIfNoSuchLine 'force-confdef'
                }


copy:

        debian::

                # Apt options are kept in this file.

                /remote/conf/etc/apt/apt.conf.d/10cfengine
                        dest=/etc/apt/apt.conf.d/10cfengine
                        m=444 o=root g=root type=sum


                # Apt's sources list

                /remote/conf/etc/apt/sources.list
                        dest=/etc/apt/sources.list
                        m=444 o=root g=root type=sum


shellcommands:

        # Update the dpkg (dselect) package selections

        # Package lists from dpkg --get-selections
        # kept in /remote/var/package-lists/

        debian.UpdatePackageLists::

                "/usr/bin/dpkg --set-selections < 
/remote/var/package-lists/base_additions"
                        timeout=600
                        define=PackageListsUpdated


        # Download updates to Apt's package database

        debian.UpdateApt::

                "/usr/bin/apt-get update"
                        timeout=3600
                        define=AptUpdated


        # Purge locally downloaded files.

        debian.CleanApt::

                "/usr/bin/apt-get clean"
                        timeout=600
                        define=AptCleaned


        # Upgrade anything in the distro, including security updates.
        # Uses Apt's package database, so update first!

        debian.DebianUpgrade::

                "/usr/bin/apt-get upgrade"
                        timeout=3600
                        define=UpgradedDebian


        # Upgrade things in the dpkg (dselect) selections lists
        # This is useful if new packages were specified in the package
        # lists for dpkg (dselect).

        debian.DselectUpgrade::

                "/usr/bin/apt-get dselect-upgrade"
                        timeout=3600
                        define=UpgradedDselect


---- /etc/apt/apt.conf.d/10cfengine ----
APT {
        Get {
        Assume-Yes "true";
        Fix-Missing "yes";
        Show-Upgraded "yes";
        Purge "true";
        List-Cleanup "true";
        ReInstall "false";
        };
};

DPkg::Pre-Install-Pkgs {
        "dpkg-preconfigure --apt --frontend=noninteractive";
};




reply via email to

[Prev in Thread] Current Thread [Next in Thread]