From 39917fb4dbe21b1673ceabaa1d61180cca9f493b Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 21:31:15 -0300 Subject: new style for 2.7 --- manifests/listchanges.pp | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) (limited to 'manifests/listchanges.pp') diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index 038d5c9..236b629 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -1,37 +1,16 @@ -class apt::listchanges { - - case $apt_listchanges_version { - '': { $apt_listchanges_version = "present" } - } - - case $apt_listchanges_config { - '': { $apt_listchanges_config = "apt/${operatingsystem}/listchanges_${lsbdistcodename}.erb" } - } - - case $apt_listchanges_frontend { - '': { $apt_listchanges_frontend = "mail" } - } - - case $apt_listchanges_email { - '': { $apt_listchanges_email = "root" } - } - - case $apt_listchanges_confirm { - '': { $apt_listchanges_confirm = "0" } - } - - case $apt_listchanges_saveseen { - '': { $apt_listchanges_saveseen = "/var/lib/apt/listchanges.db" } - } - - case $apt_listchanges_which { - '': { $apt_listchanges_which = "both" } - } - - package { apt-listchanges: ensure => $apt_listchanges_ensure_version } +class apt::listchanges( + $ensure_version = hiera('apt_listchanges_version','installed'), + $config = hiera('apt_listchanges_config', "apt/${::operatingsystem}/listchanges_${::lsbdistcodename}.erb"), + $frontend = hiera('apt_listchanges_frontend','mail'), + $email = hiera('apt_listchanges_email','root'), + $confirm = hiera('apt_listchanges_confirm','0'), + $saveseen = hiera('pt_listchanges_saveseen','/var/lib/apt/listchanges.db'), + $which = hiera('apt_listchanges_which','both') +){ + package { apt-listchanges: ensure => $ensure_version } file { "/etc/apt/listchanges.conf": - content => template($apt_listchanges_config), + content => template($apt::listchanges::config), mode => 0644, owner => root, group => root, require => Package["apt-listchanges"]; } -- cgit v1.2.3 From 0e016e968da85a435f1670761bad458aa515c7a5 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 14 Jun 2012 10:07:29 -0300 Subject: migrate away from hiera stuff --- manifests/apticron.pp | 22 +++++++++++----------- manifests/init.pp | 22 +++++++++++----------- manifests/listchanges.pp | 14 +++++++------- 3 files changed, 29 insertions(+), 29 deletions(-) (limited to 'manifests/listchanges.pp') diff --git a/manifests/apticron.pp b/manifests/apticron.pp index c578311..ebdd5b5 100644 --- a/manifests/apticron.pp +++ b/manifests/apticron.pp @@ -1,15 +1,15 @@ class apt::apticron( - $ensure_version = hiera('apticron_ensure_version','installed'), - $config = hiera('apticron_config',"apt/${::operatingsystem}/apticron_${::lsbdistcodename}.erb"), - $email = hiera('apticron_email', 'root'), - $diff_only = hiera('apticron_diff_only', '1'), - $listchanges_profile = hiera('apticron_listchanges_profile','apticron'), - $system = hiera('apticron_system',false), - $ipaddressnum = hiera('apticron_ipaddressnum',false), - $ipaddresses = hiera('apticron_ipaddresses', false), - $notifyholds = hiera('apticron_notifyholds', '0'), - $notifynew = hiera('apticron_notifynew', '0'), - $customsubject = hiera('apticron_customsubject','') + $ensure_version = 'installed', + $config = "apt/${::operatingsystem}/apticron_${::lsbdistcodename}.erb", + $email = 'root', + $diff_only = '1', + $listchanges_profile = 'apticron', + $system = false, + $ipaddressnum = false, + $ipaddresses = false, + $notifyholds = '0', + $notifynew = '0', + $customsubject = '' ) { package { apticron: ensure => $ensure_version } diff --git a/manifests/init.pp b/manifests/init.pp index a015fc9..e35dd2c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,17 +4,17 @@ # See LICENSE for the full license granted to you. class apt( - $use_volatile = hiera('apt_volatile_enabled',false), - $include_src = hiera('apt_include_src',false), - $use_next_release = hiera('apt_use_next_release',false), - $debian_url = hiera('apt_debian_url','http://cdn.debian.net/debian/'), - $security_url = hiera('apt_security_url','http://security.debian.org/'), - $backports_url = hiera('apt_backports_url','http://backports.debian.org/debian-backports/'), - $volatile_url = hiera('apt_volatile_url', 'http://volatile.debian.org/debian-volatile/'), - $ubuntu_url = hiera('apt_ubuntu_url', 'http://archive.ubuntu.com/ubuntu'), - $repos = hiera('apt_repos','auto'), - $custom_preferences = hiera('apt_custom_preferences','') -) { + $use_volatile = false, + $include_src = false, + $use_next_release = false, + $debian_url = 'http://cdn.debian.net/debian/', + $security_url = 'http://security.debian.org/', + $backports_url = 'http://backports.debian.org/debian-backports/', + $volatile_url = 'http://volatile.debian.org/debian-volatile/', + $ubuntu_url = 'http://archive.ubuntu.com/ubuntu', + $repos = 'auto', + $custom_preferences = '' +){ case $::operatingsystem { 'debian': { $real_repos = $repos ? { diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index 236b629..4194463 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -1,11 +1,11 @@ class apt::listchanges( - $ensure_version = hiera('apt_listchanges_version','installed'), - $config = hiera('apt_listchanges_config', "apt/${::operatingsystem}/listchanges_${::lsbdistcodename}.erb"), - $frontend = hiera('apt_listchanges_frontend','mail'), - $email = hiera('apt_listchanges_email','root'), - $confirm = hiera('apt_listchanges_confirm','0'), - $saveseen = hiera('pt_listchanges_saveseen','/var/lib/apt/listchanges.db'), - $which = hiera('apt_listchanges_which','both') + $ensure_version = 'installed', + $config = "apt/${::operatingsystem}/listchanges_${::lsbdistcodename}.erb", + $frontend = 'mail', + $email = 'root', + $confirm = '0', + $saveseen = '/var/lib/apt/listchanges.db', + $which = 'both' ){ package { apt-listchanges: ensure => $ensure_version } -- cgit v1.2.3