diff options
| author | Gabriel Filion <lelutin@gmail.com> | 2013-01-02 08:12:11 -0500 | 
|---|---|---|
| committer | intrigeri <intrigeri@boum.org> | 2013-01-02 17:28:59 +0100 | 
| commit | ded81d8edcc9a7cc8275a68f669fde896379b12e (patch) | |
| tree | 244f0fda87dc42ab62474b306fabcb658604342d /manifests/init.pp | |
| parent | 17f67d9fac83193f4436e82fc6046e065d9ab024 (diff) | |
| download | puppet-apt-ded81d8edcc9a7cc8275a68f669fde896379b12e.tar.gz puppet-apt-ded81d8edcc9a7cc8275a68f669fde896379b12e.tar.bz2  | |
Apply code style corrections from puppet-lint
Signed-off-by: Gabriel Filion <lelutin@gmail.com>
+ more linting by intrigeri.
Conflicts:
	manifests/apticron.pp
	manifests/cron/dist_upgrade.pp
	manifests/cron/download.pp
	manifests/dist_upgrade/initiator.pp
	manifests/init.pp
	manifests/listchanges.pp
	manifests/preferences.pp
	manifests/preseeded_package.pp
	manifests/proxy_client.pp
	manifests/unattended_upgrades.pp
	manifests/update.pp
Diffstat (limited to 'manifests/init.pp')
| -rw-r--r-- | manifests/init.pp | 75 | 
1 files changed, 42 insertions, 33 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 5c0738b..020c1cc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,7 +20,7 @@ class apt(    case $::operatingsystem {      'debian': {        $real_repos = $repos ? { -        'auto'      => 'main contrib non-free', +        'auto'  => 'main contrib non-free',          default => $repos,        }      } @@ -32,8 +32,8 @@ class apt(      }    } -  package { apt: -    ensure => installed, +  package { 'apt': +    ensure  => installed,      require => undef,    } @@ -42,7 +42,7 @@ class apt(    # init $release, $next_release, $next_codename, $release_version    case $codename {      'n/a': { -      fail("Unknown lsbdistcodename reported by facter: '$lsbdistcodename', please fix this by setting this variable in your manifest.") +      fail("Unknown lsbdistcodename reported by facter: '$::lsbdistcodename', please fix this by setting this variable in your manifest.")      }      default: {        $release = debian_release($codename) @@ -52,41 +52,44 @@ class apt(    $next_codename = debian_nextcodename($codename)    $next_release = debian_nextrelease($release) +  $sources_content = $::custom_sources_list ? { +    ''      => template( "apt/${::operatingsystem}/sources.list.erb"), +    default => $::custom_sources_list +  }    file {      # include main, security and backports      # additional sources should be included via the apt::sources_list define -    "/etc/apt/sources.list": -      content => $custom_sources_list ? { -        '' => template( "apt/${::operatingsystem}/sources.list.erb"), -        default => $custom_sources_list -      }, +    '/etc/apt/sources.list': +      content => $sources_content,        require => Package['lsb'], -      notify => Exec['refresh_apt'], -      owner => root, group => 0, mode => 0644; +      notify  => Exec['refresh_apt'], +      owner   => root, +      group   => 0, +      mode    => '0644';    } -  apt_conf { "02show_upgraded": +  apt_conf { '02show_upgraded':      source => [ "puppet:///modules/site_apt/${::fqdn}/02show_upgraded", -                "puppet:///modules/site_apt/02show_upgraded", -                "puppet:///modules/apt/02show_upgraded" ] +                'puppet:///modules/site_apt/02show_upgraded', +                'puppet:///modules/apt/02show_upgraded' ]    } -  if ( $::virtual == "vserver" ) { -    apt_conf { "03clean_vserver": +  if ( $::virtual == 'vserver' ) { +    apt_conf { '03clean_vserver':        source => [ "puppet:///modules/site_apt/${::fqdn}/03clean_vserver", -                  "puppet:///modules/site_apt/03clean_vserver", -                  "puppet:///modules/apt/03clean_vserver" ], -      alias => "03clean"; +                  'puppet:///modules/site_apt/03clean_vserver', +                  'puppet:///modules/apt/03clean_vserver' ], +      alias => '03clean';      }    }    else { -    apt_conf { "03clean": +    apt_conf { '03clean':        source => [ "puppet:///modules/site_apt/${::fqdn}/03clean", -                  "puppet:///modules/site_apt/03clean", -                  "puppet:///modules/apt/03clean" ] +                  'puppet:///modules/site_apt/03clean', +                  'puppet:///modules/apt/03clean' ]      }    } -     +    case $custom_preferences {      false: {        include apt::preferences::absent @@ -101,29 +104,35 @@ class apt(    include apt::dot_d_directories    ## This package should really always be current -  package { "debian-archive-keyring": ensure => latest } +  package { 'debian-archive-keyring': ensure => latest }    # backports uses the normal archive key now -  package { "debian-backports-keyring": ensure => absent } +  package { 'debian-backports-keyring': ensure => absent } + +  include common::moduledir +  $apt_base_dir = "${common::moduledir::module_dir_path}/apt" +  modules_dir { 'apt': } -  if $custom_key_dir { +  if $::custom_key_dir {      file { "${apt_base_dir}/keys.d": -      source => "$custom_key_dir", +      source  => $::custom_key_dir,        recurse => true, -      mode => 0755, owner => root, group => root, +      owner   => root, +      group   => root, +      mode    => '0755',      } -    exec { "custom_keys": -      command => "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && /usr/bin/apt-get update", -      subscribe => File["${apt_base_dir}/keys.d"], +    exec { 'custom_keys': +      command     => "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && /usr/bin/apt-get update", +      subscribe   => File["${apt_base_dir}/keys.d"],        refreshonly => true,      }      if $custom_preferences != false { -      Exec["custom_keys"] { +      Exec['custom_keys'] {          before => File['apt_config'],        }      }    }    # workaround for preseeded_package component -  file { [ "/var/cache", "/var/cache/local", "/var/cache/local/preseeding" ]: ensure => directory } +  file { [ '/var/cache', '/var/cache/local', '/var/cache/local/preseeding' ]: ensure => directory }  }  | 
