From 9493b62187b814e872eb27f4a6a18c53b5076906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 21:25:13 -0500 Subject: indent packages correctly --- manifests/apticron.pp | 4 +++- manifests/cron/dist_upgrade.pp | 8 ++++++-- manifests/dselect.pp | 4 +++- manifests/init.pp | 4 +++- manifests/listchanges.pp | 4 +++- manifests/unattended_upgrades.pp | 2 +- manifests/upgrade_package.pp | 2 -- 7 files changed, 19 insertions(+), 9 deletions(-) (limited to 'manifests') diff --git a/manifests/apticron.pp b/manifests/apticron.pp index 89709a8..73ada70 100644 --- a/manifests/apticron.pp +++ b/manifests/apticron.pp @@ -12,7 +12,9 @@ class apt::apticron( $customsubject = '' ) { - package { 'apticron': ensure => $ensure_version } + package { 'apticron': + ensure => $ensure_version + } file { '/etc/apticron/apticron.conf': content => template($apt::apticron::config), diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index e1a03ed..d3d3be3 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -2,7 +2,9 @@ class apt::cron::dist_upgrade ( $cron_hours = '', ) { - package { 'cron-apt': ensure => installed } + package { 'cron-apt': + ensure => installed + } case $cron_hours { '': {} @@ -27,7 +29,9 @@ dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-conf ensure => absent, } - package { 'apt-listbugs': ensure => absent } + package { 'apt-listbugs': + ensure => absent + } file { '/etc/cron-apt/action.d/4-dist-upgrade': content => $action, diff --git a/manifests/dselect.pp b/manifests/dselect.pp index 2b99a43..da00c96 100644 --- a/manifests/dselect.pp +++ b/manifests/dselect.pp @@ -7,5 +7,7 @@ class apt::dselect { line => 'expert', } - package { 'dselect': ensure => installed } + package { 'dselect': + ensure => installed + } } diff --git a/manifests/init.pp b/manifests/init.pp index 3d93d22..30782e4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -74,7 +74,9 @@ 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 + } if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { apt::sources_list { diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index ecbbe6d..2c5641a 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -7,7 +7,9 @@ class apt::listchanges( $saveseen = '/var/lib/apt/listchanges.db', $which = 'both' ){ - package { 'apt-listchanges': ensure => $ensure_version } + package { 'apt-listchanges': + ensure => $ensure_version + } file { '/etc/apt/listchanges.conf': content => template($apt::listchanges::config), diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index d604125..dff911d 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -8,7 +8,7 @@ class apt::unattended_upgrades ( ) { package { 'unattended-upgrades': - ensure => $ensure_version + ensure => $ensure_version, } # For some reason, this directory is sometimes absent, which causes diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index e61b15d..73eb48b 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -13,14 +13,12 @@ define apt::upgrade_package ( if !defined(Package['apt-show-versions']) { package { 'apt-show-versions': ensure => installed, - require => undef, } } if !defined(Package['dctrl-tools']) { package { 'dctrl-tools': ensure => installed, - require => undef, } } -- cgit v1.2.3 From ef6036e879f894697a03459501a994af930dc4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 21:37:05 -0500 Subject: harmonize variable alignment --- manifests/apt_conf.pp | 12 ++++++------ manifests/apticron.pp | 22 +++++++++++----------- manifests/dist_upgrade/initiator.pp | 2 +- manifests/init.pp | 28 ++++++++++++++-------------- manifests/listchanges.pp | 15 ++++++++------- manifests/params.pp | 18 +++++++++--------- manifests/preferences_snippet.pp | 10 +++++----- manifests/preseeded_package.pp | 6 ++++-- manifests/proxy_client.pp | 6 +++--- manifests/sources_list.pp | 2 +- manifests/unattended_upgrades.pp | 10 +++++----- manifests/upgrade_package.pp | 2 +- 12 files changed, 68 insertions(+), 65 deletions(-) (limited to 'manifests') diff --git a/manifests/apt_conf.pp b/manifests/apt_conf.pp index fa8cfa3..ec6da6d 100644 --- a/manifests/apt_conf.pp +++ b/manifests/apt_conf.pp @@ -1,9 +1,9 @@ -define apt::apt_conf( - $ensure = 'present', - $source = undef, - $content = undef, - $refresh_apt = true ) -{ +define apt::apt_conf ( + $ensure = 'present', + $source = undef, + $content = undef, + $refresh_apt = true, +) { if $source == undef and $content == undef { fail("One of \$source or \$content must be specified for apt_conf ${name}") diff --git a/manifests/apticron.pp b/manifests/apticron.pp index 73ada70..a8a24be 100644 --- a/manifests/apticron.pp +++ b/manifests/apticron.pp @@ -1,15 +1,15 @@ -class apt::apticron( - $ensure_version = 'installed', - $config = "apt/${::operatingsystem}/apticron.erb", - $email = 'root', - $diff_only = '1', +class apt::apticron ( + $ensure_version = 'installed', + $config = "apt/${::operatingsystem}/apticron.erb", + $email = 'root', + $diff_only = '1', $listchanges_profile = 'apticron', - $system = false, - $ipaddressnum = false, - $ipaddresses = false, - $notifyholds = '0', - $notifynew = '0', - $customsubject = '' + $system = false, + $ipaddressnum = false, + $ipaddresses = false, + $notifyholds = '0', + $notifynew = '0', + $customsubject = '', ) { package { 'apticron': diff --git a/manifests/dist_upgrade/initiator.pp b/manifests/dist_upgrade/initiator.pp index d238988..eae5492 100644 --- a/manifests/dist_upgrade/initiator.pp +++ b/manifests/dist_upgrade/initiator.pp @@ -1,6 +1,6 @@ class apt::dist_upgrade::initiator inherits apt::dist_upgrade { - $initiator = 'upgrade_initiator' + $initiator = 'upgrade_initiator' $initiator_abs = "${apt::apt_base_dir}/${initiator}" file { 'apt_upgrade_initiator': diff --git a/manifests/init.pp b/manifests/init.pp index 30782e4..f7ef2e4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,21 +3,21 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -class apt( - $use_lts = $apt::params::use_lts, - $use_volatile = $apt::params::use_volatile, - $use_backports = $apt::params::use_backports, - $include_src = $apt::params::include_src, - $use_next_release = $apt::params::use_next_release, - $debian_url = $apt::params::debian_url, - $security_url = $apt::params::security_url, - $lts_url = $apt::params::lts_url, - $volatile_url = $apt::params::volatile_url, - $ubuntu_url = $apt::params::ubuntu_url, - $repos = $apt::params::repos, - $custom_preferences = $apt::params::custom_preferences, +class apt ( + $use_lts = $apt::params::use_lts, + $use_volatile = $apt::params::use_volatile, + $use_backports = $apt::params::use_backports, + $include_src = $apt::params::include_src, + $use_next_release = $apt::params::use_next_release, + $debian_url = $apt::params::debian_url, + $security_url = $apt::params::security_url, + $lts_url = $apt::params::lts_url, + $volatile_url = $apt::params::volatile_url, + $ubuntu_url = $apt::params::ubuntu_url, + $repos = $apt::params::repos, + $custom_preferences = $apt::params::custom_preferences, $custom_sources_list = '', - $custom_key_dir = $apt::params::custom_key_dir + $custom_key_dir = $apt::params::custom_key_dir, ) inherits apt::params { package { 'apt': diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index 2c5641a..642986b 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -1,12 +1,13 @@ -class apt::listchanges( +class apt::listchanges ( $ensure_version = 'installed', - $config = "apt/${::operatingsystem}/listchanges.erb", - $frontend = 'mail', - $email = 'root', - $confirm = '0', - $saveseen = '/var/lib/apt/listchanges.db', - $which = 'both' + $config = "apt/${::operatingsystem}/listchanges.erb", + $frontend = 'mail', + $email = 'root', + $confirm = '0', + $saveseen = '/var/lib/apt/listchanges.db', + $which = 'both', ){ + package { 'apt-listchanges': ensure => $ensure_version } diff --git a/manifests/params.pp b/manifests/params.pp index 2b18eb5..463cd63 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,14 +1,14 @@ class apt::params () { - $use_lts = false - $use_volatile = false - $use_backports = true - $include_src = false + $use_lts = false + $use_volatile = false + $use_backports = true + $include_src = false $use_next_release = false - $debian_url = 'http://httpredir.debian.org/debian/' - $security_url = 'http://security.debian.org/' - $ubuntu_url = 'http://archive.ubuntu.com/ubuntu' - $lts_url = $debian_url - $volatile_url = 'http://volatile.debian.org/debian-volatile/' + $debian_url = 'http://httpredir.debian.org/debian/' + $security_url = 'http://security.debian.org/' + $ubuntu_url = 'http://archive.ubuntu.com/ubuntu' + $lts_url = $debian_url + $volatile_url = 'http://volatile.debian.org/debian-volatile/' case $::operatingsystem { 'debian': { $repos = 'main contrib non-free' diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 2b2fb74..e142ea0 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -1,10 +1,10 @@ define apt::preferences_snippet ( $priority = undef, - $package = false, - $ensure = 'present', - $source = undef, - $release = undef, - $pin = undef + $package = false, + $ensure = 'present', + $source = undef, + $release = undef, + $pin = undef, ) { $real_package = $package ? { diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 162ade7..5a2979f 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -1,8 +1,10 @@ # Install a package with a preseed file to automatically answer some questions. + define apt::preseeded_package ( - $ensure = 'installed', - $content = '' + $ensure = 'installed', + $content = '', ) { + $seedfile = "/var/cache/local/preseeding/${name}.seeds" $real_content = $content ? { '' => template ( "site_apt/${::debian_codename}/${name}.seeds" ), diff --git a/manifests/proxy_client.pp b/manifests/proxy_client.pp index e7972f7..0793878 100644 --- a/manifests/proxy_client.pp +++ b/manifests/proxy_client.pp @@ -1,7 +1,7 @@ -class apt::proxy_client( +class apt::proxy_client ( $proxy = 'http://localhost', - $port = '3142', -){ + $port = '3142', +) { ::apt::apt_conf { '20proxy': content => template('apt/20proxy.erb'), diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 6ff4fc3..22bc110 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -2,7 +2,7 @@ define apt::sources_list ( $ensure = 'present', $source = undef, - $content = undef + $content = undef, ) { if $ensure == 'present' { diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index dff911d..85d21d4 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -1,10 +1,10 @@ class apt::unattended_upgrades ( - $config_content = undef, - $config_template = 'apt/50unattended-upgrades.erb', - $mailonlyonerror = true, - $mail_recipient = 'root', + $config_content = undef, + $config_template = 'apt/50unattended-upgrades.erb', + $mailonlyonerror = true, + $mail_recipient = 'root', $blacklisted_packages = [], - $ensure_version = present + $ensure_version = 'present', ) { package { 'unattended-upgrades': diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index 73eb48b..54dbff6 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -1,7 +1,7 @@ # Install a package either to a certain version, or while making sure that it's # always the latest version that's installed. define apt::upgrade_package ( - $version = '' + $version = '', ) { $version_suffix = $version ? { -- cgit v1.2.3 From c4e6f42e1b629e98ddeeb7c9821f1266f7295685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 21:46:37 -0500 Subject: fix missing/superfluous newline at the end/beginning of files --- manifests/apt_conf.pp | 1 - manifests/cron/dist_upgrade.pp | 1 - manifests/dist_upgrade.pp | 1 - manifests/dist_upgrade/initiator.pp | 1 - manifests/dot_d_directories.pp | 4 ++-- manifests/dselect.pp | 1 + manifests/init.pp | 1 - manifests/preferences.pp | 1 - manifests/reboot_required_notify.pp | 1 - manifests/reboot_required_notify/jessie.pp | 1 - manifests/reboot_required_notify/wheezy.pp | 1 - manifests/sources_list.pp | 1 + manifests/update.pp | 1 - manifests/upgrade_package.pp | 2 +- 14 files changed, 5 insertions(+), 13 deletions(-) (limited to 'manifests') diff --git a/manifests/apt_conf.pp b/manifests/apt_conf.pp index ec6da6d..709fd23 100644 --- a/manifests/apt_conf.pp +++ b/manifests/apt_conf.pp @@ -41,5 +41,4 @@ define apt::apt_conf ( notify => Exec['apt_updated'], } } - } diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index d3d3be3..2a46331 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -48,5 +48,4 @@ dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-conf mode => '0644', require => Package[cron-apt]; } - } diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp index 3061fb8..3d9b29b 100644 --- a/manifests/dist_upgrade.pp +++ b/manifests/dist_upgrade.pp @@ -8,5 +8,4 @@ class apt::dist_upgrade ( timeout => $timeout, before => Exec['apt_updated'] } - } diff --git a/manifests/dist_upgrade/initiator.pp b/manifests/dist_upgrade/initiator.pp index eae5492..2ce83da 100644 --- a/manifests/dist_upgrade/initiator.pp +++ b/manifests/dist_upgrade/initiator.pp @@ -19,5 +19,4 @@ class apt::dist_upgrade::initiator inherits apt::dist_upgrade { Exec['apt_dist-upgrade'] { subscribe +> File['apt_upgrade_initiator'], } - } diff --git a/manifests/dot_d_directories.pp b/manifests/dot_d_directories.pp index 0ace863..970cea0 100644 --- a/manifests/dot_d_directories.pp +++ b/manifests/dot_d_directories.pp @@ -1,6 +1,7 @@ +# watch .d directories and ensure they are present + class apt::dot_d_directories { - # watch .d directories and ensure they are present file { '/etc/apt/apt.conf.d': ensure => directory, @@ -11,5 +12,4 @@ class apt::dot_d_directories { checksum => mtime, notify => Exec['apt_updated']; } - } diff --git a/manifests/dselect.pp b/manifests/dselect.pp index da00c96..2e6e90b 100644 --- a/manifests/dselect.pp +++ b/manifests/dselect.pp @@ -1,5 +1,6 @@ # manage dselect, like # suppressing the annoying help texts + class apt::dselect { file_line { 'dselect_expert': diff --git a/manifests/init.pp b/manifests/init.pp index f7ef2e4..63059dd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -128,5 +128,4 @@ class apt ( # Another Semaphor for all packages to reference alias => [ 'apt_updated', 'refresh_apt'] } - } diff --git a/manifests/preferences.pp b/manifests/preferences.pp index aedd56b..d3eb780 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -16,5 +16,4 @@ class apt::preferences { require => File['/etc/apt/sources.list'], owner => root, group => 0, mode => '0644'; } - } diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp index efd8aeb..3463bb4 100644 --- a/manifests/reboot_required_notify.pp +++ b/manifests/reboot_required_notify.pp @@ -7,5 +7,4 @@ class apt::reboot_required_notify { } else { class { 'apt::reboot_required_notify::wheezy': } } - } diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp index 2de6b62..b8800a3 100644 --- a/manifests/reboot_required_notify/jessie.pp +++ b/manifests/reboot_required_notify/jessie.pp @@ -24,5 +24,4 @@ class apt::reboot_required_notify::jessie ($ensure = present) { ensure => $ensure, require => Apt::Preferences_snippet['reboot-notifier'], } - } diff --git a/manifests/reboot_required_notify/wheezy.pp b/manifests/reboot_required_notify/wheezy.pp index 06998ef..1ad46cd 100644 --- a/manifests/reboot_required_notify/wheezy.pp +++ b/manifests/reboot_required_notify/wheezy.pp @@ -19,5 +19,4 @@ class apt::reboot_required_notify::wheezy ($ensure = present) { minute => 20, require => Package['update-notifier-common'], } - } diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 22bc110..2fc7111 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -1,4 +1,5 @@ # Configure an apt source + define apt::sources_list ( $ensure = 'present', $source = undef, diff --git a/manifests/update.pp b/manifests/update.pp index dde8320..d5fd539 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -3,5 +3,4 @@ class apt::update inherits ::apt { Exec['update_apt'] { refreshonly => false } - } diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index 54dbff6..f739f07 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -1,5 +1,6 @@ # Install a package either to a certain version, or while making sure that it's # always the latest version that's installed. + define apt::upgrade_package ( $version = '', ) { @@ -27,5 +28,4 @@ define apt::upgrade_package ( require => Package['apt-show-versions', 'dctrl-tools'], before => Exec['apt_updated'] } - } -- cgit v1.2.3 From 0bdd46891d9fe202e22fb5a90ed720c6769edf9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 21:56:16 -0500 Subject: fix array identation --- manifests/dist_upgrade/initiator.pp | 6 ++---- manifests/init.pp | 13 +++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'manifests') diff --git a/manifests/dist_upgrade/initiator.pp b/manifests/dist_upgrade/initiator.pp index 2ce83da..5dfce14 100644 --- a/manifests/dist_upgrade/initiator.pp +++ b/manifests/dist_upgrade/initiator.pp @@ -9,11 +9,9 @@ class apt::dist_upgrade::initiator inherits apt::dist_upgrade { group => 0, path => $initiator_abs, checksum => md5, - source => [ - "puppet:///modules/site_apt/${::fqdn}/${initiator}", + source => [ "puppet:///modules/site_apt/${::fqdn}/${initiator}", "puppet:///modules/site_apt/${initiator}", - "puppet:///modules/apt/${initiator}", - ], + "puppet:///modules/apt/${initiator}" ], } Exec['apt_dist-upgrade'] { diff --git a/manifests/init.pp b/manifests/init.pp index 63059dd..196c0c7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -117,13 +117,18 @@ class apt ( } # 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; + } exec { 'update_apt': command => '/usr/bin/apt-get update', - require => [ - File['/etc/apt/apt.conf.d', '/etc/apt/preferences' ], - File['/etc/apt/sources.list'] ], + require => [ File['/etc/apt/apt.conf.d', + '/etc/apt/preferences', + '/etc/apt/sources.list'] ], refreshonly => true, # Another Semaphor for all packages to reference alias => [ 'apt_updated', 'refresh_apt'] -- cgit v1.2.3 From 2c56e06458d0308faf3746aff536558362d1082b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 22:09:14 -0500 Subject: move parts of init.pp to config.pp^& install.pp to increase readability --- manifests/config.pp | 91 ++++++++++++++++++++++++++++++++++++++++++ manifests/init.pp | 109 +++------------------------------------------------ manifests/install.pp | 11 ++++++ 3 files changed, 108 insertions(+), 103 deletions(-) create mode 100644 manifests/config.pp create mode 100644 manifests/install.pp (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..3db84d7 --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,91 @@ +class apt::config inherits apt { + + $sources_content = $custom_sources_list ? { + '' => template( "apt/${::operatingsystem}/sources.list.erb"), + default => $custom_sources_list + } + file { + # include main and security + # additional sources should be included via the apt::sources_list define + '/etc/apt/sources.list': + content => $sources_content, + notify => Exec['apt_updated'], + owner => root, + group => 0, + mode => '0644'; + } + + # workaround for preseeded_package component + file { + [ '/var/cache', + '/var/cache/local', + '/var/cache/local/preseeding' ]: + ensure => directory; + } + + ::apt::apt_conf { '02show_upgraded': + source => [ "puppet:///modules/site_apt/${::fqdn}/02show_upgraded", + 'puppet:///modules/site_apt/02show_upgraded', + 'puppet:///modules/apt/02show_upgraded' ] + } + + if ( $::virtual == 'vserver' ) { + ::apt::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'; + } + } + else { + ::apt::apt_conf { '03clean': + source => [ "puppet:///modules/site_apt/${::fqdn}/03clean", + 'puppet:///modules/site_apt/03clean', + 'puppet:///modules/apt/03clean' ] + } + } + + if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { + apt::sources_list { + 'backports': + content => "deb ${debian_url} ${::debian_codename}-backports ${apt::repos}", + } + if $include_src { + apt::sources_list { + 'backports-src': + content => "deb-src ${debian_url} ${::debian_codename}-backports ${apt::repos}", + } + } + } + + if $custom_key_dir { + file { "${apt_base_dir}/keys.d": + source => $custom_key_dir, + recurse => true, + owner => root, + group => root, + mode => '0755', + } + exec { 'custom_keys': + command => "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\;", + subscribe => File["${apt_base_dir}/keys.d"], + refreshonly => true, + notify => Exec[refresh_apt] + } + if $custom_preferences != false { + Exec['custom_keys'] { + before => File['apt_config'] + } + } + } + + exec { 'update_apt': + command => '/usr/bin/apt-get update', + require => [ File['/etc/apt/apt.conf.d', + '/etc/apt/preferences', + '/etc/apt/sources.list'] ], + refreshonly => true, + # Another Semaphor for all packages to reference + alias => [ 'apt_updated', 'refresh_apt'] + } +} diff --git a/manifests/init.pp b/manifests/init.pp index 196c0c7..26afaeb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,47 +20,13 @@ class apt ( $custom_key_dir = $apt::params::custom_key_dir, ) inherits apt::params { - package { 'apt': - ensure => installed, - require => undef, - } - - $sources_content = $custom_sources_list ? { - '' => template( "apt/${::operatingsystem}/sources.list.erb"), - default => $custom_sources_list - } - file { - # include main and security - # additional sources should be included via the apt::sources_list define - '/etc/apt/sources.list': - content => $sources_content, - notify => Exec['apt_updated'], - owner => root, - group => 0, - mode => '0644'; - } - - ::apt::apt_conf { '02show_upgraded': - source => [ "puppet:///modules/site_apt/${::fqdn}/02show_upgraded", - 'puppet:///modules/site_apt/02show_upgraded', - 'puppet:///modules/apt/02show_upgraded' ] - } + include apt::dot_d_directories + include apt::config + include apt::install - if ( $::virtual == 'vserver' ) { - ::apt::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'; - } - } - else { - ::apt::apt_conf { '03clean': - source => [ "puppet:///modules/site_apt/${::fqdn}/03clean", - 'puppet:///modules/site_apt/03clean', - 'puppet:///modules/apt/03clean' ] - } - } + include common::moduledir + common::module_dir { 'apt': } + $apt_base_dir = "${common::moduledir::module_dir_path}/apt" case $custom_preferences { false: { @@ -70,67 +36,4 @@ class apt ( include apt::preferences } } - - include apt::dot_d_directories - - ## This package should really always be current - package { 'debian-archive-keyring': - ensure => latest - } - - if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { - apt::sources_list { - 'backports': - content => "deb ${debian_url} ${::debian_codename}-backports ${apt::repos}", - } - if $include_src { - apt::sources_list { - 'backports-src': - content => "deb-src ${debian_url} ${::debian_codename}-backports ${apt::repos}", - } - } - } - - include common::moduledir - common::module_dir { 'apt': } - $apt_base_dir = "${common::moduledir::module_dir_path}/apt" - - if $custom_key_dir { - file { "${apt_base_dir}/keys.d": - source => $custom_key_dir, - recurse => true, - owner => root, - group => root, - mode => '0755', - } - exec { 'custom_keys': - command => "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\;", - subscribe => File["${apt_base_dir}/keys.d"], - refreshonly => true, - notify => Exec[refresh_apt] - } - if $custom_preferences != false { - Exec['custom_keys'] { - before => File['apt_config'] - } - } - } - - # workaround for preseeded_package component - file { - [ '/var/cache', - '/var/cache/local', - '/var/cache/local/preseeding' ]: - ensure => directory; - } - - exec { 'update_apt': - command => '/usr/bin/apt-get update', - require => [ File['/etc/apt/apt.conf.d', - '/etc/apt/preferences', - '/etc/apt/sources.list'] ], - refreshonly => true, - # Another Semaphor for all packages to reference - alias => [ 'apt_updated', 'refresh_apt'] - } } diff --git a/manifests/install.pp b/manifests/install.pp new file mode 100644 index 0000000..5f33d11 --- /dev/null +++ b/manifests/install.pp @@ -0,0 +1,11 @@ +class apt::install { + + package { 'apt': + ensure => present, + } + + # This package should really always be current + package { 'debian-archive-keyring': + ensure => latest; + } +} -- cgit v1.2.3 From bdd6cf421143914cc2c0c63fa543013892fd3bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 22:17:35 -0500 Subject: use the same name for the update_apt exec everywhere --- manifests/apt_conf.pp | 2 +- manifests/config.pp | 22 ++++++++++------------ manifests/dist_upgrade.pp | 2 +- manifests/dot_d_directories.pp | 5 +++-- manifests/key.pp | 2 +- manifests/key/plain.pp | 2 +- manifests/preferences_snippet.pp | 2 +- manifests/sources_list.pp | 2 +- manifests/upgrade_package.pp | 2 +- 9 files changed, 20 insertions(+), 21 deletions(-) (limited to 'manifests') diff --git a/manifests/apt_conf.pp b/manifests/apt_conf.pp index 709fd23..8225915 100644 --- a/manifests/apt_conf.pp +++ b/manifests/apt_conf.pp @@ -38,7 +38,7 @@ define apt::apt_conf ( if $refresh_apt { File["/etc/apt/apt.conf.d/${name}"] { - notify => Exec['apt_updated'], + notify => Exec['update_apt'], } } } diff --git a/manifests/config.pp b/manifests/config.pp index 3db84d7..416aabc 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,5 +1,13 @@ class apt::config inherits apt { + exec { 'update_apt': + command => '/usr/bin/apt-get update', + require => [ File['/etc/apt/apt.conf.d', + '/etc/apt/preferences', + '/etc/apt/sources.list'] ], + refreshonly => true; + } + $sources_content = $custom_sources_list ? { '' => template( "apt/${::operatingsystem}/sources.list.erb"), default => $custom_sources_list @@ -9,7 +17,7 @@ class apt::config inherits apt { # additional sources should be included via the apt::sources_list define '/etc/apt/sources.list': content => $sources_content, - notify => Exec['apt_updated'], + notify => Exec['update_apt'], owner => root, group => 0, mode => '0644'; @@ -70,7 +78,7 @@ class apt::config inherits apt { command => "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\;", subscribe => File["${apt_base_dir}/keys.d"], refreshonly => true, - notify => Exec[refresh_apt] + notify => Exec['update_apt']; } if $custom_preferences != false { Exec['custom_keys'] { @@ -78,14 +86,4 @@ class apt::config inherits apt { } } } - - exec { 'update_apt': - command => '/usr/bin/apt-get update', - require => [ File['/etc/apt/apt.conf.d', - '/etc/apt/preferences', - '/etc/apt/sources.list'] ], - refreshonly => true, - # Another Semaphor for all packages to reference - alias => [ 'apt_updated', 'refresh_apt'] - } } diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp index 3d9b29b..38ae417 100644 --- a/manifests/dist_upgrade.pp +++ b/manifests/dist_upgrade.pp @@ -6,6 +6,6 @@ class apt::dist_upgrade ( command => '/usr/bin/apt-get -q -y -o \'DPkg::Options::=--force-confold\' dist-upgrade', refreshonly => true, timeout => $timeout, - before => Exec['apt_updated'] + before => Exec['update_apt'] } } diff --git a/manifests/dot_d_directories.pp b/manifests/dot_d_directories.pp index 970cea0..6d9f790 100644 --- a/manifests/dot_d_directories.pp +++ b/manifests/dot_d_directories.pp @@ -6,10 +6,11 @@ class apt::dot_d_directories { '/etc/apt/apt.conf.d': ensure => directory, checksum => mtime, - notify => Exec['apt_updated']; + notify => Exec['update_apt']; + '/etc/apt/sources.list.d': ensure => directory, checksum => mtime, - notify => Exec['apt_updated']; + notify => Exec['update_apt']; } } diff --git a/manifests/key.pp b/manifests/key.pp index cb70ec6..6ec6523 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -8,6 +8,6 @@ define apt::key ($source, $ensure = 'present') { "/etc/apt/trusted.gpg.d/${name}": ensure => $ensure, source => $source, - notify => Exec['apt_updated'], + notify => Exec['update_apt'], } } diff --git a/manifests/key/plain.pp b/manifests/key/plain.pp index dff8b51..e845b88 100644 --- a/manifests/key/plain.pp +++ b/manifests/key/plain.pp @@ -8,6 +8,6 @@ define apt::key::plain ($source) { exec { "apt-key add '${apt::apt_base_dir}/keys/${name}'": subscribe => File["${apt::apt_base_dir}/keys/${name}"], refreshonly => true, - notify => Exec['apt_updated'], + notify => Exec['update_apt'], } } diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index e142ea0..eee1511 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -32,7 +32,7 @@ define apt::preferences_snippet ( file { "/etc/apt/preferences.d/${name}": ensure => $ensure, owner => root, group => 0, mode => '0644', - before => Exec['apt_updated']; + before => Exec['update_apt']; } case $source { diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 2fc7111..35a7643 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -27,7 +27,7 @@ define apt::sources_list ( mode => '0644', owner => 'root', group => 0, - notify => Exec['apt_updated'], + notify => Exec['update_apt'], } if $source { diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index f739f07..a96db7c 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -26,6 +26,6 @@ define apt::upgrade_package ( exec { "apt-get -q -y -o 'DPkg::Options::=--force-confold' install ${name}${version_suffix}": onlyif => [ "grep-status -F Status installed -a -P ${name} -q", "apt-show-versions -u ${name} | grep -q upgradeable" ], require => Package['apt-show-versions', 'dctrl-tools'], - before => Exec['apt_updated'] + before => Exec['update_apt'] } } -- cgit v1.2.3 From fd8b21222b969e779d10cb5d49e2e10f717b8358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 22:26:43 -0500 Subject: make sure every object ends with either a comma or a semicolon --- manifests/apticron.pp | 2 +- manifests/config.pp | 8 ++++---- manifests/cron/dist_upgrade.pp | 4 ++-- manifests/dist_upgrade.pp | 2 +- manifests/dselect.pp | 2 +- manifests/install.pp | 2 +- manifests/listchanges.pp | 2 +- manifests/preferences_snippet.pp | 6 +++--- manifests/preseeded_package.pp | 2 +- manifests/unattended_upgrades.pp | 4 ++-- manifests/update.pp | 2 +- manifests/upgrade_package.pp | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) (limited to 'manifests') diff --git a/manifests/apticron.pp b/manifests/apticron.pp index a8a24be..7dbbfb6 100644 --- a/manifests/apticron.pp +++ b/manifests/apticron.pp @@ -13,7 +13,7 @@ class apt::apticron ( ) { package { 'apticron': - ensure => $ensure_version + ensure => $ensure_version; } file { '/etc/apticron/apticron.conf': diff --git a/manifests/config.pp b/manifests/config.pp index 416aabc..4c5c5d3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -10,7 +10,7 @@ class apt::config inherits apt { $sources_content = $custom_sources_list ? { '' => template( "apt/${::operatingsystem}/sources.list.erb"), - default => $custom_sources_list + default => $custom_sources_list; } file { # include main and security @@ -34,7 +34,7 @@ class apt::config inherits apt { ::apt::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/apt/02show_upgraded' ]; } if ( $::virtual == 'vserver' ) { @@ -49,7 +49,7 @@ class apt::config inherits apt { ::apt::apt_conf { '03clean': source => [ "puppet:///modules/site_apt/${::fqdn}/03clean", 'puppet:///modules/site_apt/03clean', - 'puppet:///modules/apt/03clean' ] + 'puppet:///modules/apt/03clean' ]; } } @@ -82,7 +82,7 @@ class apt::config inherits apt { } if $custom_preferences != false { Exec['custom_keys'] { - before => File['apt_config'] + before => File['apt_config']; } } } diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index 2a46331..39db07a 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -3,7 +3,7 @@ class apt::cron::dist_upgrade ( ) { package { 'cron-apt': - ensure => installed + ensure => installed; } case $cron_hours { @@ -30,7 +30,7 @@ dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-conf } package { 'apt-listbugs': - ensure => absent + ensure => absent; } file { '/etc/cron-apt/action.d/4-dist-upgrade': diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp index 38ae417..eb3207c 100644 --- a/manifests/dist_upgrade.pp +++ b/manifests/dist_upgrade.pp @@ -6,6 +6,6 @@ class apt::dist_upgrade ( command => '/usr/bin/apt-get -q -y -o \'DPkg::Options::=--force-confold\' dist-upgrade', refreshonly => true, timeout => $timeout, - before => Exec['update_apt'] + before => Exec['update_apt']; } } diff --git a/manifests/dselect.pp b/manifests/dselect.pp index 2e6e90b..beee9ee 100644 --- a/manifests/dselect.pp +++ b/manifests/dselect.pp @@ -9,6 +9,6 @@ class apt::dselect { } package { 'dselect': - ensure => installed + ensure => installed; } } diff --git a/manifests/install.pp b/manifests/install.pp index 5f33d11..76eb570 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,7 +1,7 @@ class apt::install { package { 'apt': - ensure => present, + ensure => present; } # This package should really always be current diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index 642986b..e2b77be 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -9,7 +9,7 @@ class apt::listchanges ( ){ package { 'apt-listchanges': - ensure => $ensure_version + ensure => $ensure_version; } file { '/etc/apt/listchanges.conf': diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index eee1511..1462dbe 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -40,19 +40,19 @@ define apt::preferences_snippet ( case $release { undef: { File["/etc/apt/preferences.d/${name}"]{ - content => template('apt/preferences_snippet.erb') + content => template('apt/preferences_snippet.erb'); } } default: { File["/etc/apt/preferences.d/${name}"]{ - content => template('apt/preferences_snippet_release.erb') + content => template('apt/preferences_snippet_release.erb'); } } } } default: { File["/etc/apt/preferences.d/${name}"]{ - source => $source + source => $source; } } } diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 5a2979f..3c69f9b 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -8,7 +8,7 @@ define apt::preseeded_package ( $seedfile = "/var/cache/local/preseeding/${name}.seeds" $real_content = $content ? { '' => template ( "site_apt/${::debian_codename}/${name}.seeds" ), - default => $content + default => $content; } file { $seedfile: diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 85d21d4..4067044 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -23,12 +23,12 @@ class apt::unattended_upgrades ( $file_content = $config_content ? { undef => template($config_template), - default => $config_content + default => $config_content; } ::apt::apt_conf { '50unattended-upgrades': content => $file_content, require => Package['unattended-upgrades'], - refresh_apt => false + refresh_apt => false; } } diff --git a/manifests/update.pp b/manifests/update.pp index d5fd539..4cb4e5f 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -1,6 +1,6 @@ class apt::update inherits ::apt { Exec['update_apt'] { - refreshonly => false + refreshonly => false; } } diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index a96db7c..079fc3b 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -26,6 +26,6 @@ define apt::upgrade_package ( exec { "apt-get -q -y -o 'DPkg::Options::=--force-confold' install ${name}${version_suffix}": onlyif => [ "grep-status -F Status installed -a -P ${name} -q", "apt-show-versions -u ${name} | grep -q upgradeable" ], require => Package['apt-show-versions', 'dctrl-tools'], - before => Exec['update_apt'] + before => Exec['update_apt']; } } -- cgit v1.2.3 From 2cf97fbf458522e9da6a3ed21e3105d1f488d111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 22:41:20 -0500 Subject: mark packages as present instead of installed to be consistent --- manifests/apticron.pp | 2 +- manifests/cron/dist_upgrade.pp | 2 +- manifests/dselect.pp | 2 +- manifests/listchanges.pp | 2 +- manifests/preseeded_package.pp | 2 +- manifests/upgrade_package.pp | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/apticron.pp b/manifests/apticron.pp index 7dbbfb6..0adcc68 100644 --- a/manifests/apticron.pp +++ b/manifests/apticron.pp @@ -1,5 +1,5 @@ class apt::apticron ( - $ensure_version = 'installed', + $ensure_version = 'present', $config = "apt/${::operatingsystem}/apticron.erb", $email = 'root', $diff_only = '1', diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index 39db07a..7cd3964 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -3,7 +3,7 @@ class apt::cron::dist_upgrade ( ) { package { 'cron-apt': - ensure => installed; + ensure => present; } case $cron_hours { diff --git a/manifests/dselect.pp b/manifests/dselect.pp index beee9ee..bfc6cb3 100644 --- a/manifests/dselect.pp +++ b/manifests/dselect.pp @@ -9,6 +9,6 @@ class apt::dselect { } package { 'dselect': - ensure => installed; + ensure => present; } } diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index e2b77be..d657812 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -1,5 +1,5 @@ class apt::listchanges ( - $ensure_version = 'installed', + $ensure_version = 'present', $config = "apt/${::operatingsystem}/listchanges.erb", $frontend = 'mail', $email = 'root', diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 3c69f9b..7e092fd 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -1,7 +1,7 @@ # Install a package with a preseed file to automatically answer some questions. define apt::preseeded_package ( - $ensure = 'installed', + $ensure = 'present', $content = '', ) { diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index 079fc3b..3ba2077 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -13,13 +13,13 @@ define apt::upgrade_package ( if !defined(Package['apt-show-versions']) { package { 'apt-show-versions': - ensure => installed, + ensure => present, } } if !defined(Package['dctrl-tools']) { package { 'dctrl-tools': - ensure => installed, + ensure => present, } } -- cgit v1.2.3 From 7d52ff7414ff887c3e2128e3e05df936db9ab4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 22:44:17 -0500 Subject: use double quotes not to have to escape single ones --- manifests/preferences_snippet.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 1462dbe..3044638 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -18,14 +18,14 @@ define apt::preferences_snippet ( } if $priority == undef { - fail('apt::preferences_snippet requires the \'priority\' argument to be set') + fail("apt::preferences_snippet requires the 'priority' argument to be set") } if !$pin and !$release { - fail('apt::preferences_snippet requires one of the \'pin\' or \'release\' argument to be set') + fail("apt::preferences_snippet requires one of the 'pin' or 'release' argument to be set") } if $pin and $release { - fail('apt::preferences_snippet requires either a \'pin\' or \'release\' argument, not both') + fail("apt::preferences_snippet requires either a 'pin' or 'release' argument, not both") } } -- cgit v1.2.3 From 247b3b2c2a269dcd584b25f6b67fe9282befbbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 22:58:18 -0500 Subject: fix errors by replacing some semicolons by commas --- manifests/config.pp | 4 ++-- manifests/preferences_snippet.pp | 6 +++--- manifests/unattended_upgrades.pp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 4c5c5d3..881a091 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -10,7 +10,7 @@ class apt::config inherits apt { $sources_content = $custom_sources_list ? { '' => template( "apt/${::operatingsystem}/sources.list.erb"), - default => $custom_sources_list; + default => $custom_sources_list, } file { # include main and security @@ -82,7 +82,7 @@ class apt::config inherits apt { } if $custom_preferences != false { Exec['custom_keys'] { - before => File['apt_config']; + before => File['apt_config'], } } } diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 3044638..8905318 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -40,19 +40,19 @@ define apt::preferences_snippet ( case $release { undef: { File["/etc/apt/preferences.d/${name}"]{ - content => template('apt/preferences_snippet.erb'); + content => template('apt/preferences_snippet.erb'), } } default: { File["/etc/apt/preferences.d/${name}"]{ - content => template('apt/preferences_snippet_release.erb'); + content => template('apt/preferences_snippet_release.erb'), } } } } default: { File["/etc/apt/preferences.d/${name}"]{ - source => $source; + source => $source, } } } diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 4067044..c6db396 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -23,7 +23,7 @@ class apt::unattended_upgrades ( $file_content = $config_content ? { undef => template($config_template), - default => $config_content; + default => $config_content, } ::apt::apt_conf { '50unattended-upgrades': -- cgit v1.2.3 From 350342c86e81e02caaf433ba0b84dbf5d8afc781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Thu, 22 Dec 2016 23:02:16 -0500 Subject: missing single quotes --- manifests/cron/dist_upgrade.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index 7cd3964..d0d9a98 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -38,7 +38,7 @@ dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-conf owner => root, group => 0, mode => '0644', - require => Package[cron-apt]; + require => Package['cron-apt']; } file { '/etc/cron-apt/config.d/MAILON': @@ -46,6 +46,6 @@ dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-conf owner => root, group => 0, mode => '0644', - require => Package[cron-apt]; + require => Package['cron-apt']; } } -- cgit v1.2.3 From c72ceac8b339a159db6819455ed47ebb295519ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Fri, 30 Dec 2016 01:48:41 -0500 Subject: more ; to , --- manifests/preseeded_package.pp | 2 +- manifests/update.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 7e092fd..29a981e 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -8,7 +8,7 @@ define apt::preseeded_package ( $seedfile = "/var/cache/local/preseeding/${name}.seeds" $real_content = $content ? { '' => template ( "site_apt/${::debian_codename}/${name}.seeds" ), - default => $content; + default => $content, } file { $seedfile: diff --git a/manifests/update.pp b/manifests/update.pp index 4cb4e5f..72cedc2 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -1,6 +1,6 @@ class apt::update inherits ::apt { Exec['update_apt'] { - refreshonly => false; + refreshonly => false, } } -- cgit v1.2.3 From a7fcc79268052f2090fa09e97a1ac9189daf62a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Sat, 21 Jan 2017 15:59:03 -0500 Subject: fully qualify variables to remove inherits --- manifests/config.pp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 881a091..7705551 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,4 +1,4 @@ -class apt::config inherits apt { +class apt::config { exec { 'update_apt': command => '/usr/bin/apt-get update', @@ -10,7 +10,7 @@ class apt::config inherits apt { $sources_content = $custom_sources_list ? { '' => template( "apt/${::operatingsystem}/sources.list.erb"), - default => $custom_sources_list, + default => $apt::custom_sources_list, } file { # include main and security @@ -53,34 +53,34 @@ class apt::config inherits apt { } } - if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { + if ($apt::use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { apt::sources_list { 'backports': - content => "deb ${debian_url} ${::debian_codename}-backports ${apt::repos}", + content => "deb ${apt::debian_url} ${::debian_codename}-backports ${apt::repos}", } if $include_src { apt::sources_list { 'backports-src': - content => "deb-src ${debian_url} ${::debian_codename}-backports ${apt::repos}", + content => "deb-src ${apt::debian_url} ${::debian_codename}-backports ${apt::repos}", } } } - if $custom_key_dir { - file { "${apt_base_dir}/keys.d": - source => $custom_key_dir, + if $apt::custom_key_dir { + file { "${apt::apt_base_dir}/keys.d": + source => $apt::custom_key_dir, recurse => true, owner => root, group => root, mode => '0755', } exec { 'custom_keys': - command => "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\;", - subscribe => File["${apt_base_dir}/keys.d"], + command => "find ${apt::apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\;", + subscribe => File["${apt::apt_base_dir}/keys.d"], refreshonly => true, notify => Exec['update_apt']; } - if $custom_preferences != false { + if $apt::custom_preferences != false { Exec['custom_keys'] { before => File['apt_config'], } -- cgit v1.2.3 From 83dd6b478f2799b0d515b577d10c14f24e1f8b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Sat, 21 Jan 2017 16:12:18 -0500 Subject: missed a few variables - fully qualify them --- manifests/config.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 7705551..4b984c7 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -8,7 +8,7 @@ class apt::config { refreshonly => true; } - $sources_content = $custom_sources_list ? { + $sources_content = $apt::custom_sources_list ? { '' => template( "apt/${::operatingsystem}/sources.list.erb"), default => $apt::custom_sources_list, } @@ -58,7 +58,7 @@ class apt::config { 'backports': content => "deb ${apt::debian_url} ${::debian_codename}-backports ${apt::repos}", } - if $include_src { + if $apt::include_src { apt::sources_list { 'backports-src': content => "deb-src ${apt::debian_url} ${::debian_codename}-backports ${apt::repos}", -- cgit v1.2.3 From 904be827acc3cc377123544eaf401f26eb984495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Sat, 21 Jan 2017 16:15:06 -0500 Subject: minor style fixes to comply with CI warnings --- manifests/config.pp | 2 +- manifests/cron/dist_upgrade.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 4b984c7..542fc1f 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -42,7 +42,7 @@ class apt::config { source => [ "puppet:///modules/site_apt/${::fqdn}/03clean_vserver", 'puppet:///modules/site_apt/03clean_vserver', 'puppet:///modules/apt/03clean_vserver' ], - alias => '03clean'; + alias => '03clean'; } } else { diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index d0d9a98..db36544 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -14,7 +14,7 @@ class apt::cron::dist_upgrade ( cron { 'apt_cron_every_N_hours': command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt', user => root, - hour => "${cron_hours}", + hour => $cron_hours, minute => 10, require => Package['cron-apt'], } -- cgit v1.2.3