Files

111 lines
2.8 KiB
ObjectPascal
Raw Permalink Normal View History

2026-02-03 00:41:35 +01:00
## confdroid_apache::server::files.pp
# Module name: confdroid_apache
# Author: 12ww1160 (12ww1160@confdroid.com)
# @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
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
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
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
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 {
# 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
# 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',
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
}