added some directory control, testing
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
* [native Puppet deployment](#native-puppet-deployment)
|
* [native Puppet deployment](#native-puppet-deployment)
|
||||||
* [through Foreman](#through-foreman)
|
* [through Foreman](#through-foreman)
|
||||||
* [Parameters](#parameters)
|
* [Parameters](#parameters)
|
||||||
|
* [Mandatory Parameters](#mandatory-parameters)
|
||||||
|
* [Optional Parameters](#optional-parameters)
|
||||||
* [SELINUX](#selinux)
|
* [SELINUX](#selinux)
|
||||||
* [Known Problems](#known-problems)
|
* [Known Problems](#known-problems)
|
||||||
* [Support](#support)
|
* [Support](#support)
|
||||||
@@ -26,7 +28,7 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
* install required binaries and dependencies
|
* install required binaries and dependencies
|
||||||
* manage user
|
* manage user settings (optional)
|
||||||
|
|
||||||
### Repo Structure
|
### Repo Structure
|
||||||
|
|
||||||
@@ -56,6 +58,11 @@ See [more details about class deployment on Confdroid.com](https://confdroid.com
|
|||||||
### Parameters
|
### Parameters
|
||||||
The following parameters are editable via params.pp or through ENC (**__recommended__**). Values changed will take immediate effect at next puppet run. Services will be restarted where neccessary.
|
The following parameters are editable via params.pp or through ENC (**__recommended__**). Values changed will take immediate effect at next puppet run. Services will be restarted where neccessary.
|
||||||
|
|
||||||
|
#### Mandatory Parameters
|
||||||
|
|
||||||
|
#### Optional Parameters
|
||||||
|
* `$ae_manage_user` : Whether or not to manage the user settings. Important when accessing shared resources accross nodes. Defaults to `false`.
|
||||||
|
|
||||||
|
|
||||||
### SELINUX
|
### SELINUX
|
||||||
All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored.
|
All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored.
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ $ae_u_groups = undef,
|
|||||||
$ae_user_home = '/opt/rh/httpd24/root/usr/share/httpd',
|
$ae_user_home = '/opt/rh/httpd24/root/usr/share/httpd',
|
||||||
$ae_user_shell = '/bin/false',
|
$ae_user_shell = '/bin/false',
|
||||||
|
|
||||||
|
# configuration files
|
||||||
|
$ae_manage_cfg = false,
|
||||||
|
$ae_manage_dirs = true,
|
||||||
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# installation section
|
# installation section
|
||||||
@@ -45,6 +50,25 @@ $reqpackages = $::operatingsystem ? {
|
|||||||
# service
|
# service
|
||||||
$ae_service = 'httpd'
|
$ae_service = 'httpd'
|
||||||
|
|
||||||
|
# directories
|
||||||
|
$ae_main_dir = '/etc/httpd'
|
||||||
|
$ae_conf_dir = "${ae_main_dir}/conf"
|
||||||
|
$ae_conf_d_dir = "${ae_main_dir}/conf.d"
|
||||||
|
$ae_conf_mods_d = "${ae_main_dir}/conf.modules.d"
|
||||||
|
$ae_var_logs_dir = '/var/log/httpd'
|
||||||
|
$ae_logs_dir = "${ae_main_dir}/logs"
|
||||||
|
$ae_logs_link = '../../var/log/httpd'
|
||||||
|
$ae_usr_lib_dir = '/usr/lib64/httpd',
|
||||||
|
$ae_usr_mods_dir = "${ae_usr_lib_dir}/modules"
|
||||||
|
$ae_mods_dir = "${ae_main_dir}/modules"
|
||||||
|
$ae_mods_link = '../../usr/lib64/httpd/modules',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# files
|
||||||
|
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
|
|
||||||
include cd_apache::main::config
|
include cd_apache::main::config
|
||||||
|
|||||||
@@ -28,4 +28,135 @@ class cd_apache::server::dirs (
|
|||||||
|
|
||||||
require cd_apache::server::user
|
require cd_apache::server::user
|
||||||
|
|
||||||
|
if $ae_manage_dirs == true {
|
||||||
|
|
||||||
|
# create main dir
|
||||||
|
|
||||||
|
file { $ae_main_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_main_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_config_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# conf dir
|
||||||
|
|
||||||
|
file { $ae_conf_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_conf_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_config_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# conf.d dir
|
||||||
|
|
||||||
|
file { $ae_conf_d_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_conf_d_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_config_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# conf.modules.d
|
||||||
|
|
||||||
|
file { $ae_conf_mods_d:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_conf_mods_d,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0755',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_config_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# /var/log/httpd
|
||||||
|
|
||||||
|
file { $ae_var_logs_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_var_logs_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0700',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_log_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# logs dir link
|
||||||
|
|
||||||
|
file { $ae_logs_dir:
|
||||||
|
ensure => link,
|
||||||
|
path => $ae_logs_dir,
|
||||||
|
target => $ae_logs_link,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0777',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_log_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# /usr/lib/httpd
|
||||||
|
|
||||||
|
file { $ae_usr_lib_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_usr_lib_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0700',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_modules_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# mods dir
|
||||||
|
|
||||||
|
file { $ae_mods_dir:
|
||||||
|
ensure => directory,
|
||||||
|
path => $ae_mods_dir,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0700',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_modules_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
# logs dir link
|
||||||
|
|
||||||
|
file { $ae_mods_dir:
|
||||||
|
ensure => link,
|
||||||
|
path => $ae_mods_dir,
|
||||||
|
target => $ae_mods_link,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0777',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => httpd_modules_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,5 @@ class cd_apache::server::files (
|
|||||||
|
|
||||||
require cd_apache::server::dirs
|
require cd_apache::server::dirs
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user