]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Merge remote branch 'lelutin/master'
authormh <mh@immerda.ch>
Wed, 20 Oct 2010 23:59:41 +0000 (01:59 +0200)
committermh <mh@immerda.ch>
Wed, 20 Oct 2010 23:59:41 +0000 (01:59 +0200)
Integrate no custom preference into our new
way to manage the preferences.

Conflicts:
README
manifests/default_preferences.pp
manifests/init.pp

1  2 
README
manifests/init.pp
manifests/preferences.pp
manifests/preferences/absent.pp

diff --cc README
Simple merge
index 675c78d09ac24e29417d1723b8132f9cfd193a0d,60c95a11902dfe30b8c219af1a64f54ee5c2216d..4db120d181607c010b2c31cd542e355a7dc33803
@@@ -29,7 -29,31 +29,21 @@@ class apt 
      }
    }
  
-   include apt::preferences
+   config_file {
+     # little default settings which keep the system sane
+     "/etc/apt/apt.conf.d/from_puppet":
+       content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
 -      before => Config_file[apt_config];
++      before => Concatenated_file['/etc/apt/preferences'];
+   }
+   case $custom_preferences {
 -    '': {
 -      include apt::default_preferences
 -    }
+     false: {
 -      config_file { "/etc/apt/preferences":
 -        alias => "apt_config",
 -        ensure => absent;
 -      }
++      include apt::preferences::absent
+     }
+     default: {
 -      config_file { "/etc/apt/preferences":
 -        content => $custom_preferences,
 -        alias => "apt_config",
 -        require => File["/etc/apt/sources.list"];
 -      }
++      include apt::preferences
+     }
+   }
  
    if $apt_unattended_upgrades {
      include apt::unattended_upgrades
      'refresh_apt':
        command => '/usr/bin/apt-get update && sleep 1',
        refreshonly => true,
 -      subscribe => [ File["/etc/apt/sources.list", "/etc/apt/preferences", "/etc/apt/apt.conf.d"],
 -                     Config_file["apt_config"] ];
 +      subscribe => File['/etc/apt/sources.list',
 +                        '/etc/apt/apt.conf.d',
 +                        '/etc/apt/preferences'];
        'update_apt':
          command => '/usr/bin/apt-get update && /usr/bin/apt-get autoclean',
 -        require => [ File["/etc/apt/sources.list", "/etc/apt/preferences"], Config_file["apt_config"] ],
 +        require => File['/etc/apt/sources.list',
 +                        '/etc/apt/preferences'],
          loglevel => info,
          # Another Semaphor for all packages to reference
-         alias => apt_updated;
+         alias => "apt_updated";
    }
  
    ## 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 => [ Concatenated_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 => [ Concatenated_file[apt_config], Package["debian-backports-keyring"] ]
-       }
-     }
-   }
+   # backports uses the normal archive key now
+   package { "debian-backports-keyring": ensure => absent }
  
    if $custom_key_dir {
      file { "${apt_base_dir}/keys.d":
index 232b8f70c16711c65d9885e7a0b4355f2efa0fd0,0000000000000000000000000000000000000000..772b426500320c360e142bccb98989f1982facc5
mode 100644,000000..100644
--- /dev/null
@@@ -1,34 -1,0 +1,31 @@@
-     content => 'Package: *
 +class apt::preferences {
 +
 +  include common::moduledir
 +  $apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences"
 +  module_dir{'apt/preferences': }
 +  file{"${apt_preferences_dir}_header":
-   config_file {
-     # little default settings which keep the system sane
-     "/etc/apt/apt.conf.d/from_puppet":
-       content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
-       before => Concatenated_file[apt_config];
-   }
++    content => $custom_preferences ? {
++      '' => 'Package: *
 +Pin: release a=unstable
 +Pin-Priority: 1
 +
 +Package: *
 +Pin: release a=testing
 +Pin-Priority: 2
 +
 +',
++      default => $custom_preferences
++    },
 +  }
 +
 +  concatenated_file{'/etc/apt/preferences':
 +    dir => $apt_preferences_dir,
 +    header => "${apt_preferences_dir}_header",
 +    # use Concatenated_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"];
 +  }
 +
 +}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3131aff9288f4cb0b026a072935a69775f3e5124
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,8 @@@
++class apt::preferences::absent {
++  include common::moduledir
++  $apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences"
++  concatenated_file{'/etc/apt/preferences':
++    dir => $apt_preferences_dir,
++    ensure => absent,
++  }
++}