From 7bd9b543885631906ebf58133b576fd4e56f070e Mon Sep 17 00:00:00 2001 From: Jorge Saffe Date: Wed, 27 Sep 2023 12:31:17 -0400 Subject: [PATCH] Fix MOTD not include system ID on controller-1 The Message of the Day (MOTD) is assembled from several sources, including: /etc/motd.head; /etc/sysinv/motd.system; /etc/platform/motd.license; and /etc/motd.tail. In the event that /etc/sysinv/motd.system is missing, the MOTD will simply exclude the system name. During the bootstrap process of controller-0, the motd.system file is generated utilizing the predefined system name. However, this is not the case during the bootstrap process of controller-1, where the file remains ungenerated. The proposed solution initialize the motd.system file using a puppet template during controller-1 unlocking step. Test Plan: - PASS: Fresh Install DX Env - PASS: Verify MOTD message on controller-0. - PASS: Verify MOTD message on controller-1. - PASS: Fresh Install STD Env - PASS: Verify MOTD message on controller-0. - PASS: Verify MOTD message on controller-1. Closes-bug: 2037551 Signed-off-by: Jorge Saffe Change-Id: I97b7e140baf837aecd961d7ea8fc5947fcae2106 --- .../src/modules/platform/manifests/config.pp | 13 +++++++++++++ .../src/modules/platform/templates/system_name.erb | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 puppet-manifests/src/modules/platform/templates/system_name.erb diff --git a/puppet-manifests/src/modules/platform/manifests/config.pp b/puppet-manifests/src/modules/platform/manifests/config.pp index 7c4bd2875..2a1186079 100644 --- a/puppet-manifests/src/modules/platform/manifests/config.pp +++ b/puppet-manifests/src/modules/platform/manifests/config.pp @@ -15,6 +15,7 @@ class platform::config include ::platform::params include ::platform::anchors include ::platform::config::pam_systemd + include ::platform::config::system_name stage { 'pre': before => Stage['main'], @@ -257,6 +258,18 @@ class platform::config::hostname { } } +class platform::config::system_name { + $system_name = $platform::params::system_name + + file { '/etc/sysinv/motd.system': + ensure => present, + owner => 'root', + group => 'root', + mode => '0644', + content => template('platform/system_name.erb'), + } +} + class platform::config::apparmor { include ::platform::params diff --git a/puppet-manifests/src/modules/platform/templates/system_name.erb b/puppet-manifests/src/modules/platform/templates/system_name.erb new file mode 100644 index 000000000..4d26ae9f8 --- /dev/null +++ b/puppet-manifests/src/modules/platform/templates/system_name.erb @@ -0,0 +1,9 @@ +<% +if !@system_name.nil? && !@system_name.empty? +-%> + +<%= "====================================================================" %> +<%= " SYSTEM: #{@system_name}" %> +<%= "====================================================================" %> + +<% end -%>