From 65d2e855a0fb96d1ae0dd12e397c0f4a4e68200e Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 30 Jan 2024 23:23:02 -0500 Subject: [PATCH] puppet: Switch removal of MOTD directories for .hushlogin. Rather than have to keep resolving apt conflicts with the lack of `/etc/update-motd.d`, have each user disable the motds with a `.hushlogin` file. --- puppet/zulip_ops/manifests/profile/base.pp | 9 --------- puppet/zulip_ops/manifests/user_dotfiles.pp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/puppet/zulip_ops/manifests/profile/base.pp b/puppet/zulip_ops/manifests/profile/base.pp index 6d187c6841..b612b07779 100644 --- a/puppet/zulip_ops/manifests/profile/base.pp +++ b/puppet/zulip_ops/manifests/profile/base.pp @@ -65,15 +65,6 @@ class zulip_ops::profile::base { zulip_ops::user_dotfiles { 'zulip': } - # Clear /etc/update-motd.d, to fix load problems with Nagios - # caused by Ubuntu's default MOTD tools for things like "checking - # for the next release" being super slow. - file { '/etc/update-motd.d': - ensure => directory, - recurse => true, - purge => true, - } - file { '/etc/pam.d/common-session': ensure => file, require => Package['openssh-server'], diff --git a/puppet/zulip_ops/manifests/user_dotfiles.pp b/puppet/zulip_ops/manifests/user_dotfiles.pp index 8528ff9907..ac4ade41e8 100644 --- a/puppet/zulip_ops/manifests/user_dotfiles.pp +++ b/puppet/zulip_ops/manifests/user_dotfiles.pp @@ -25,4 +25,16 @@ define zulip_ops::user_dotfiles ( mode => '0644', source => 'puppet:///modules/zulip_ops/dotfiles/emacs.el', } + + # Suppress MOTD printing, to fix load problems with Nagios caused by + # Ubuntu's default MOTD tools for things like "checking for the next + # release" being super slow. + file { "${homedir}/.hushlogin": + ensure => file, + require => User[$user], + owner => $user, + group => $user, + mode => '0644', + content => '', + } }