Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ PostgreSQL is a database server

TODO:
* [ ] LDAP integration
* [ ] Add TLS support
* [ ] Add replication support
* [ ] Use volume instead when the data does not have '/' as prefix
* [ ] Add users, databases and roles support on initialization

## seaweedfs

Expand Down
3 changes: 2 additions & 1 deletion _examples/postgresql.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ module "postgresql" {
dc = local.datacenter // Nomad datacenter for the cluster
namespace = local.namespace // Nomad namespace for the cluster
hosts = ["server1"] // Host constraint for the job
root_user = local.POSTGRESQL_ROOT_USER // User for the 'root' user (default: postgres)
root_password = local.POSTGRESQL_ROOT_PASSWORD // Password for the 'root' user

// Optional parameters
enabled = true // If false, no-op
port = 5432 // Port to expose
port = 5432 // Port to expose (optional)
database = "default" // Default database name
data = "/var/lib/postgresql" // Persistence directory
}
4 changes: 2 additions & 2 deletions postgresql/nomad/postgresql.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ variable "database" {
// LOCALS

locals {
data_path = var.data == "" ? "${NOMAD_ALLOC_DIR}/data" : "/var/lib/postgresql/data"
data_path = var.data == "" ? "${NOMAD_ALLOC_DIR}/data" : "/var/lib/postgresql/data/pgdata"
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -147,7 +147,7 @@ job "postgresql" {
ports = ["postgresql"]
dns_servers = var.service_dns
volumes = compact([
var.data == "" ? "" : format("%s:/var/lib/postgresql", var.data)
var.data == "" ? "" : format("%s:/var/lib/postgresql/data", var.data)
])
}

Expand Down