Skip to content
Snippets Groups Projects
Commit 95de4bda authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

added allow anacron install parameter to base::cron

parent 0c0f93a5
No related branches found
No related tags found
No related merge requests found
UNRELEASED (2015-03-??)
[cron] Add parameter to base::cron to allow anacron package to be
installed (helpful for Ubuntu systems with ubuntu-desktop
package). (adamhl)
release/004.033 (2015-03-13) release/004.033 (2015-03-13)
Modify the base::ssh::config::sshd define to allow the Modify the base::ssh::config::sshd define to allow the
specificaton of content or source. This is required to support specification of content or source. This is required to support
host with special ssh requiremens like systems that use duo. (whm) host with special ssh requirements like systems that use duo. (whm)
Fix a missed hyphen in reference to class fragment-template in Fix a missed hyphen in reference to class fragment-template in
defense.pp. (adamhl) defense.pp. (adamhl)
......
...@@ -2,20 +2,35 @@ ...@@ -2,20 +2,35 @@
# be close to calendar days. Also remove anacron, since we don't use it on # be close to calendar days. Also remove anacron, since we don't use it on
# servers. # servers.
class base::cron { # allow_install_anacron: if you want to allow the anacron package to be
package { 'anacron': ensure => absent } # installed along with cron, set the parameter to true. This is useful,
# e.g., for Ubuntu as the ubuntu-desktop package depends on anacron.
#
# Note: setting this to true does not install the anacron package, rather
# it simply allows it to be installed.
#
# Default: false.
#
class base::cron(
$allow_install_anacron = false
) {
if (!$allow_install_anacron) {
package { 'anacron': ensure => absent }
}
if ($::osfamily == 'Debian') { if ($::osfamily == 'Debian') {
$crond = 'cron' $crond = 'cron'
} }
elsif ($::osfamily == 'RedHat') { elsif ($::osfamily == 'RedHat') {
$crond = 'crond' $crond = 'crond'
if ($::lsbmajdistrelease == '6') { if ($::lsbmajdistrelease == '6') {
package { package {
'cronie-noanacron': ensure => present; 'cronie-noanacron': ensure => present;
'cronie-anacron': ensure => absent; 'cronie-anacron': ensure => absent;
} }
} }
file { [ '/etc/cron.d/dailyjobs', '/etc/cron.d/0hourly' ]: file { [ '/etc/cron.d/dailyjobs', '/etc/cron.d/0hourly' ]:
ensure => absent ensure => absent
...@@ -29,7 +44,7 @@ class base::cron { ...@@ -29,7 +44,7 @@ class base::cron {
ensure => running, ensure => running,
enable => true, enable => true,
} }
file { '/etc/crontab': file { '/etc/crontab':
content => template('base/cron/crontab.erb'), content => template('base/cron/crontab.erb'),
notify => Service[$crond], notify => Service[$crond],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment