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,29 @@
|
||||
# a class to define some global facts
|
||||
class profiles::base::facts {
|
||||
|
||||
# The path where external facts are stored
|
||||
$facts_d_path = '/opt/puppetlabs/facter/facts.d'
|
||||
|
||||
# Ensure the directory exists
|
||||
file { $facts_d_path:
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
# facts to create
|
||||
$fact_list = [ 'enc_role', 'enc_env' ]
|
||||
|
||||
# Manage the external fact file with content from the template
|
||||
$fact_list.each | String $item | {
|
||||
file { "${facts_d_path}/${item}.txt":
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template("profiles/base/facts/${item}.erb"),
|
||||
require => File[$facts_d_path],
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user