## modules/apt/manifiests/init.pp

class apt {
exec { "apt-get-update":
# refreshonly => true,
command => "/usr/bin/apt-get update",
# require => Exec["apt-key"],
}

# Source Repositories
file { "/etc/apt/sources.list":
owner => "root",
group => "root",
mode => 0444,
ensure => "present",
content => template("apt/sources.list.erb"),
notify => Exec["apt-get-update"],
}
file { "/etc/apt/apt.conf":
owner => "root",
group => "root",
mode => 0444,
ensure => "present",
source => "puppet:///apt/apt.conf",
notify => Exec["apt-get-update"],
}
}

define apt::key($keyid) {
exec { "apt-key $keyid":
command => "/usr/bin/wget -q http://www.example.com/apt/keys/$keyid -O -|/usr/bin/apt-key add -",
unless => "/usr/bin/apt-key list|/bin/grep -c 458F2AD8",
}
}

## node.pp
node "node.example.com" {
# basenode pulls in subversion (client
# puppet, vim, apt
apt::key { "458F2AD8": keyid => "458F2AD8" }

}