Re: [Puppet Users] dependencies

Patrick
Tue, 09 Mar 2010 21:51:12 -0000

On Mar 9, 2010, at 5:26 AM, Christopher Johnston wrote:

> For example I have a yum module that sets yum configs up, but obviously I
have other modules that depend on the installation of that yum module in order
to use it to install rpms.

I do the same thing with apt.  To solve this, I set the files that need to be
set at the global dependency for all packages.  Here''s an example.

Package { require => Exec["post-proxy-update"] }

    file { "/etc/apt/apt.conf.d/01proxy":
        owner   => root,
        group   => root,
        mode    => 644,
        source  => "puppet:///aptcacher-client/01proxy",
    }

    exec { "/usr/bin/apt-get update":
        alias       => "post-proxy-update",
        subscribe   => [ File["/etc/apt/apt.conf.d/01proxy"],
File["/etc/apt/sources.list.d/simba.list"] ],
        require     => [ File["/etc/apt/apt.conf.d/01proxy"],
File["/etc/apt/sources.list.d/simba.list"] ],
        refreshonly => true,
    }

        file { "/etc/apt/sources.list.d/simba.list":
                owner   => root,
                group   => root,
                mode    => 644,
                source  => "puppet:///local-apt/simba.list",
	}