Skip to content

Commit

Permalink
New definition: apt::key
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-c2c committed Feb 27, 2009
1 parent 006e0eb commit d7a9b9a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README
Expand Up @@ -9,8 +9,16 @@ Classes:
Definitions:
* apt::conf


apt::conf{"99unattended-upgrade":
ensure => present,
content => "APT::Periodic::Unattended-Upgrade \"1\";\n",
}

* apt::key

apt::key {"blah-key":
source => "http://dev.camptocamp.com/packages/debian/pub.key",
keyid => "A37E4CF5",
before => Exec["apt-get_update"],
}

16 changes: 16 additions & 0 deletions manifests/definitions/key.pp
@@ -0,0 +1,16 @@
define apt::key($ensure = present, $source, $keyid) {
case $ensure {
present: {
exec { "/usr/bin/wget -O - '$source' | /usr/bin/apt-key add -":
unless => "apt-key list | grep -Fqe '$keyid'",
path => "/bin:/usr/bin",
before => Exec["apt-get_update"],
notify => Exec["apt-get_update"],
}
}

absent: {
notice "Sorry, not yet implemented"
}
}
}

0 comments on commit d7a9b9a

Please sign in to comment.