aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem/apt.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-04-14 15:12:28 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-04-14 15:12:28 -0300
commit3f2aad8d17bde2354ad6d222d85d7281c40391b5 (patch)
treec8f290a1d6609baf41e97017c4e10022c1fdbe9e /manifests/subsystem/apt.pp
parent11466421c5c5ebb56d345b8f100e22fcd4b539ce (diff)
downloadpuppet-nodo-3f2aad8d17bde2354ad6d222d85d7281c40391b5.tar.gz
puppet-nodo-3f2aad8d17bde2354ad6d222d85d7281c40391b5.tar.bz2
Splitting nodo code into subsystems
Diffstat (limited to 'manifests/subsystem/apt.pp')
-rw-r--r--manifests/subsystem/apt.pp48
1 files changed, 48 insertions, 0 deletions
diff --git a/manifests/subsystem/apt.pp b/manifests/subsystem/apt.pp
new file mode 100644
index 0000000..b3f643d
--- /dev/null
+++ b/manifests/subsystem/apt.pp
@@ -0,0 +1,48 @@
+class nodo::subsystem::apt {
+ #
+ # Apt configuration
+ #
+ class { 'apt':
+ include_src => hiera('nodo::subsystem::apt::include_src', false),
+ use_next_release => hiera('nodo::subsystem::apt::use_next_release', false),
+ custom_key_dir => hiera('nodo::subsystem::apt::custom_key_dir', 'puppet:///modules/site_apt/keys.d')
+ }
+
+ include apt::unattended_upgrades
+
+ $apt_domain_source = hiera('nodo::subsystem::apt::domain_source', false)
+
+ apt::sources_list { "${::domain}.list":
+ source => [ "puppet:///modules/site_apt/sources.list.d/${::operatingsystem}/${::lsbdistcodename}/${::domain}.list",
+ "puppet:///modules/site_apt/sources.list.d/${::operatingsystem}/${::domain}.list", ],
+ ensure => $apt_domain_source ? {
+ true => present,
+ default => absent,
+ }
+ }
+
+ # Preferences file can't have dots in the filename
+ $apt_domain_preferences = regsubst($::domain, '\.', '-', 'G')
+
+ file { "/etc/apt/preferences.d/${apt_domain_preferences}":
+ source => [ "puppet:///modules/site_apt/preferences.d/${::operatingsystem}/${::domain}",
+ "puppet:///modules/nodo/preferences.d/custom" ],
+ ensure => $apt_domain_source ? {
+ true => present,
+ default => absent,
+ }
+ }
+
+ $apt_proxy = hiera('nodo::subsystem::apt::proxy', false)
+
+ if $apt_proxy != false {
+ class { 'apt::proxy_client':
+ proxy => $apt_proxy,
+ port => hiera('nodo::subsystem::apt::proxy_port', ''),
+ }
+ }
+
+ package { 'apt-transport-https':
+ ensure => present,
+ }
+}