Report abuse

modules/apt/manifiests/init.pp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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

1
2
3
4
5
6
node "node.example.com" {
        # basenode pulls in subversion (client
        # puppet, vim, apt
        apt::key { "458F2AD8": keyid => "458F2AD8" }

}