feat: initial commit
This commit is contained in:
commit
38f495e3f4
457 changed files with 40577 additions and 0 deletions
34
environments/production/modules/postgresql/manifests/init.pp
Normal file
34
environments/production/modules/postgresql/manifests/init.pp
Normal file
|
@ -0,0 +1,34 @@
|
|||
class postgresql {
|
||||
contain postgresql::install
|
||||
|
||||
contain postgresql::pgadmin
|
||||
}
|
||||
|
||||
class postgresql::install {
|
||||
# https://www.postgresql.org/download/linux/debian/
|
||||
package { 'postgresql-common':
|
||||
ensure => installed
|
||||
} ~>
|
||||
exec { 'postgresql-install':
|
||||
command => '/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y',
|
||||
refreshonly => true,
|
||||
} ~>
|
||||
exec { 'postgresql-apt-update':
|
||||
command => 'apt update',
|
||||
path => ['/usr/bin'],
|
||||
refreshonly => true,
|
||||
} ~>
|
||||
package { 'postgresql-16':
|
||||
ensure => installed
|
||||
} ~>
|
||||
package { 'postgresql-client-16':
|
||||
ensure => installed
|
||||
}
|
||||
}
|
||||
|
||||
class postgresql::service {
|
||||
service { 'postgresql':
|
||||
ensure => running,
|
||||
enable => true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
class postgresql::pgadmin {
|
||||
contain postgresql::pgadmin::install
|
||||
contain postgresql::pgadmin::config
|
||||
}
|
||||
|
||||
|
||||
class postgresql::pgadmin::install {
|
||||
apt::source { 'pgadmin':
|
||||
comment => 'PGAdmin Repo',
|
||||
location => 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm',
|
||||
release => 'pgadmin4',
|
||||
repos => 'main',
|
||||
key => {
|
||||
'name' => 'pgadmin.pub',
|
||||
'source' => 'https://www.pgadmin.org/static/packages_pgadmin_org.pub',
|
||||
},
|
||||
include => {
|
||||
'deb' => true,
|
||||
},
|
||||
}
|
||||
|
||||
package { 'pgadmin4-web':
|
||||
ensure => installed
|
||||
}
|
||||
}
|
||||
|
||||
class postgresql::pgadmin::config {
|
||||
exec { 'pgadmin-setup':
|
||||
command => '/usr/pgadmin4/bin/setup-web.sh --yes',
|
||||
environment => [
|
||||
"PGADMIN_SETUP_EMAIL=$pg_setup_email",
|
||||
"PGADMIN_SETUP_PASSWORD=$pg_setup_password"
|
||||
],
|
||||
path => ['/usr/bin'],
|
||||
unless => ['test -f /var/lib/pgadmin', 'test -f /var/log/pgadmin']
|
||||
}
|
||||
|
||||
file { '/usr/pgadmin4/web/config_local.py':
|
||||
ensure => file,
|
||||
content => template('postgresql/config_local.py.erb')
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
AUTHENTICATION_SOURCES = ['oauth2', 'internal']
|
||||
OAUTH2_AUTO_CREATE_USER = True
|
||||
OAUTH2_CONFIG = [{
|
||||
'OAUTH2_NAME': '<%= @pg_oauth2_name %>',
|
||||
'OAUTH2_DISPLAY_NAME': '<%= @pg_oauth2_display_name %>',
|
||||
'OAUTH2_CLIENT_ID': '<%= @pg_oauth2_client_id %>',
|
||||
'OAUTH2_CLIENT_SECRET': '<%= @pg_oauth2_client_secret %>',
|
||||
'OAUTH2_TOKEN_URL': '<%= @pg_oauth2_token_url %>',
|
||||
'OAUTH2_AUTHORIZATION_URL': '<%= @pg_oauth2_authorization_url %>',
|
||||
'OAUTH2_API_BASE_URL': '<%= @pg_oauth2_api_base_url %>',
|
||||
'OAUTH2_USERINFO_ENDPOINT': '<%= @pg_oauth2_userinfo_endpoint %>',
|
||||
'OAUTH2_SERVER_METADATA_URL': '<%= @pg_oauth2_server_metadata_url %>',
|
||||
'OAUTH2_SCOPE': '<%= @pg_oauth2_scope %>',
|
||||
'OAUTH2_ICON': '<%= @pg_oauth2_icon %>'
|
||||
}]
|
||||
|
||||
WTF_CSRF_HEADERS = ['X-CSRF']
|
Loading…
Add table
Add a link
Reference in a new issue