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
This commit is contained in:
@@ -0,0 +1 @@
|
||||
enc_env=<%= @enc_env %>
|
||||
@@ -0,0 +1 @@
|
||||
enc_role=<%= @enc_role[0] %>
|
||||
@@ -0,0 +1,13 @@
|
||||
<%
|
||||
# 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 %>
|
||||
|
||||
Reference in New Issue
Block a user