add puppetdb section
This commit is contained in:
64
manifests/puppetdb/dirs.pp
Normal file
64
manifests/puppetdb/dirs.pp
Normal file
@@ -0,0 +1,64 @@
|
||||
## puppet_cd::puppetdb::dirs.pp
|
||||
# Module name: puppet_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid)
|
||||
# @summary Class manages puppetdb directories
|
||||
###############################################################################
|
||||
class puppet_cd::puppetdb::dirs (
|
||||
|
||||
) inherits puppet_cd::params {
|
||||
if ($fqdn == $pt_puppetdb_server) and ($pt_use_puppetdb == true) {
|
||||
require puppet_cd::main::install
|
||||
|
||||
# main directory
|
||||
file { $pt_puppetdb_main:
|
||||
ensure => directory,
|
||||
path => $pt_puppetdb_main,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# conf.d directory
|
||||
file { $pt_puppetdb_conf_d:
|
||||
ensure => directory,
|
||||
path => $pt_puppetdb_conf_d,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# ssl directory
|
||||
file { $pt_puppetdb_ssl:
|
||||
ensure => directory,
|
||||
path => $pt_puppetdb_ssl,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# log dir
|
||||
file { $pt_puppetdb_log:
|
||||
ensure => directory,
|
||||
path => $pt_puppetdb_log,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0700',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => var_log_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
}
|
||||
}
|
||||
117
manifests/puppetdb/files.pp
Normal file
117
manifests/puppetdb/files.pp
Normal file
@@ -0,0 +1,117 @@
|
||||
## puppet_cd::puppetdb::files.pp
|
||||
# Module name: puppet_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid)
|
||||
# @summary Class manages puppetdb files
|
||||
###############################################################################
|
||||
class puppet_cd::puppetdb::files (
|
||||
|
||||
) inherits puppet_cd::params {
|
||||
if ($fqdn == $pt_puppetdb_server) and ($pt_use_puppetdb == true) {
|
||||
require puppet_cd::puppetdb::dirs
|
||||
|
||||
# bootstrap.cfg
|
||||
file { $pt_bootstrap_conf:
|
||||
ensure => file,
|
||||
path => $pt_bootstrap_conf,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_bootstrap_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
|
||||
# requestlogging.xml
|
||||
file { $pt_request_logging_conf:
|
||||
ensure => file,
|
||||
path => $pt_request_logging_conf,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_request_logging_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
|
||||
# logback.xml
|
||||
file { $pt_logback_conf:
|
||||
ensure => file,
|
||||
path => $pt_logback_conf,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_logback_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
|
||||
# config.ini
|
||||
file { $pt_puppetdb_config_ini:
|
||||
ensure => file,
|
||||
path => $pt_puppetdb_config_ini,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0640',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_puppetdb_config_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
|
||||
# database.ini
|
||||
file { $pt_puppetdb_database_ini:
|
||||
ensure => file,
|
||||
path => $pt_puppetdb_database_ini,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0640',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_puppetdb_database_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
|
||||
# jetty.ini
|
||||
file { $pt_puppetdb_jetty_ini :
|
||||
ensure => file,
|
||||
path => $pt_puppetdb_jetty_ini ,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0640',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_puppetdb_jetty_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
|
||||
# repl.ini
|
||||
file { $pt_puppetdb_repl_ini:
|
||||
ensure => file,
|
||||
path => $pt_puppetdb_repl_ini,
|
||||
owner => $pt_puppetdb_user,
|
||||
group => $pt_puppetdb_user,
|
||||
mode => '0640',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => puppet_etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_puppetdb_repl_erb),
|
||||
notify => Service[$pt_puppetdb],
|
||||
}
|
||||
}
|
||||
}
|
||||
19
manifests/puppetdb/service.pp
Normal file
19
manifests/puppetdb/service.pp
Normal file
@@ -0,0 +1,19 @@
|
||||
## puppet_cd::puppetdb::service.pp
|
||||
# Module name: puppet_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid)
|
||||
# @summary Class manages puppetdb service
|
||||
###############################################################################
|
||||
class puppet_cd::puppetdb::service (
|
||||
|
||||
) inherits puppet_cd::params {
|
||||
if ($fqdn == $pt_puppetdb_server) and ($pt_use_puppetdb == true) {
|
||||
require puppet_cd::puppetdb::files
|
||||
|
||||
service { $pt_puppetdb:
|
||||
ensure => running,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
enable => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user