]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Merge remote branch 'nadir/master' into wip
authorintrigeri <intrigeri@boum.org>
Sat, 16 Oct 2010 23:57:55 +0000 (01:57 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 16 Oct 2010 23:57:55 +0000 (01:57 +0200)
Conflicts:
manifests/default_preferences.pp
manifests/default_sources_list.pp
manifests/init.pp
templates/Debian/sources.list.deb-src.erb
templates/Debian/sources.list.erb
templates/Debian/sources.list.volatile.erb
templates/Ubuntu/sources.list.erb

1  2 
files/50unattended-upgrades
manifests/custom_sources.pp
manifests/default_preferences.pp
manifests/default_sources_list.pp
manifests/init.pp
manifests/unattended_upgrades.pp
templates/Ubuntu/sources.list.erb

index 0000000000000000000000000000000000000000,384b373ff939fef38e544a02e358eb5494e864ee..d9535bc2310053eff844782b5860ee49c5329e91
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,48 +1,57 @@@
 -      // we don't want the kernel to be updated so nagios still can give a warnig if there is 
+ // this file is managed by puppet !
+ //
+ //See https://wiki.ubuntu.com/AutomaticUpdates for more details about this feature.
+ // allowed (origin, archive) pairs
+ Unattended-Upgrade::Allowed-Origins {
+       "Debian stable";
+       "Debian-Security stable";
+ //    "Debian testing";
+ };
+ APT::Periodic::Update-Package-Lists "1";
+ APT::Periodic::Unattended-Upgrade "1";
+ Unattended-Upgrade::Mail "root";
+ APT::UnattendedUpgrades::LogDir "/var/log/";
+ APT::UnattendedUpgrades::LogFile "unattended_upgrades.log";
+ Unattended-Upgrade::Package-Blacklist {
 -      
++      // we don't want the kernel to be updated so nagios still can give a warning if there is
+       // a manual update (and reboot) left
 -      
++
+         "linux-image-*";
 -        
++
+       // unfortunately there seems to be a bug in unattended-upgrades <= 0.25.1 that wildcards aren't recognized:
+       //2009-12-11 13:41:43,267 INFO Initial blacklisted packages: linux-image-*
+       //2009-12-11 13:41:43,267 INFO Starting unattended upgrades script
+       //2009-12-11 13:41:43,267 INFO Allowed origins are: ["['Debian', 'stable']", "['Debian-Security', 'stable']"]
+       //2009-12-11 13:41:45,233 INFO Packages that are upgraded: linux-image-2.6.26-2-amd64
+       //2009-12-11 13:41:45,233 INFO Writing dpkg log to '/var/log/unattended-upgrades-dpkg_2009-12-11_13:41:45.233713.log'
+       //2009-12-11 13:42:11,988 INFO All upgrades installed
 -      
++
+         // lenny
+       "linux-image-2.6.26-1-686";
+       "linux-image-2.6.26-1-amd64";
+         "linux-image-2.6.26-1-xen-686";
+         "linux-image-2.6.26-1-xen-amd64";
+       "linux-image-2.6.26-1-vserver-686";
+       "linux-image-2.6.26-1-vserver-amd64";
++
+       "linux-image-2.6.26-2-686";
+       "linux-image-2.6.26-2-amd64";
+         "linux-image-2.6.26-2-xen-686";
+         "linux-image-2.6.26-2-xen-amd64";
++      "linux-image-2.6.26-2-vserver-686";
+       "linux-image-2.6.26-2-vserver-amd64";
++      // squeeze
++      "linux-image-2.6.32-5-686";
++      "linux-image-2.6.32-5-amd64";
++      "linux-image-2.6.32-5-xen-686";
++      "linux-image-2.6.32-5-xen-amd64";
++      "linux-image-2.6.32-5-vserver-686";
++      "linux-image-2.6.32-5-vserver-amd64";
++
+ };
index 0000000000000000000000000000000000000000,cd7b8fcfe0ca54c864350a1ddb601b7b71f8d92a..31d685a71ea1dbceb3031356c17ce619f5e81f1a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,10 +1,10 @@@
 -    exec { "/usr/bin/apt-get update":   
+ define apt::custom_sources_template ($sources_file = "") {
+     file { "/etc/apt/sources.list.d/$sources_file":
+                    content => template($name),
+      }
 -        refreshonly => true,            
++    exec { "/usr/bin/apt-get update":
+         subscribe => File["/etc/apt/sources.list.d/$sources_file"],
++        refreshonly => true,
+     }
+  }
index 605ba78465570be860041d3ff4e7d98ba77811f2,671abddd0a0becf4d9be919fb17b66d3f01f83eb..28471b954b2d17e4a4fb546f5bda58d1aeba132b
@@@ -1,22 -1,16 +1,22 @@@
  class apt::default_preferences {
 -  config_file {
 -    # this just pins unstable and testing to very low values
 -    "/etc/apt/preferences":
 -      content => template("apt/preferences.erb"),
 -      # use File[apt_config] to reference a completed configuration
 -      # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML
 -      alias => apt_config,
 -      # only update together
 -      require => File["/etc/apt/sources.list"];
 -    # little default settings which keep the system sane
 -    "/etc/apt/apt.conf.d/99from_puppet":
 -      content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
 -      before => Config_file[apt_config];
 +  case $operatingsystem {
 +    'debian': {
 +      config_file {
 +        "/etc/apt/preferences":
 +          content => template("apt/${operatingsystem}/preferences_${codename}.erb"),
 +          # use File[apt_config] to reference a completed configuration
 +          # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML
 +          alias => apt_config,
 +          # only update together
 +          require => File["/etc/apt/sources.list"];
 +        # little default settings which keep the system sane
-         "/etc/apt/apt.conf.d/from_puppet":
++        "/etc/apt/apt.conf.d/99from_puppet":
 +          content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
 +          before => Config_file[apt_config];
 +      }
 +    }
 +    'ubuntu': {
 +      notice('There is no support for default Ubuntu APT preferences')
 +    }
    }
  }
index 0e78c0265c1f2f6e2ca2711d82ad5645e96ec4f3,cf7d5232906289a15ab9b8706802a24cffe2eb8d..91955d7deb6773dd25ebdcc17f2eab49c55d304f
@@@ -3,7 -4,8 +3,8 @@@ class apt::default_sources_list 
      # include main, security and backports
      # additional sources could be included via an array
      "/etc/apt/sources.list":
 -      content => template( "apt/$operatingsystem/sources.list.erb"),
 +      content => template("apt/${operatingsystem}/sources.list.erb"),
+       require => Package['lsb'];
    }
  }
  
index 85cab9fbfbafaabf754d3fc58429ce9e503aef29,9c33b4d5d9a5f826bccf36b1ed7f81d382711fa5..8136f2525b8b578feff9874e584f969deb36119f
@@@ -5,6 -5,8 +5,8 @@@
  
  class apt {
  
 -  
+   import "custom_sources.pp"
++
    # See README
    $real_apt_clean = $apt_clean ? {
      '' => 'auto',
  
    ## This package should really always be current
    package { "debian-archive-keyring": ensure => latest }
 -        
 -  case $lsbdistcodename {
 -    etch: {
 -      package { "debian-backports-keyring": ensure => latest }
 -                
 -      # This key was downloaded from
 -      # http://backports.org/debian/archive.key
 -      # and is needed to bootstrap the backports trustpath
 -      file { "${apt_base_dir}/backports.org.key":
 -        source => "puppet:///modules/apt/backports.org.key",
 -        mode => 0444, owner => root, group => root,
 -      }
 -      exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update":
 -        alias => "backports_key",
 -        refreshonly => true,
 -        subscribe => File["${apt_base_dir}/backports.org.key"],
 -        before => [ File[apt_config], Package["debian-backports-keyring"] ]
 -      }
 -    }
 -    lenny: {
 -      package { "debian-backports-keyring": ensure => latest }
 -
 -      # This key was downloaded from
 -      # http://backports.org/debian/archive.key
 -      # and is needed to bootstrap the backports trustpath
 -      file { "${apt_base_dir}/backports.org.key":
 -        source => "puppet:///modules/apt/backports.org.key",
 -        mode => 0444, owner => root, group => root,
 -      }
 -      exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update":
 -        alias => "backports_key",
 -        refreshonly => true,
 -        subscribe => File["${apt_base_dir}/backports.org.key"],
 -        before => [ Config_file[apt_config], Package["debian-backports-keyring"] ]
 -      }
 -    }
 -  }
 +  # backports uses the normal archive key now
 +  package { "debian-backports-keyring": ensure => absent }
-         
-   case $custom_key_dir {
-     '': {
-       exec { "/bin/true # no_custom_keydir": }
+   if $custom_key_dir {
+     file { "${apt_base_dir}/keys.d":
+       source => "$custom_key_dir",
+       recurse => true,
+       mode => 0755, owner => root, group => root,
      }
-     default: {
-       file { "${apt_base_dir}/keys.d":
-         source => "$custom_key_dir",
-         recurse => true,
-         mode => 0755, owner => root, group => root,
-       }
-       exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update":
-         alias => "custom_keys",
-         subscribe => File["${apt_base_dir}/keys.d"],
-         refreshonly => true,
-         before => Config_file["apt_config"];
-       }
+     exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update":
+       alias => "custom_keys",
+       subscribe => File["${apt_base_dir}/keys.d"],
+       refreshonly => true,
+       before => Config_file[apt_config];
      }
    }
  
    # workaround for preseeded_package component
-   file { "/var/cache": ensure => directory }
-   file { "/var/cache/local": ensure => directory }
-   file { "/var/cache/local/preseeding": ensure => directory }
- }     
+   file { [ "/var/cache", "/var/cache/local", "/var/cache/local/preseeding" ]: ensure => directory }
 -}     
++}
index c984c409be36f99dc4415075a8383a1d8647ffb2,27942b3ad1fb814278ff99e4525bb371c6703550..805b0ed44429174d3d0a72c3644096e18724e0c1
@@@ -5,11 -5,11 +5,11 @@@ class apt::unattended_upgrades 
    }
  
    config_file {
-     "/etc/apt/apt.conf.d/unattended_upgrades":
-       content => 'APT::Periodic::Update-Package-Lists "1";
- APT::Periodic::Unattended-Upgrade "1";
- ',
-       before => Config_file[apt_config],
-       require => Package['unattended-upgrades'],
 -    "/etc/apt/apt.conf.d/50unattended-upgrades": 
 -    source  => ["puppet:///modules/site-apt/50unattended-upgrades", 
 -              "puppet:///modules/apt/50unattended-upgrades" ], 
 -      
++    "/etc/apt/apt.conf.d/50unattended-upgrades":
++    source  => ["puppet:///modules/site-apt/50unattended-upgrades",
++              "puppet:///modules/apt/50unattended-upgrades" ],
++
+     before => Config_file[apt_config],
+     require => Package['unattended-upgrades'],
    }
  }
index 44f3024b0143c7806451b3df8306a16faa432eb0,dfecd639eff6cf5b859c0b8d09a626c40d6fef1c..36fc150e90a6a1bf3771196f7e59b307ff20ad83
@@@ -14,9 -8,5 +14,12 @@@ deb-src http://de.archive.ubuntu.com/ub
  
  # security suppport
  deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-security main restricted universe multiverse
 +<% if include_src then -%>
 +deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-security main restricted universe multiverse
 +<% end -%>
  
 -
 +# backports
 +deb http://archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-backports main universe multiverse restricted
++<% if include_src then -%>
++deb-src http://archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-backports main universe multiverse restricted
++<% end -%>