Using the apt module consists predominantly of declaring classes and defined types that provide the desired functionality and features. This module provides common resources and options that are shared by the various defined types in the apt module, so you **must always** include this class in your manifests.
-```
+```puppet
class { 'apt': }
```
A native Puppet type and provider for managing GPG keys for Apt is provided by this module.
- ```
+ ```puppet
apt_key { 'puppetlabs':
ensure => 'present',
id => '1054B7A24BD6EC30',
* `apt::key`: Adds a key to the list of keys used by Apt to authenticate packages. This type uses the aforementioned `apt_key` native type. As such, it no longer requires the `wget` command on which the old implementation depended.
- ```
+ ```puppet
apt::key { 'puppetlabs':
id => '1054B7A24BD6EC30',
server => 'pgp.mit.edu',
* `apt::pin`: Defined type that adds an Apt pin for a certain release.
- ```
+ ```puppet
apt::pin { 'karmic': priority => 700 }
apt::pin { 'karmic-updates': priority => 700 }
apt::pin { 'karmic-security': priority => 700 }
Note that you can also specify more complex pins using distribution properties.
- ```
+ ```puppet
apt::pin { 'stable':
priority => -10,
originator => 'Debian',
* `apt::source`: Adds an Apt source to `/etc/apt/sources.list.d/`. For example:
- ```
+ ```puppet
apt::source { 'debian_unstable':
comment => 'This is the iWeb Debian unstable mirror',
location => 'http://debian.mirror.iweb.ca/debian/',
For example, to configure your system so the source is the Puppet Labs Apt repository:
- ```
+ ```puppet
apt::source { 'puppetlabs':
location => 'http://apt.puppetlabs.com',
repos => 'main',
#### Hiera example
-```
-<pre>
+```yaml
apt::sources:
'debian_unstable':
location: 'http://debian.mirror.iweb.ca/debian/'
key:
id:'1054B7A24BD6EC30'
server: 'pgp.mit.edu'
-</pre>
```
### Parameters