Files
confdroid_alloy/manifests/main/files.pp

75 lines
2.0 KiB
ObjectPascal
Raw Normal View History

2026-07-21 13:25:48 +02:00
## confdroid_alloy::main::files.pp
# Module name: confdroid_alloy
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages required config files for the confdroid_alloy module
2025-02-24 12:02:24 +01:00
###############################################################################
2026-07-21 13:25:48 +02:00
class confdroid_alloy::main::files (
2025-02-24 12:02:24 +01:00
2026-07-21 13:25:48 +02:00
) inherits confdroid_alloy::params {
require confdroid_alloy::main::dirs
2025-02-24 12:02:24 +01:00
2026-07-21 13:25:48 +02:00
$log_targets_array = Array($confdroid_alloy::params::ay_log_targets, true)
2025-02-24 13:24:45 +01:00
2026-10-04 15:13:44 +02:00
concat { $ay_main_file:
ensure => present,
2025-03-02 13:15:07 +01:00
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => etc_t,
seluser => system_u,
notify => Service[$ay_service],
2025-02-24 13:24:45 +01:00
}
2025-03-10 15:51:36 +01:00
2026-10-04 15:13:44 +02:00
concat::fragment { 'confdroid_alloy_config_header':
target => $ay_main_file,
content => template('confdroid_alloy/config.alloy.erb'),
order => '001',
}
if $ay_manage_loki == true {
concat::fragment { 'confdroid_alloy_log_targets_default':
target => $ay_main_file,
content => template('confdroid_alloy/log_targets.alloy.erb'),
order => '010',
}
}
concat::fragment { 'confdroid_alloy_config_tail':
target => $ay_main_file,
content => template('confdroid_alloy/config.alloy.tail.erb'),
order => '999',
}
2025-03-10 15:51:36 +01:00
# manage logrotate for rsyslog to allow adm group membership
file { '/etc/logrotate.d/rsyslog':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => etc_t,
seluser => system_u,
2026-07-21 13:25:48 +02:00
content => template('confdroid_alloy/logrotate.rsyslog.erb'),
2025-03-10 15:51:36 +01:00
}
# manage log file group permissions
file { '/var/log/messages':
ensure => file,
owner => 'root',
group => 'adm',
mode => '0640',
2025-03-10 16:03:17 +01:00
notify => Service[$ay_service],
2025-03-10 15:51:36 +01:00
}
file { '/var/log/secure':
ensure => file,
owner => 'root',
group => 'adm',
mode => '0640',
2025-03-10 16:03:17 +01:00
notify => Service[$ay_service],
2025-03-10 15:51:36 +01:00
}
2025-02-24 12:02:24 +01:00
}