2026-01-16 17:17:19 +01:00
|
|
|
## confdroid_puppet::main::files.pp
|
|
|
|
|
# Module name: confdroid_puppet
|
2025-02-26 01:55:17 +01:00
|
|
|
# Author: Arne Teuke (arne_teuke@confdroid)
|
2026-01-16 17:17:19 +01:00
|
|
|
# @summary Class manages config files for the confdroid_puppet module.
|
2025-02-26 01:55:17 +01:00
|
|
|
###############################################################################
|
2026-01-16 17:17:19 +01:00
|
|
|
class confdroid_puppet::main::files (
|
2025-02-26 01:55:17 +01:00
|
|
|
|
2026-01-16 17:17:19 +01:00
|
|
|
) inherits confdroid_puppet::params {
|
|
|
|
|
require confdroid_puppet::main::dirs
|
2025-02-26 21:13:33 +01:00
|
|
|
|
|
|
|
|
if $fqdn != $pt_pm_fqdn {
|
|
|
|
|
file { $pt_puppet_conf_file:
|
2025-11-02 14:39:12 +01:00
|
|
|
ensure => file,
|
|
|
|
|
path => $pt_puppet_conf_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => puppet_etc_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($pt_puppet_conf_erb),
|
|
|
|
|
notify => Service[$pt_agent_service],
|
2025-02-26 21:13:33 +01:00
|
|
|
}
|
2025-10-30 15:20:37 +01:00
|
|
|
if $pt_use_puppetdb == true {
|
|
|
|
|
file { $pt_node_rb_file:
|
|
|
|
|
ensure => file,
|
2025-10-30 15:31:52 +01:00
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
2025-10-30 15:20:37 +01:00
|
|
|
mode => '0550',
|
|
|
|
|
selrole => object_r,
|
2025-10-30 16:14:11 +01:00
|
|
|
seltype => puppet_etc_t,
|
2025-10-30 15:20:37 +01:00
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($pt_node_rb_erb),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if $pt_use_puppetdb != true {
|
|
|
|
|
file { $pt_node_rb_file:
|
2025-11-26 19:23:00 +01:00
|
|
|
ensure => absent,
|
2025-10-30 15:20:37 +01:00
|
|
|
}
|
|
|
|
|
}
|
2025-02-26 21:13:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if $fqdn == $pt_pm_fqdn {
|
|
|
|
|
file { $pt_puppet_conf_file:
|
2025-11-02 14:39:12 +01:00
|
|
|
ensure => file,
|
|
|
|
|
path => $pt_puppet_conf_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => puppet_etc_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($pt_puppet_conf_erb),
|
|
|
|
|
notify => Service[$pt_agent_service,$pt_server_service],
|
2025-02-26 21:13:33 +01:00
|
|
|
}
|
2025-10-27 23:05:15 +01:00
|
|
|
|
2025-10-28 00:43:39 +01:00
|
|
|
if $pt_use_puppetdb == true {
|
2025-10-28 13:02:21 +01:00
|
|
|
# puppetdb
|
2025-10-28 00:43:39 +01:00
|
|
|
file { $pt_puppetdb_conf_file:
|
2025-11-02 14:39:12 +01:00
|
|
|
ensure => file,
|
|
|
|
|
path => $pt_puppetdb_conf_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => puppet_etc_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($pt_puppetdb_conf_erb),
|
|
|
|
|
notify => Service[$pt_agent_service,$pt_server_service],
|
2025-10-28 00:43:39 +01:00
|
|
|
}
|
2025-10-28 12:38:10 +01:00
|
|
|
# routes.yaml
|
|
|
|
|
file { $pt_routes_file:
|
2025-11-02 14:39:12 +01:00
|
|
|
ensure => file,
|
|
|
|
|
path => $pt_routes_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => puppet_etc_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($pt_routes_erb),
|
|
|
|
|
notify => Service[$pt_server_service],
|
2025-10-28 12:38:10 +01:00
|
|
|
}
|
2025-10-30 15:20:37 +01:00
|
|
|
file { $pt_node_rb_file:
|
2025-11-02 14:39:12 +01:00
|
|
|
ensure => file,
|
|
|
|
|
owner => 'puppet',
|
|
|
|
|
group => 'puppet',
|
|
|
|
|
mode => '0550',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => foreman_enc_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($pt_node_rb_erb),
|
2025-10-30 15:20:37 +01:00
|
|
|
}
|
2025-10-28 00:43:39 +01:00
|
|
|
}
|
2025-10-28 13:02:21 +01:00
|
|
|
if $pt_use_puppetdb != true {
|
|
|
|
|
file { $pt_puppetdb_conf_file:
|
2025-11-26 19:23:00 +01:00
|
|
|
ensure => absent,
|
2025-10-28 13:02:21 +01:00
|
|
|
}
|
|
|
|
|
file { $pt_routes_file:
|
2025-11-26 19:23:00 +01:00
|
|
|
ensure => absent,
|
2025-10-28 13:02:21 +01:00
|
|
|
}
|
|
|
|
|
}
|
2025-02-26 21:13:33 +01:00
|
|
|
}
|
2025-02-26 01:55:17 +01:00
|
|
|
}
|