3
0

OP#200 replace class names

This commit is contained in:
2025-12-04 19:49:59 +01:00
parent 363f546191
commit b97d83be3b
17 changed files with 101 additions and 101 deletions

View File

@@ -1,12 +1,12 @@
# Readme
[![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=postgresql_cd)](https://jenkins.confdroid.com/job/postfresql_cd/)
[![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_postgresql)](https://jenkins.confdroid.com/job/postfresql_cd/)
## Synopsis
PostgreSQL is a powerful modern open source SQL database server.
`postgresql_cd` is a Puppet module to automate installation, configuration and management of all aspects of PostgreSQL for Puppet 8
`confdroid_postgresql` is a Puppet module to automate installation, configuration and management of all aspects of PostgreSQL for Puppet 8
## WARNING
@@ -46,13 +46,13 @@ via site.pp or nodes.pp
```ruby
node 'example.example.net' {
include postgresql_cd
include confdroid_postgresql
}
```
* through Foreman:
In order to apply parameters through Foreman, **__postgresql_cd::params__** must be added to the host or host group in question.
In order to apply parameters through Foreman, **__confdroid_postgresql::params__** must be added to the host or host group in question.
See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/).

View File

@@ -1,11 +1,11 @@
## postgresql_cd::exporter::dirs.pp
# Module name: postgresql_cd
## confdroid_postgresql::exporter::dirs.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages the postgresql exporter dirs
###############################################################################
class postgresql_cd::exporter::dirs (
class confdroid_postgresql::exporter::dirs (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if ($fqdn == $pl_server_fqdn) and ($pl_use_exporter == true) {
file { $pl_install_dir:
ensure => directory,

View File

@@ -1,12 +1,12 @@
## postgresql_cd::exporter::files.pp
# Module name: postgresql_cd
## confdroid_postgresql::exporter::files.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages the postgresql exporter files
###############################################################################
class postgresql_cd::exporter::files (
class confdroid_postgresql::exporter::files (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if ($fqdn == $pl_server_fqdn) and ($pl_use_exporter == true) {
require postgresql_cd::exporter::dirs
require confdroid_postgresql::exporter::dirs
}
}

View File

@@ -1,13 +1,13 @@
## postgresql_cd::exporter::service.pp
# Module name: postgresql_cd
## confdroid_postgresql::exporter::service.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages the postgresql exporter service
###############################################################################
class postgresql_cd::exporter::service (
class confdroid_postgresql::exporter::service (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if ($fqdn == $pl_server_fqdn) and ($pl_use_exporter == true) {
require postgresql_cd::exporter::files
require confdroid_postgresql::exporter::files
# service { $pl_exporter_service:
# ensure => running,

View File

@@ -1,11 +1,11 @@
## postgresql_cd::firewall::iptables.pp
# Module name: postgresql_cd
## confdroid_postgresql::firewall::iptables.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages the alloy iptables
###############################################################################
class postgresql_cd::firewall::iptables (
class confdroid_postgresql::firewall::iptables (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if ($fqdn == $pl_server_fqdn) and ($pl_enable_fw == true) {
firewall { "${pl_fw_rule_order}${pl_fw_port} tcp port ${pl_fw_port}":
source => $pl_source_range,

View File

@@ -1,8 +1,8 @@
## postgresql_cd::init.pp
# Module name: postgresql_cd
## confdroid_postgresql::init.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class initializes the postgresql_cd module.
# @summary Class initializes the confdroid_postgresql module.
##############################################################################
class postgresql_cd {
include postgresql_cd::params
class confdroid_postgresql {
include confdroid_postgresql::params
}

View File

@@ -1,17 +1,17 @@
## postgresql_cd::main::config.pp
# Module name: postgresql_cd
## confdroid_postgresql::main::config.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages logic for the postgresql_cd module.
# @summary Class manages logic for the confdroid_postgresql module.
##############################################################################
class postgresql_cd::main::config (
class confdroid_postgresql::main::config (
) inherits postgresql_cd::params {
include postgresql_cd::main::install
) inherits confdroid_postgresql::params {
include confdroid_postgresql::main::install
if $fqdn == $pl_server_fqdn {
include postgresql_cd::server::service
include confdroid_postgresql::server::service
# if $pl_use_exporter == true {
# include postgresql_cd::exporter::service
# include confdroid_postgresql::exporter::service
# }
}
}

View File

@@ -1,10 +1,10 @@
## postgresql_cd::main::dirs.pp
# Module name: postgresql_cd
## confdroid_postgresql::main::dirs.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages logic for the postgresql_cd module.
# @summary Class manages logic for the confdroid_postgresql module.
##############################################################################
class postgresql_cd::main::dirs (
class confdroid_postgresql::main::dirs (
) inherits postgresql_cd::params {
require postgresql_cd::main::install
) inherits confdroid_postgresql::params {
require confdroid_postgresql::main::install
}

View File

@@ -1,14 +1,14 @@
## postgresql_cd::main::files.pp
# Module name: postgresql_cd
## confdroid_postgresql::main::files.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages logic for the postgresql_cd module.
# @summary Class manages logic for the confdroid_postgresql module.
##############################################################################
class postgresql_cd::main::files (
class confdroid_postgresql::main::files (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if $fqdn == $pl_server_fqdn {
require postgresql_cd::server::initdb
require postgresql_cd::main::dirs
require confdroid_postgresql::server::initdb
require confdroid_postgresql::main::dirs
file { '/var/lib/pgsql/data/postgresql.conf':
ensure => file,
@@ -19,7 +19,7 @@ class postgresql_cd::main::files (
selrole => object_r,
seltype => postgresql_db_t,
seluser => unconfined_u,
content => template('postgresql_cd/postgresql.conf.erb'),
content => template('confdroid_postgresql/postgresql.conf.erb'),
notify => Service[$pl_service],
}
}

View File

@@ -1,11 +1,11 @@
## postgresql_cd::main::install.pp
# Module name: postgresql_cd
## confdroid_postgresql::main::install.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages logic for the postgresql_cd module.
# @summary Class manages logic for the confdroid_postgresql module.
##############################################################################
class postgresql_cd::main::install (
class confdroid_postgresql::main::install (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if $fqdn == $pl_server_fqdn {
package { $reqpackages_server:
ensure => $pkg_ensure,

View File

@@ -1,7 +1,7 @@
## postgresql_cd::params.pp
# Module name: postgresql_cd
## confdroid_postgresql::params.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class contains all parameters for the postgresql_cd module.
# @summary Class contains all parameters for the confdroid_postgresql module.
# @param [String] pl_server_fqdn the fqdn of the postgresql server. Any other
# system will be configured as client
# @param [Array] reqpackages_server the packages for the server
@@ -26,7 +26,7 @@
# @param [String] pl_install_dir the path for the postgres-exporter files
# @param [String] pl_idle_timeout idle_in_transaction_session_timeout
##############################################################################
class postgresql_cd::params (
class confdroid_postgresql::params (
String $pl_server_fqdn = undef,
@@ -69,13 +69,13 @@ class postgresql_cd::params (
# files
$pl_pg_hba_conf = "${pl_data_dir}/pg_hba.conf"
$pl_pg_hba_rule_conf = 'postgresql_cd/server/pghba/pg_hba_rule.conf.erb'
$pl_pg_hba_conf_erb = 'postgresql_cd/server/pghba/pg_hba.conf.erb'
$pl_pg_hba_rule_conf = 'confdroid_postgresql/server/pghba/pg_hba_rule.conf.erb'
$pl_pg_hba_conf_erb = 'confdroid_postgresql/server/pghba/pg_hba.conf.erb'
# Service
$pl_service = 'postgresql'
$pl_exporter_service = 'postgres_exporter'
# includes must be last
include postgresql_cd::main::config
include confdroid_postgresql::main::config
}

View File

@@ -1,5 +1,5 @@
## postgresql_cd::server::databases::db_df
# Module name: postgresql_cd
## confdroid_postgresql::server::databases::db_df
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com.com)
# @summary define manages databases
# @see https://www.postgresql.org/docs/9.6/static/managing-databases.html
@@ -10,25 +10,25 @@
# 'CREATE DATABASE' creates it, 'DROP DATABASE' drops it.
# @param [String] pl_db_extension
##############################################################################
define postgresql_cd::server::databases::db_df (
define confdroid_postgresql::server::databases::db_df (
Optional[String] $pl_db_name = undef,
Optional[String] $pl_owner_name = undef,
Optional[String] $pl_db_action = undef,
String $pl_db_extension = 'pg_trgm',
) {
$pl_manage_content = $postgresql_cd::params::pl_manage_content
$pl_manage_content = $confdroid_postgresql::params::pl_manage_content
if $pl_manage_content == true {
# create databases
if $pl_db_action == 'CREATE DATABASE' {
exec { "create_database_${name}":
command => template('postgresql_cd/server/databases/db_create_sql.erb'),
command => template('confdroid_postgresql/server/databases/db_create_sql.erb'),
user => 'postgres',
path => ['/usr/bin','/bin'],
cwd => '/tmp',
unless => template('postgresql_cd/server/databases/unless_db_sql.erb'),
unless => template('confdroid_postgresql/server/databases/unless_db_sql.erb'),
}
}
@@ -36,11 +36,11 @@ define postgresql_cd::server::databases::db_df (
if $pl_db_action == 'DROP DATABASE' {
exec { "drop_database_${name}":
command => template('postgresql_cd/server/databases/db_drop_sql.erb'),
command => template('confdroid_postgresql/server/databases/db_drop_sql.erb'),
user => 'postgres',
path => ['/usr/bin','/bin'],
cwd => '/tmp',
onlyif => template('postgresql_cd/server/databases/unless_drop_sql.erb'),
onlyif => template('confdroid_postgresql/server/databases/unless_drop_sql.erb'),
}
}
}

View File

@@ -1,13 +1,13 @@
## postgresql_cd::server::initdb.pp
# Module name: postgresql_cd
## confdroid_postgresql::server::initdb.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class initiates the database
###############################################################################
class postgresql_cd::server::initdb (
class confdroid_postgresql::server::initdb (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if $fqdn == $pl_server_fqdn {
require postgresql_cd::main::install
require confdroid_postgresql::main::install
exec { 'init_pgsql_db':
command => 'postgresql-setup --initdb',
@@ -16,5 +16,5 @@ class postgresql_cd::server::initdb (
}
}
include postgresql_cd::main::files
include confdroid_postgresql::main::files
}

View File

@@ -1,9 +1,9 @@
## postgresql_cd::server::pg_hba.pp
# Module name: postgresql_cd
## confdroid_postgresql::server::pg_hba.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@puppetsoft.com)
# @summary Class manages pg_hba.conf file and line entries through define
# pg_hba_rule.pp
# @example postgresql_cd::server::pghba::pg_hba_rule { 'local access for role postgres':
# @example confdroid_postgresql::server::pghba::pg_hba_rule { 'local access for role postgres':
# pl_auth_type => 'local',
# pl_auth_database => 'all',
# pl_auth_user => 'postgres',
@@ -12,9 +12,9 @@
# pl_auth_option => '',
# }
##############################################################################
class postgresql_cd::server::pghba::pg_hba (
class confdroid_postgresql::server::pghba::pg_hba (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if $fqdn == $pl_server_fqdn {
# create the pg_hba.conf file
@@ -34,7 +34,7 @@ class postgresql_cd::server::pghba::pg_hba (
}
# manage default rules => should go into external config set
# postgresql_cd::server::pghba::pg_hba_rule { 'local access for role postgres':
# confdroid_postgresql::server::pghba::pg_hba_rule { 'local access for role postgres':
# pl_auth_type => 'local',
# pl_auth_database => 'all',
# pl_auth_user => $ql_user_name,
@@ -43,7 +43,7 @@ class postgresql_cd::server::pghba::pg_hba (
# pl_auth_option => $ql_auth_option,
# }
# postgresql_cd::server::pghba::pg_hba_rule { 'local access for all roles':
# confdroid_postgresql::server::pghba::pg_hba_rule { 'local access for all roles':
# pl_auth_type => 'local',
# pl_auth_database => 'all',
# pl_auth_user => 'all',

View File

@@ -1,5 +1,5 @@
## postgresql_cd::server::pghba::pg_hba_rule
# Module name: postgresql_cd
## confdroid_postgresql::server::pghba::pg_hba_rule
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary define manages rule entries for pg_hba configuration file
# @see https://www.postgresql.org/docs/9.6/static/auth-pg-hba-conf.html
@@ -19,7 +19,7 @@
# appear on the list. Lower orders are higher on the list.
# @param [string] pl_auth_description Specify a description for the entry.
##############################################################################
define postgresql_cd::server::pghba::pg_hba_rule (
define confdroid_postgresql::server::pghba::pg_hba_rule (
Optional[String] $pl_auth_type = undef,
Optional[String] $pl_auth_database = undef,
@@ -31,9 +31,9 @@ define postgresql_cd::server::pghba::pg_hba_rule (
Optional[String] $pl_auth_description = undef,
) {
$pl_pg_hba_conf = $postgresql_cd::params::pl_pg_hba_conf
$pl_pg_hba_rule_conf = $postgresql_cd::params::pl_pg_hba_rule_conf
$pl_data_dir = $postgresql_cd::params::pl_data_dir
$pl_pg_hba_conf = $confdroid_postgresql::params::pl_pg_hba_conf
$pl_pg_hba_rule_conf = $confdroid_postgresql::params::pl_pg_hba_rule_conf
$pl_data_dir = $confdroid_postgresql::params::pl_data_dir
# create rule fragment

View File

@@ -1,5 +1,5 @@
## postgresql_cd::server::roles::role_df
# Module name: postgresql_cd
## confdroid_postgresql::server::roles::role_df
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary define manages databases
@@ -9,7 +9,7 @@
# @param [string] pl_role_attributes attributes for the role to be created
# @param [string] pl_role_status what to do with the role
##############################################################################
define postgresql_cd::server::roles::role_df (
define confdroid_postgresql::server::roles::role_df (
Optional[String] $pl_role_name = undef,
Optional[String] $pl_role_pw = undef,
@@ -17,17 +17,17 @@ define postgresql_cd::server::roles::role_df (
String $pl_role_status = 'CREATE ROLE',
) {
$pl_manage_content = $postgresql_cd::params::pl_manage_content
$pl_manage_content = $confdroid_postgresql::params::pl_manage_content
if $pl_manage_content == true {
# create the role
exec { "role_${name}":
command => template('postgresql_cd/server/roles/role.sql.erb'),
command => template('confdroid_postgresql/server/roles/role.sql.erb'),
user => 'postgres',
path => ['/usr/bin','/bin'],
cwd => '/tmp',
unless => template('postgresql_cd/server/roles/unless_sql.erb'),
unless => template('confdroid_postgresql/server/roles/unless_sql.erb'),
}
}
}

View File

@@ -1,15 +1,15 @@
## postgresql_cd::server::service.pp
# Module name: postgresql_cd
## confdroid_postgresql::server::service.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages the postgresql service
###############################################################################
class postgresql_cd::server::service (
class confdroid_postgresql::server::service (
) inherits postgresql_cd::params {
) inherits confdroid_postgresql::params {
if $fqdn == $pl_server_fqdn {
require postgresql_cd::firewall::iptables
require postgresql_cd::server::initdb
require postgresql_cd::server::pghba::pg_hba
require confdroid_postgresql::firewall::iptables
require confdroid_postgresql::server::initdb
require confdroid_postgresql::server::pghba::pg_hba
service { $pl_service:
ensure => running,