2026-02-03 00:41:35 +01:00
|
|
|
## confdroid_apache::server::files.pp
|
|
|
|
|
# Module name: confdroid_apache
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
2017-07-07 16:15:43 +01:00
|
|
|
# @summary Manage all aspects for the httpd configuration, if enabled.
|
2017-06-19 13:34:42 +01:00
|
|
|
##############################################################################
|
2026-02-03 00:41:35 +01:00
|
|
|
class confdroid_apache::server::files (
|
2017-06-19 13:34:42 +01:00
|
|
|
|
2026-02-03 00:41:35 +01:00
|
|
|
) inherits confdroid_apache::params {
|
|
|
|
|
require confdroid_apache::server::dirs
|
2017-06-19 13:34:42 +01:00
|
|
|
|
2017-06-19 17:06:32 +01:00
|
|
|
if $ae_manage_cfg == true {
|
|
|
|
|
# manage main config file
|
|
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
file { $ae_conf_file:
|
|
|
|
|
ensure => file,
|
|
|
|
|
path => $ae_conf_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => httpd_config_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($ae_conf_file_erb),
|
|
|
|
|
notify => Service['httpd'],
|
2017-06-19 17:06:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# manage magic file
|
|
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
file { $ae_magic_file:
|
|
|
|
|
ensure => file,
|
|
|
|
|
path => $ae_magic_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => httpd_config_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($ae_magic_file_erb),
|
|
|
|
|
notify => Service['httpd'],
|
2017-06-19 17:06:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# manage main ssl config file
|
|
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
file { $ae_ssl_file:
|
|
|
|
|
ensure => file,
|
|
|
|
|
path => $ae_ssl_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => httpd_config_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($ae_ssl_file_erb),
|
|
|
|
|
notify => Service['httpd'],
|
|
|
|
|
}
|
2017-06-19 15:33:27 +01:00
|
|
|
|
2017-06-20 10:18:30 +01:00
|
|
|
# manage autoindex.conf
|
|
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
file { $ae_autoindex_file:
|
|
|
|
|
ensure => file,
|
|
|
|
|
path => $ae_autoindex_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => httpd_config_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($ae_autoindex_erb),
|
|
|
|
|
notify => Service['httpd'],
|
|
|
|
|
}
|
2017-06-20 10:18:30 +01:00
|
|
|
|
|
|
|
|
if $ae_allow_user_dirs == true {
|
2025-05-06 14:51:28 +02:00
|
|
|
# manage userdir.conf
|
|
|
|
|
|
|
|
|
|
file { $ae_userdir_file:
|
|
|
|
|
ensure => file,
|
|
|
|
|
path => $ae_userdir_file,
|
|
|
|
|
owner => 'root',
|
|
|
|
|
group => 'root',
|
|
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => httpd_config_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($ae_userdir_erb),
|
|
|
|
|
notify => Service['httpd'],
|
2017-06-20 10:18:30 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-20 11:41:13 +02:00
|
|
|
|
2025-05-06 14:51:28 +02:00
|
|
|
# manage index.html
|
|
|
|
|
|
|
|
|
|
file { $ae_index_file:
|
|
|
|
|
ensure => file,
|
|
|
|
|
path => $ae_index_file,
|
2026-02-03 01:22:11 +01:00
|
|
|
owner => 'apache',
|
|
|
|
|
group => 'apache',
|
2025-05-06 14:51:28 +02:00
|
|
|
mode => '0644',
|
|
|
|
|
selrange => s0,
|
|
|
|
|
selrole => object_r,
|
|
|
|
|
seltype => httpd_sys_content_t,
|
|
|
|
|
seluser => system_u,
|
|
|
|
|
content => template($ae_index_erb),
|
|
|
|
|
notify => Service['httpd'],
|
2018-04-20 11:41:13 +02:00
|
|
|
}
|
2017-06-19 13:34:42 +01:00
|
|
|
}
|