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 <jorge.saffe@windriver.com>
Change-Id: I97b7e140baf837aecd961d7ea8fc5947fcae2106
This commit is contained in:
Jorge Saffe 2023-09-27 12:31:17 -04:00
parent fbadea9885
commit 7bd9b54388
2 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,9 @@
<%
if !@system_name.nil? && !@system_name.empty?
-%>
<%= "====================================================================" %>
<%= " SYSTEM: #{@system_name}" %>
<%= "====================================================================" %>
<% end -%>