Standalone
Overview
The full documentation of all configuration options is in the standalone role documentation. For general configuration, have a look at the generic role documentation.
Usage
Add Solidblocks RDS collection to Ansible requirements
---
collections:
- name: https://github.com/pellepelster/solidblocks/releases/download/v0.4.4/blcks-rds_postgresql-0.4.4.tar.gz
type: url
Apply role to database host
---
- name: "database1"
hosts: database1
become: true
roles:
- role: blcks.rds_postgresql.standalone
instance_name: database1
environment_name: prod
superuser_password: foobar
backup_password: foobar
Provisioning Flow
flowchart TD provisioning_start@{shape: circle, label: "provisioning start"} --> mount_data_device["`ensure **<data_device>** is mounted`"] mount_data_device --> data_dir_empty{"`is **<data_dir>** empty`"} data_dir_empty -->|yes|restore_available{"`is backup available`"} restore_available -->|no|bootstrap_database restore_available -->|yes|restore["`restore from backup`"] restore --> wait_for_restore["`wait for recovery finish marker **/tmp/<stanza_name>-recovery-complete**`"] wait_for_restore --> start_database_recovery["`start database for recovery`"] start_database_recovery --> wait_for_recovery["`wait until **pg_is_in_recovery()** is **false**`"] wait_for_recovery --> stop_database_recovery["`stop recovery database`"] data_dir_empty -->|no| start_database["`start database`"] bootstrap_database["`initialize **<data_dir>** with **<superuser_*>** credentials`"] --> start_database stop_database_recovery --> start_database start_database --> stanza_exists{"`backup stanza exists`"} stanza_exists -->|yes| provisioning_finished@{shape: stadium, label: "provisioning finished"} stanza_exists -->|no|stanza_create["`create backup stanza`"] stanza_create --> provisioning_finished