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,20 @@
|
||||
# set the motd
|
||||
class profiles::base::motd (
|
||||
String $enc_role = pick($facts['enc_role'], 'undefined'),
|
||||
String $enc_env = pick($facts['enc_env'], 'undefined'),
|
||||
String $fqdn = $facts['networking']['fqdn'],
|
||||
String $addr = $facts['networking']['ip'],
|
||||
String $nic = $facts['networking']['primary'],
|
||||
String $os_name = $facts['os']['name'],
|
||||
String $os_release = $facts['os']['release']['full'],
|
||||
) {
|
||||
|
||||
# Use the regsubst function to remove the 'roles::' prefix from the role name
|
||||
$clean_role = regsubst($enc_role, '^roles::', '')
|
||||
|
||||
# Manage the content of the /etc/motd file
|
||||
file { '/etc/motd':
|
||||
ensure => file,
|
||||
content => template('profiles/base/motd/motd.erb'),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user