Skip to content

Commit 7e4a214

Browse files
committed
Updated postgres
1 parent df9bd2a commit 7e4a214

File tree

9 files changed

+22
-318
lines changed

9 files changed

+22
-318
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,13 @@ TODO:
160160
PostgreSQL is a database server
161161

162162
* [Documentation](https://www.postgresql.org/)
163-
* [Terraform Example](_examples/postgresql.tf)
164-
* [Nomad Job](postgresql/nomad/postgresql.hcl)
163+
* [Terraform Example](_examples/postgres.tf)
164+
* [Nomad Job](postgres/nomad/postgres.hcl)
165165

166166
TODO:
167167

168168
* [ ] LDAP integration
169169
* [ ] Add TLS support
170-
* [ ] Add replication support
171170
* [ ] Use volume instead when the data does not have '/' as prefix
172171
* [ ] Add users, databases and roles support on initialization
173172

_examples/postgres.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
module "postgres" {
3+
source = "github.com/mutablelogic/tf-nomad//postgres"
4+
5+
enabled = true // If false, no-op
6+
dc = var.dc
7+
namespace = var.namespace
8+
service_dns = ["192.168.86.11", "192.168.86.12", "192.168.86.13"]
9+
10+
root_user = local.POSTGRESQL_ROOT_USER // User for the 'root' user (default: postgres)
11+
root_password = local.POSTGRESQL_ROOT_PASSWORD // Password for the 'root' user
12+
replication_user = local.POSTGRESQL_REPLICATION_USER // User for the 'replication' user (default: replicator)
13+
replication_password = local.POSTGRESQL_REPLICATION_PASSWORD // Password for the 'replication' user
14+
15+
primary = "cm2" // Primary server node
16+
replicas = [ "cm3", "cm5" ] // One or more read-only replica server nodes
17+
port = 5432 // Port to expose (optional)
18+
database = "postgres" // Default database name (optional)
19+
data = "/var/lib/postgresql" // Persistence directory
20+
}

_examples/postgresql.tf

Lines changed: 0 additions & 17 deletions
This file was deleted.

postgresql/input.tf

Lines changed: 0 additions & 82 deletions
This file was deleted.

postgresql/locals.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

postgresql/main.tf

Lines changed: 0 additions & 25 deletions
This file was deleted.

postgresql/nomad/postgresql.hcl

Lines changed: 0 additions & 169 deletions
This file was deleted.

postgresql/outputs.tf

Lines changed: 0 additions & 8 deletions
This file was deleted.

postgresql/providers.tf

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)