]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adding support for a custom apt preferences
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 21 May 2012 20:46:51 +0000 (17:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 21 May 2012 20:46:51 +0000 (17:46 -0300)
files/preferences.d/custom [new file with mode: 0644]
manifests/nodo.pp

diff --git a/files/preferences.d/custom b/files/preferences.d/custom
new file mode 100644 (file)
index 0000000..e69de29
index b5ac46a96d22f50e69ab3118fd77eba49d04b841..b4b7e22530c1a89ec2d888ffdffbb53029a99334 100644 (file)
@@ -52,6 +52,18 @@ class nodo {
       }
     }
 
+    # 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,
+      }
+    }
+
     package { 'apt-transport-https':
       ensure => present,
     }