Skip to content

Instantly share code, notes, and snippets.

@adamcrews
Created April 1, 2014 17:41
Show Gist options
  • Save adamcrews/9919172 to your computer and use it in GitHub Desktop.
Save adamcrews/9919172 to your computer and use it in GitHub Desktop.
sample apt
node 'node1.my.vm' {
class { '::profile::apt':
unstable => true,
}
}
node 'vagrant.vm' {
class { '::profile::apt':
unstable => false,
}
}
class profile::apt (
$unstable = undef,
) {
# let us use true/false for unstable/stable
validate_bool($unstable)
# define our real release
$release = $unstable ? {
true => 'unstable',
default => $::lsbdistcodename,
}
class { '::apt':
always_apt_update => false,
# Be careful with these options, they will purge
# unmanaged repos
purge_sources_list => true,
purge_sources_list_d => true,
}
::apt::source { "debian-${release}":
location => 'http://http.us.debian.org/debian',
release => $release,
repos => 'main contrib non-free',
required_packages => 'debian-keyring debian-archive-keyring',
key => '46925553',
key_server => 'subkeys.pgp.net',
include_src => true,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment