puppet-prod/site/profiles/templates/base/motd/motd.erb
Ben Vincent 0cc0bacad3 feat: add motd and facts
- use parameters created by the enc to create external facts
- use external facts to generate the motd
- use features from unkinben/puppet-enc#22
2023-11-04 20:11:20 +11:00

14 lines
488 B
Plaintext

<%
# calculate padding for the longest word
max_length = ['fqdn:', 'os:', 'role:', 'branch:', 'addr:', 'nic:'].max_by(&:length).length
# helper lambda to right-align text
align = ->(word) { word.ljust(max_length) }
%>
<%= align.call('fqdn:') %> <%= @fqdn %>
<%= align.call('os:') %> <%= @os_name %> <%= @os_release %>
<%= align.call('role:') %> <%= @clean_role %>
<%= align.call('branch:') %> <%= @enc_env %>
<%= align.call('addr:') %> <%= @addr %>
<%= align.call('nic:') %> <%= @nic %>