feat: change enc_* fact to read direct from cobbler

- change enc_role and enc_env to read direct from cobbler
- cleanup profiles::base::facts
This commit is contained in:
2025-03-12 22:29:26 +11:00
parent b981a6fb01
commit 0a9b4ecbd2
10 changed files with 80 additions and 73 deletions
-39
View File
@@ -1,39 +0,0 @@
# 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',
}
# cleanup old facts files
$fact_list = [ 'enc_role', 'enc_env' ]
$fact_list.each | String $item | {
file { "${facts_d_path}/${item}.txt":
ensure => absent,
}
}
# ensure the path to the custom store exists
file { '/root/.cache':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0750',
}
# create the file that will be read
file { '/root/.cache/custom_facts.yaml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => template('profiles/base/facts/custom_facts.yaml.erb'),
}
}