10 Commits

Author SHA1 Message Date
Greg Karékinian
7ce8b7d461 Enable PostgreSQL service 2021-01-23 19:14:55 +01:00
4872677066
Configure postgres recipes for VMs and zerotier access
* Remove encfs (using encrypted volumes instead)
* Allow access without TLS from zerotier network
2021-01-07 13:53:30 +01:00
Greg Karékinian
f75aeaf9b5 Always set the promote trigger file config
Only setting it for standby servers isn't useful, as we need to be able
to touch this file to trigger the promotion of a new primary server
after running Chef on it.
2020-12-18 17:02:13 +01:00
Greg Karékinian
a0db6adaf2 Pass the data_directory to the postgresql_server_conf resource
Previously we were passing it as an additional config, but it is set by
default. The last value was used, the custom one, so the server still
used the correct file
2020-06-10 14:41:07 +02:00
b662c04183
Finish initial encfs cookbook and postgres adaptations 2020-06-08 17:01:24 +02:00
379161eb1e
Fix postgres installation
Also, do not start at boot anymore, in favor of path-based activation.
2020-06-07 12:47:06 +02:00
Greg Karékinian
1e60722ec4 Create an initial encfs cookbook
Usage: Add the kosmos_encfs::default recipe to the run list of a node.
Creating the encrypted directory will keep it mounted. After a reboot,
start the encfs service and enter the password:

```
$ systemctl start encfs
encfs password:
```

For now postgresql@12-main is a hardcoded dependency of the encfs
Systemd unit that is automatically started once the user inputs the
correct password. This list of dependency will need to be different for
every server, based on the services it is running
2020-06-04 19:50:20 +02:00
Greg Karékinian
55b1cbc1d7 Encrypt the Postgresql data dir on the replica (centaurus)
encfs always runs a configuration assistant when creating a new
volume, so this needs to be done manually:

   systemctl stop postgresql@12-main
   mv /var/lib/postgresql /var/lib/postgresql.old
   encfs /var/lib/postgresql_encrypted /var/lib/postgresql --public
Pick p (paranoia mode) and enter the password from the data bag twice

   mv /var/lib/postgresql/* /var/lib/postgresql/
   systemctl start postgresql@12-main

This is running on centaurus and is mounted automatically on boot by a
system unit

Refs #129
2020-05-15 18:41:31 +02:00
Greg Karékinian
8d2ab785fc Use a self-signed TLS certificate for PostgreSQL 2020-05-13 19:10:14 +02:00
Greg Karékinian
21119fff08 Add a custom resource to set up PostgreSQL 12
Supports both primary and replica. The access rules and firewall have to
be set up outside of the custom resource, so they are part of the
recipes instead

Refs #160
2020-05-11 18:23:11 +02:00