LICENSE Documentation

Official TypeScript developer resources and documentation for autobase-tech/LICENSE. Verified technical context for AI.

0 stars TypeScript TypeScript 1 file Β· ~22,443 tokens
RAW Doc

1. Project Overview & Quickstart (autobase-tech/LICENSE)

LICENSE

Open-source repository autobase-tech/LICENSE

Repository Details

Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.

2. Official Technical Reference & Guides (autobase-tech/docs)

File: README.md

Documentation

autobase.tech documentation website.

Local Development

text
$ yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

text
$ yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

Using SSH:

text
$ USE_SSH=true yarn deploy

Not using SSH:

text
$ GIT_USER=<Your GitHub username> yarn deploy

We using GitHub pages for hosting.


File: docs/extensions/install.md


import ThemedImage from '@theme/ThemedImage';

Install Extension

This section of the guide describes how to install extensions.

:::info
See the list of 500+ extensions available for installation, but you’re not limited to itβ€”you can install any extension through various methods, including building from source.
:::

Console (UI)

To install an extension:

  1. Enable the extension using the toggle switch.
  2. Select the target database(s) where the extension should be created.

Autobase will automatically install the required packages and create the extension in each selected database.

:::note
In the Community Edition, extensions can be installed via the UI only during cluster creation. In the Enterprise Edition, extensions can also be installed after deployment from the Extensions page of the selected cluster.
:::

Command line

Method 1: Auto-Setup

This feature simplifies the installation of popular PostgreSQL extensions by automating setup and configuration.
It adds repositories, installs packages, and sets parameters like shared_preload_libraries as needed for seamless integration.

List of extensions supported in β€œAuto-Setup” mode:

Extension Description Variable
timescaledb Enables scalable inserts and complex queries for time-series data. Provided by Timescale enable_timescaledb
citus Distributed PostgreSQL as an extension enable_citus
pg_search Full text search for PostgreSQL using BM25. Provided by ParadeDB Attention! requires the purchase of a license. enable_pg_search
vector pgvector: vector data type and ivfflat and hnsw access methods enable_pgvector
vectorscale pgvectorscale: Advanced indexing for vector data enable_pgvectorscale
postgis PostGIS geometry and geography spatial types and functions enable_postgis
pgrouting Routing extension for PostGIS enable_pgrouting
pg_cron Job scheduler for PostgreSQL enable_pg_cron
pgaudit PostgreSQL Audit Extension enable_pgaudit
pg_partman Partition management extension for PostgreSQL enable_pg_partman
pg_repack Reorganize tables in PostgreSQL databases with minimal locks enable_pg_repack
pg_stat_kcache Gather statistics about physical disk access and CPU consumption done by backends enable_pg_stat_kcache
pg_wait_sampling Sampling based statistics of wait events enable_pg_wait_sampling

Enable the following extensions by setting the respective variables to true.

Method 2: Packages

You can define any repositories and extension packages for installation.

  1. Define the necessary repositories in apt_repository (or yum_repository) variable.

Example:

yaml
apt_repository:
  - repo: "deb https://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main"  # postgresql apt repository
    key: "https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc"  # postgresql apt repository key
  - repo: "deb https://repo.pigsty.io/apt/pgsql/{{ ansible_distribution_release }} {{ ansible_distribution_release }} main"  # Pigsty apt repository
    key: "https://repo.pigsty.io/key"  # Pigsty apt repository key
  1. Define the necessary packages in postgresql_packages variable.

Example:

yaml
postgresql_packages:
  - postgresql-{{ postgresql_version }}
  - postgresql-client-{{ postgresql_version }}
  - postgresql-contrib-{{ postgresql_version }}
  - postgresql-server-dev-{{ postgresql_version }}
  - postgresql-{{ postgresql_version }}-dbgsym
  - postgresql-{{ postgresql_version }}-cron
  - postgresql-{{ postgresql_version }}-repack
  - postgresql-{{ postgresql_version }}-pg-stat-kcache
  - postgresql-{{ postgresql_version }}-pg-wait-sampling
#  - postgresql-{{ postgresql_version }}-postgis-3
#  - postgresql-{{ postgresql_version }}-pgrouting
#  - postgresql-{{ postgresql_version }}-pgvector
#  - postgresql-{{ postgresql_version }}-pgaudit
#  - postgresql-{{ postgresql_version }}-partman
  1. Define the necessary parameters in postgresql_parameters variable.

Example:

yaml
postgresql_parameters:
  - { option: "shared_preload_libraries", value:  "pg_stat_statements,auto_explain,pg_stat_kcache,pg_wait_sampling,pg_cron" }
  - { option: "pg_stat_statements.max", value: "10000" }
  - { option: "pg_stat_statements.track", value: "all" }
  - { option: "pg_stat_statements.track_utility", value: "false" }
  - { option: "pg_stat_statements.save", value: "true" }
  - { option: "auto_explain.log_min_duration", value: "10s" }  # enable auto_explain for 10-second logging threshold
  - { option: "auto_explain.log_analyze", value: "true" }
  - { option: "auto_explain.log_buffers", value: "true" }
  - { option: "auto_explain.log_timing", value: "false" }
  - { option: "auto_explain.log_triggers", value: "true" }
  - { option: "auto_explain.log_verbose", value: "true" }
  - { option: "auto_explain.log_nested_statements", value: "true" }
  - { option: "auto_explain.sample_rate", value: "0.01" }  # enable auto_explain for 1% of queries logging threshold
  - { option: "cron.database_name", value: "postgres" }
  1. Define the necessary extensions in postgresql_extensions variable.

Example:

yaml
postgresql_extensions:
  - { ext: "pg_cron", db: "postgres" }
  - { ext: "pg_stat_statements", db: "mydatabase" }
  - { ext: "pg_stat_kcache", db: "mydatabase" }
  - { ext: "pg_wait_sampling", db: "mydatabase" }
  - { ext: "dblink", db: "mydatabase" }

Method 3: Source code

If needed, use pre_deploy_command or post_deploy_command to run a command, bash script, or script path on the host to build an extension from source.

Available variables:

yaml
# Execute custom commands or scripts
pre_deploy_command: "" # Command or script to be executed before the Postgres cluster deployment
pre_deploy_command_timeout: 3600 # Timeout in seconds
pre_deploy_command_hosts: "postgres_cluster" # host groups where the pre_deploy_command should be executed
pre_deploy_command_print: true # Print the command in the ansible log
pre_deploy_command_print_result: true # Print the result of the command execution to the ansible log

post_deploy_command: "" # Command or script to be executed after the Postgres cluster deployment
post_deploy_command_timeout: 3600 # Timeout in seconds
post_deploy_command_hosts: "postgres_cluster" # host groups where the post_deploy_command should be executed
post_deploy_command_print: true # Print the command in the ansible log
post_deploy_command_print_result: true # Print the result of the command execution to the ansible log

File: docs/extensions/list.mdx


Extension List

To extend the functionality of the PostgreSQL database, you can use extensions.

:::info
Over 500 extensions are available for installation, including contrib extensions bundled with PostgreSQL, as well as third-party extensions from the official PGDG repository and others, such as the Pigsty extension repository.
:::

import ComponentWrapper from '@site/src/components/ComponentWrapper';
import ExtensionsTable from '@site/src/components/ExtensionsTable';


File: docs/deployment/aws.md


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';

AWS

Amazon Web Services

Autobase will automatically set up the following in Amazon Web Services (AWS):

  1. AWS EC2 Instances - a virtual machine (with a dedicated data disk), with all cluster components installed and configured.
  2. AWS Network Load Balancer (NLB) to serve as the entry point for database connections.
  3. AWS S3 Bucket, and configured backups using pgBackRest.

:::info
All components are installed within your cloud account.
:::

Prerequisites

You will need the access key (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to deploy the PostgreSQL cluster to your AWS account.
See the official documentation for instructions on creating an access key.

:::note
You can either add these credentials in advance on the Settings page under the Secrets tab, or you will be prompted to enter them during the cluster creation process.
:::

{/* ===== EXTERNAL TABS: Console (UI) / Command line ===== */}
text
{/* ===== INTERNAL TAB: Basic ===== */}
<Tabs defaultValue="basic">
  <TabItem value="basic" label="Basic">
    Select **AWS** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::
    
    

    Specify the desired disk size for the database.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Review the summary and click the **"Create Cluster"** button.

    
  </TabItem>

{/* ===== INTERNAL TAB: Expert ===== */}
  <TabItem value="expert" label="Expert Mode">
    This mode unlocks advanced settings for fine-tuning clusters, including options hidden in standard mode. \
    Designed for experienced users.

    :::info
    To use **Expert Mode**, go to the **Settings** page and turn on β€œEnable expert mode”.
    :::

    Select **AWS** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    :::tip
    If the required instance type is not listed, you can specify it in the **CUSTOM** tab. \
    Make sure it follows the format supported by the AWS API (e.g., `r8g.xlarge`).
    :::

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::

    

    :::info
    **Spot instances** can be used if needed.
    :::note not permanent
    Spot instances are 60–90% cheaper than standard ones, making them great for testing. \
    However, they are not suitable for production because the cloud provider can terminate them at any time to reclaim capacity.
    :::

    Specify the desired disk size for the database, along with the volume type (st1, gp3, io2) and file system type (ext4, xfs, zfs).

    

    If needed, specify the **subnet ID** to which the database servers will be added. If not specified, the default VPC subnet is used.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Specify the desired database name, username, and user password.

    

    Optionally, specify connection pools for your databases, its size and mode.

    

    :::info Available pool modes
      - **session** - Server is released back to pool after client disconnects.
      - **transaction** - Server is released back to pool after transaction finishes. Recomended.
      - **statement** - Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
    :::

    Enable the necessary extensions for your databases.

    

    :::tip
    This list includes all contrib extensions and some popular third-party ones. However, [more than 400 extensions are available](/docs/extensions/list). \
    To install others, specify the [installation parameters](/docs/extensions/install) manually on the **YAML** tab.
    :::

    Configure backup settings such as the start time and retention period.

    

    :::info
    By default, Autobase automatically configures the settings for the selected backup tool. \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
      :::note
      For pgBackRest, you can specify the global section options β€” the stanza section will be populated automatically.
    :::

    Optionally, specify the Postgres and kernel parameters.

    

    :::info
    By default, Autobase automatically configures these parameters. See the default settings for [Postgres](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L331) and the [kernel](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L889). \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
    :::

    Example for Postgres parameters:

    

    Example for Kernel parameters:

    

    Optionally, specify the Additional settings.

    

    :::tip
    Use the hint (?) icon for a more detailed description of each option.
    :::

    Review the summary and click the **"Create Cluster"** button.

    

  </TabItem>

{/* ===== INTERNAL TAB: YAML ===== */}
  <TabItem value="yaml" label="YAML tab">
    The YAML editor allows you to specify any parameters that were previously available only in command-line mode. \
    Designed for experienced users.

    :::info
    To use the **YAML** tab, go to the **Settings** page and turn on β€œEnable expert mode” and β€œEnable YAML editor".
    :::

    

    Autobase offers a wide range of functionality, and not all options can be fully represented in UI forms. That’s why we added a YAML editor β€” it allows you to set any parameters supported by Autobase. You can see available parameters [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/cloud_resources/defaults/main.yml) (for cloud resources) and [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml) (for cluster settings).

    Make the necessary changes and click the **"Create Cluster"** button.
  </TabItem>
</Tabs>

{/* ===== COMMON BLOCK (Basic / Expert / YAML) ===== */}

Wait until deployment is complete. This process takes about **10 to 15 minutes**.

:::info
You can see the deployment log in the **"Operations"** page.  
Select the relevant event with the **"deploy"** type and click **"Show details"** under the *Actions* tab.
:::

:::tip
After a successful deployment, you can obtain the connection info on the cluster page.  
Click on the name of your cluster on the **"Clusters"** page.
:::



Example of a cluster page:

{/* ===== EXTERNAL TAB: Command line ===== */}

:::tip
πŸ“© Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
:::

text
#### 1. Set AWS credentials

Export your AWS access key to environment variables:

```bash
export AWS_ACCESS_KEY_ID=<value>
export AWS_SECRET_ACCESS_KEY=<value>
```

#### 2. Run the Deployment Command

Execute the following command to deploy a PostgreSQL cluster (example):

```bash
docker run --rm -it \
  --env AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
  --env AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
  autobase/automation:2.10.0 \
    ansible-playbook deploy_pgcluster.yml --extra-vars \
      "ansible_user=ubuntu \
       cloud_provider='aws' \
       cloud_load_balancer=true \
       server_count=3 \
       server_type='m7i.xlarge' \
       server_image='ami-034568121cfdea9c3' \
       server_location='us-east-1' \
       volume_size=100 \
       postgresql_version=18 \
       patroni_cluster_name='postgres-cluster-01' \
       ssh_public_keys='ssh-rsa AAAAB3NzaC1yc2EAAAA******whzcMINzKKCc7AVGbk='"
```

Key parameters:

- `cloud_provider`: Specifies Amazon Web Services (AWS) as the provider.
- `cloud_load_balancer`: Adds an AWS Network Load Balancer (NLB) to the cluster.
- `server_count`: Number of servers in the cluster (at least 3 servers are needed for high availability).
- `server_type`: Type of servers (e.g., 'm7i.xlarge' for 4 vCPU 16 GB RAM).
- `server_image`: Operating system image for the servers (e.g., 'ami-034568121cfdea9c3' for Ubuntu 24.04).
- `server_location`: Server location (e.g., 'us-east-1' for US East N. Virginia).
- `volume_size`: Disk size (in GB) for the database.
- `postgresql_version`: PostgreSQL version.
- `patroni_cluster_name`: PostgreSQL cluster name.
- `ssh_public_keys`: Your SSH public key to access the database servers after deployment.

:::note
See the [default](https://github.com/autobase-tech/autobase/tree/2.10.0/automation/roles/common/defaults/main.yml) automation variables for more details, including the list of available [variables](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/cloud_resources/defaults/main.yml) for cloud resources.
:::

#### 3. Wait until deployment is complete

This process takes about **10 to 15 minutes**.

:::info
After a successful deployment, the connection information can be found in the Ansible log.
:::

File: docs/deployment/azure.md


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';

Azure

Microsoft Azure

Autobase will automatically set up the following in Azure:

  1. Azure Virtual Machines (with a dedicated data disk), with all cluster components installed and configured.
  2. Azure Load Balancer to serve as the entry point for database connections.
  3. Azure Blob Storage, and configured backups using pgBackRest.

:::info
All components are installed within your cloud account.
:::

Prerequisites

You will need the necessary details (AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID, AZURE_SECRET, AZURE_TENANT) to deploy the cluster to your Azure account.
See the official documentation for instructions on creating an service principal.

:::note
You can either add these credentials in advance on the Settings page under the Secrets tab, or you will be prompted to enter them during the cluster creation process.
:::

{/* ===== EXTERNAL TABS: Console (UI) / Command line ===== */}
text
{/* ===== INTERNAL TAB: Basic ===== */}
<Tabs defaultValue="basic">
  <TabItem value="basic" label="Basic">
    Select **Azure** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::
    
    

    Specify the desired disk size for the database.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Review the summary and click the **"Create Cluster"** button.

    
  </TabItem>

{/* ===== INTERNAL TAB: Expert ===== */}
  <TabItem value="expert" label="Expert Mode">
    This mode unlocks advanced settings for fine-tuning clusters, including options hidden in standard mode. \
    Designed for experienced users.

    :::info
    To use **Expert Mode**, go to the **Settings** page and turn on β€œEnable expert mode”.
    :::

    Select **Azure** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    :::tip
    If the required instance type is not listed, you can specify it in the **CUSTOM** tab. \
    Make sure it follows the format supported by the Azure API (e.g., `Standard_D8s_v5`).
    :::

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::

    

    :::info
    **Spot instances** can be used if needed.
    :::note not permanent
    Spot instances are 60–90% cheaper than standard ones, making them great for testing. \
    However, they are not suitable for production because the cloud provider can terminate them at any time to reclaim capacity.
    :::

    Specify the desired disk size for the database, along with the volume type and file system type (ext4, xfs, zfs).

    

    If needed, specify the Network name to which the database servers will be added. If not specified, a new network will be created.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Specify the desired database name, username, and user password.

    

    Optionally, specify connection pools for your databases, its size and mode.

    

    :::info Available pool modes
      - **session** - Server is released back to pool after client disconnects.
      - **transaction** - Server is released back to pool after transaction finishes. Recomended.
      - **statement** - Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
    :::

    Enable the necessary extensions for your databases.

    

    :::tip
    This list includes all contrib extensions and some popular third-party ones. However, [more than 400 extensions are available](/docs/extensions/list). \
    To install others, specify the [installation parameters](/docs/extensions/install) manually on the **YAML** tab.
    :::

    Configure backup settings such as the start time and retention period.

    

    :::info
    By default, Autobase automatically configures the settings for the selected backup tool. \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
      :::note
      For pgBackRest, you can specify the global section options β€” the stanza section will be populated automatically.
    :::

    Optionally, specify the Postgres and kernel parameters.

    

    :::info
    By default, Autobase automatically configures these parameters. See the default settings for [Postgres](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L331) and the [kernel](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L889). \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
    :::

    Example for Postgres parameters:

    

    Example for Kernel parameters:

    

    Optionally, specify the Additional settings.

    

    :::tip
    Use the hint (?) icon for a more detailed description of each option.
    :::

    Review the summary and click the **"Create Cluster"** button.

    

  </TabItem>

{/* ===== INTERNAL TAB: YAML ===== */}
  <TabItem value="yaml" label="YAML tab">
    The YAML editor allows you to specify any parameters that were previously available only in command-line mode. \
    Designed for experienced users.

    :::info
    To use the **YAML** tab, go to the **Settings** page and turn on β€œEnable expert mode” and β€œEnable YAML editor”.
    :::

    

    Autobase offers a wide range of functionality, and not all options can be fully represented in UI forms. That’s why we added a YAML editor β€” it allows you to set any parameters supported by Autobase. You can see available parameters [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/cloud_resources/defaults/main.yml) (for cloud resources) and [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml) (for cluster settings).

    Make the necessary changes and click the **"Create Cluster"** button.
  </TabItem>
</Tabs>

{/* ===== COMMON BLOCK (Basic / Expert / YAML) ===== */}

Wait until deployment is complete. This process takes about **10 to 15 minutes**.

:::info
You can see the deployment log in the **"Operations"** page.  
Select the relevant event with the **"deploy"** type and click **"Show details"** under the *Actions* tab.
:::

:::tip
After a successful deployment, you can obtain the connection info on the cluster page.  
Click on the name of your cluster on the **"Clusters"** page.
:::



Example of a cluster page:

{/* ===== EXTERNAL TAB: Command line ===== */}

:::tip
πŸ“© Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
:::

1. Set Azure credentials

Export your Azure service principal credentials to an environment variable:

text
export AZURE_SUBSCRIPTION_ID=<value>
export AZURE_CLIENT_ID=<value>
export AZURE_SECRET=<value>
export AZURE_TENANT=<value>

2. Run the Deployment Command

Execute the following command to deploy a PostgreSQL cluster (example):

text
docker run --rm -it \
  --env AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID} \
  --env AZURE_CLIENT_ID=${AZURE_CLIENT_ID} \
  --env AZURE_SECRET=${AZURE_SECRET} \
  --env AZURE_TENANT=${AZURE_TENANT} \
  autobase/automation:2.10.0 \
    ansible-playbook deploy_pgcluster.yml --extra-vars \
      "ansible_user=azureadmin \
      cloud_provider='azure' \
      cloud_load_balancer=true \
      server_count=3 \
      server_type='Standard_D4s_v5' \
      server_location='eastus' \
      volume_size=100 \
      postgresql_version=18 \
      patroni_cluster_name='postgres-cluster-01' \
      ssh_public_keys='ssh-rsa AAAAB3NzaC1yc2EAAAA******whzcMINzKKCc7AVGbk='"

Key Parameters:

  • cloud_provider: Specifies Azure as the provider.
  • cloud_load_balancer: Adds a Azure Load Balancer to the cluster.
  • server_count: Number of servers in the cluster (at least 3 servers are needed for high availability).
  • server_type: Type of servers (e.g., 'Standard_D4s_v5' for 4 vCPU 16 GB RAM).
  • server_location: Server location (e.g., 'eastus' for East US Virginia).
  • volume_size: Disk size (in GB) for the database.
  • postgresql_version: PostgreSQL version.
  • patroni_cluster_name: PostgreSQL cluster name.
  • ssh_public_keys: Your SSH public key to access the database servers after deployment.

:::note
See the default automation variables for more details, including the list of available variables for cloud resources.
:::

3. Wait until deployment is complete

This process takes about 10 to 15 minutes.

:::info
After a successful deployment, the connection information can be found in the Ansible log.
:::


File: docs/deployment/digitalocean.md


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';

DigitalOcean

DigitalOcean Cloud

Autobase will automatically set up the following in DigitalOcean:

  1. DigitalOcean Droplets - a virtual machine (with a dedicated data disk), with all cluster components installed and configured.
  2. DigitalOcean Load Balancer to serve as the entry point for database connections.
  3. DigitalOcean Spaces Object Storage, and configured backups using pgBackRest (available via Expert Mode).

:::info
All components are installed within your cloud account.
:::

Prerequisites

You will need the Personal Access Token to deploy the cluster to your DigitalOcean account, and S3 credentials to create Spaces Object Storage (S3 bucket) for backups.

See the official documentation for instructions: How to Create a Personal Access Token, How to Manage Access Keys.

:::note
You can either add access token in advance on the Settings page under the Secrets tab, or you will be prompted to enter them during the cluster creation process.
:::

{/* ===== EXTERNAL TABS: Console (UI) / Command line ===== */}
text
{/* ===== INTERNAL TAB: Basic ===== */}
<Tabs defaultValue="basic">
  <TabItem value="basic" label="Basic">
    Select **DigitalOcean** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::
    
    

    Specify the desired disk size for the database.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Review the summary and click the **"Create Cluster"** button.

    
  </TabItem>

{/* ===== INTERNAL TAB: Expert ===== */}
  <TabItem value="expert" label="Expert Mode">
    This mode unlocks advanced settings for fine-tuning clusters, including options hidden in standard mode. \
    Designed for experienced users.

    :::info
    To use **Expert Mode**, go to the **Settings** page and turn on β€œEnable expert mode”.
    :::

    Select **DigitalOcean** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    :::tip
    If the required instance type is not listed, you can specify it in the **CUSTOM** tab. \
    Make sure it follows the format supported by the DigitalOcean API (e.g., `g-8vcpu-32gb`).
    :::

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::

    

    Specify the desired disk size for the database, along with the file system type (ext4, xfs, zfs).

    

    If needed, specify the VPC Network name to which the database servers will be added. If not specified, the default VPC is used, or a new network will be created.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Specify the desired database name, username, and user password.

    

    Optionally, specify connection pools for your databases, its size and mode.

    

    :::info Available pool modes
      - **session** - Server is released back to pool after client disconnects.
      - **transaction** - Server is released back to pool after transaction finishes. Recomended.
      - **statement** - Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
    :::

    Enable the necessary extensions for your databases.

    

    :::tip
    This list includes all contrib extensions and some popular third-party ones. However, [more than 400 extensions are available](/docs/extensions/list). \
    To install others, specify the [installation parameters](/docs/extensions/install) manually on the **YAML** tab.
    :::

    Configure backup settings such as the start time and retention period.

    

    :::info
    By default, Autobase automatically configures the settings for the selected backup tool. \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
      :::note
      For pgBackRest, you can specify the global section options β€” the stanza section will be populated automatically.
    :::

    Optionally, specify the Postgres and kernel parameters.

    

    :::info
    By default, Autobase automatically configures these parameters. See the default settings for [Postgres](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L331) and the [kernel](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L889). \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
    :::

    Example for Postgres parameters:

    

    Example for Kernel parameters:

    

    Optionally, specify the Additional settings.

    

    :::tip
    Use the hint (?) icon for a more detailed description of each option.
    :::

    Review the summary and click the **"Create Cluster"** button.

    

  </TabItem>

{/* ===== INTERNAL TAB: YAML ===== */}
  <TabItem value="yaml" label="YAML tab">
    The YAML editor allows you to specify any parameters that were previously available only in command-line mode. \
    Designed for experienced users.

    :::info
    To use the **YAML** tab, go to the **Settings** page and turn on β€œEnable expert mode” and β€œEnable YAML editor”.
    :::

    

    Autobase offers a wide range of functionality, and not all options can be fully represented in UI forms. That’s why we added a YAML editor β€” it allows you to set any parameters supported by Autobase. You can see available parameters [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/cloud_resources/defaults/main.yml) (for cloud resources) and [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml) (for cluster settings).

    Make the necessary changes and click the **"Create Cluster"** button.
  </TabItem>
</Tabs>

{/* ===== COMMON BLOCK (Basic / Expert / YAML) ===== */}

Wait until deployment is complete. This process takes about **10 to 15 minutes**.

:::info
You can see the deployment log in the **"Operations"** page.  
Select the relevant event with the **"deploy"** type and click **"Show details"** under the *Actions* tab.
:::

:::tip
After a successful deployment, you can obtain the connection info on the cluster page.  
Click on the name of your cluster on the **"Clusters"** page.
:::



Example of a cluster page:

{/* ===== EXTERNAL TAB: Command line ===== */}

:::tip
πŸ“© Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
:::

1. Set DigitalOcean API Token

Export your DigitalOcean API token to an environment variable:

text
export DO_API_TOKEN=<value>

2. Run the Deployment Command

Execute the following command to deploy a PostgreSQL cluster (example):

text
docker run --rm -it \
  --env DO_API_TOKEN=${DO_API_TOKEN} \
  autobase/automation:2.10.0 \
    ansible-playbook deploy_pgcluster.yml --extra-vars \
      "ansible_user=root \
      cloud_provider='digitalocean' \
      cloud_load_balancer=true \
      server_count=3 \
      server_type='g-4vcpu-16gb' \
      server_image='ubuntu-24-04-x64' \
      server_location='nyc1' \
      volume_size=100 \
      digital_ocean_spaces_access_key='YOUR_ACCESS_KEY' \
      digital_ocean_spaces_secret_key='YOUR_SECRET_KEY' \
      digital_ocean_spaces_region='nyc3' \
      pgbackrest_install=true \
      postgresql_version=18 \
      patroni_cluster_name='postgres-cluster-01' \
      ssh_public_keys='ssh-rsa AAAAB3NzaC1yc2EAAAA******whzcMINzKKCc7AVGbk='"

:::note
Replace YOUR_ACCESS_KEY and YOUR_SECRET_KEY with your actual S3 credentials.

Alternatively, you can remove the digital_ocean_spaces_*, and pgbackrest_install variables if you don’t plan to configure backups for your cluster (not recommended for production use).
:::

Key Parameters:

  • cloud_provider: Specifies DigitalOcean as the provider.
  • cloud_load_balancer: Adds a DigitalOcean Load Balancer to the cluster.
  • server_count: Number of servers in the cluster (at least 3 servers are needed for high availability).
  • server_type: Type of servers (e.g., 'g-4vcpu-16gb' for 4 vCPU 16 GB RAM).
  • server_image: Operating system image for the servers (e.g., ubuntu-24-04-x64).
  • server_location: Server location (e.g., 'nyc1' for New York).
  • volume_size: Disk size (in GB) for the database.
  • postgresql_version: PostgreSQL version.
  • patroni_cluster_name: PostgreSQL cluster name.
  • ssh_public_keys: Your SSH public key to access the database servers after deployment.

Backup Parameters:

  • pgbackrest_install: Enables backups using pgBackRest. Use wal_g_install instead if you prefer WAL-G.
  • digital_ocean_spaces_name: Name of the Spaces Object Storage (default: patroni_cluster_name-backup).
  • digital_ocean_spaces_region: Region for the S3 bucket (default: server_location). Recommended to use a different region than the database cluster.
  • digital_ocean_spaces_access_key: Spaces access key (required).
  • digital_ocean_spaces_secret_key: Spaces secret key (required).

:::info
See the default automation variables for more details, including the list of available variables for cloud resources.
:::

3. Wait until deployment is complete

This process takes about 10 to 15 minutes.

:::tip
After a successful deployment, the connection information can be found in the Ansible log.
:::


File: docs/deployment/gcp.md


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';

GCP

Google Cloud Platform

Autobase will automatically set up the following in Google Cloud:

  1. GCP VM instances - a virtual machine (with a dedicated data disk), with all cluster components installed and configured.
  2. GCP Proxy Network Load Balancer to serve as the entry point for database connections.
  3. GCP Bucket, and configured backups using pgBackRest.

:::info
All components are installed within your cloud account.
:::

Prerequisites

You will need the service account credentials (in JSON or base64 format) to deploy the PostgreSQL cluster to your Google Cloud account.
See the official documentation for instructions on creating a service account key.

:::note
You can either add these credentials in advance on the Settings page under the Secrets tab, or you will be prompted to enter them during the cluster creation process.
:::

{/* ===== EXTERNAL TABS: Console (UI) / Command line ===== */}
text
{/* ===== INTERNAL TAB: Basic ===== */}
<Tabs defaultValue="basic">
  <TabItem value="basic" label="Basic">
    Select **Google Cloud** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::
    
    

    Specify the desired disk size for the database.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Review the summary and click the **"Create Cluster"** button.

    
  </TabItem>

{/* ===== INTERNAL TAB: Expert ===== */}
  <TabItem value="expert" label="Expert Mode">
    This mode unlocks advanced settings for fine-tuning clusters, including options hidden in standard mode. \
    Designed for experienced users.

    :::info
    To use **Expert Mode**, go to the **Settings** page and turn on β€œEnable expert mode”.
    :::

    Select **Google Cloud** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    :::tip
    If the required instance type is not listed, you can specify it in the **CUSTOM** tab. \
    Make sure it follows the format supported by the Google Cloud API (e.g., `n4-standard-8`).
    :::

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::

    

    :::info
    **Spot instances** can be used if needed.
    :::note not permanent
    Spot instances are 60–90% cheaper than standard ones, making them great for testing. \
    However, they are not suitable for production because the cloud provider can terminate them at any time to reclaim capacity.
    :::

    Specify the desired disk size for the database, along with the volume type and file system type (ext4, xfs, zfs).

    

    If needed, specify the Network name to which the database servers will be added. If not specified, the default network is used.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Specify the desired database name, username, and user password.

    

    Optionally, specify connection pools for your databases, its size and mode.

    

    :::info Available pool modes
      - **session** - Server is released back to pool after client disconnects.
      - **transaction** - Server is released back to pool after transaction finishes. Recomended.
      - **statement** - Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
    :::

    Enable the necessary extensions for your databases.

    

    :::tip
    This list includes all contrib extensions and some popular third-party ones. However, [more than 400 extensions are available](/docs/extensions/list). \
    To install others, specify the [installation parameters](/docs/extensions/install) manually on the **YAML** tab.
    :::

    Configure backup settings such as the start time and retention period.

    

    :::info
    By default, Autobase automatically configures the settings for the selected backup tool. \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
      :::note
      For pgBackRest, you can specify the global section options β€” the stanza section will be populated automatically.
    :::

    Optionally, specify the Postgres and kernel parameters.

    

    :::info
    By default, Autobase automatically configures these parameters. See the default settings for [Postgres](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L331) and the [kernel](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L889). \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
    :::

    Example for Postgres parameters:

    

    Example for Kernel parameters:

    

    Optionally, specify the Additional settings.

    

    :::tip
    Use the hint (?) icon for a more detailed description of each option.
    :::

    Review the summary and click the **"Create Cluster"** button.

    

  </TabItem>

{/* ===== INTERNAL TAB: YAML ===== */}
  <TabItem value="yaml" label="YAML tab">
    The YAML editor allows you to specify any parameters that were previously available only in command-line mode. \
    Designed for experienced users.

    :::info
    To use the **YAML** tab, go to the **Settings** page and turn on β€œEnable expert mode” and β€œEnable YAML editor”.
    :::

    

    Autobase offers a wide range of functionality, and not all options can be fully represented in UI forms. That’s why we added a YAML editor β€” it allows you to set any parameters supported by Autobase. You can see available parameters [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/cloud_resources/defaults/main.yml) (for cloud resources) and [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml) (for cluster settings).

    Make the necessary changes and click the **"Create Cluster"** button.
  </TabItem>
</Tabs>

{/* ===== COMMON BLOCK (Basic / Expert / YAML) ===== */}

Wait until deployment is complete. This process takes about **10 to 15 minutes**.

:::info
You can see the deployment log in the **"Operations"** page.  
Select the relevant event with the **"deploy"** type and click **"Show details"** under the *Actions* tab.
:::

:::tip
After a successful deployment, you can obtain the connection info on the cluster page.  
Click on the name of your cluster on the **"Clusters"** page.
:::



Example of a cluster page:

{/* ===== EXTERNAL TAB: Command line ===== */}

:::tip
πŸ“© Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
:::

1. Set GCP credentials

Export your GCP service account contents to an environment variable:

text
export GCP_SERVICE_ACCOUNT_CONTENTS='{
  <value>
}'

2. Run the Deployment Command

Execute the following command to deploy a PostgreSQL cluster (example):

text
docker run --rm -it \
  --env GCP_SERVICE_ACCOUNT_CONTENTS=${GCP_SERVICE_ACCOUNT_CONTENTS} \
  autobase/automation:2.10.0 \
    ansible-playbook deploy_pgcluster.yml --extra-vars \
      "ansible_user=root \
      cloud_provider='gcp' \
      cloud_load_balancer=true \
      server_count=3 \
      server_type='n2-standard-4' \
      server_image='projects/ubuntu-os-cloud/global/images/family/ubuntu-2404-lts-amd64' \
      server_location='us-east1' \
      volume_size=100 \
      postgresql_version=18 \
      patroni_cluster_name='postgres-cluster-01' \
      ssh_public_keys='ssh-rsa AAAAB3NzaC1yc2EAAAA******whzcMINzKKCc7AVGbk='"

Key Parameters:

  • cloud_provider: Specifies Google Cloud (GCP) as the provider.
  • cloud_load_balancer: Adds a GCP Proxy Network Load Balance to the cluster.
  • server_count: Number of servers in the cluster (at least 3 servers are needed for high availability).
  • server_type: Type of servers (e.g., 'n2-standard-4' for 4 vCPU 16 GB RAM).
  • server_image: Operating system image for the servers.
  • server_location: Server location (e.g., 'us-east1' for South Carolina).
  • volume_size: Disk size (in GB) for the database.
  • postgresql_version: PostgreSQL version.
  • patroni_cluster_name: PostgreSQL cluster name.
  • ssh_public_keys: Your SSH public key to access the database servers after deployment.

:::note
See the default automation variables for more details, including the list of available variables for cloud resources.
:::

3. Wait until deployment is complete

This process takes about 10 to 15 minutes.

:::info
After a successful deployment, the connection information can be found in the Ansible log.
:::


File: docs/deployment/hetzner.md


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';

Hetzner

Hetzner Cloud

Autobase will automatically set up the following in Hetzner Cloud:

  1. Hetzner Servers - a virtual machine (with a dedicated data disk), with all cluster components installed and configured.
  2. Hetzner Load Balancer to serve as the entry point for database connections.
  3. Hetzner Object Storage (S3 bucket), and configured backups using pgBackRest (available via Expert Mode).

:::info
All components are installed within your cloud account.
:::

Prerequisites

You will need an API token to deploy the cluster to your Hetzner Cloud account, and S3 credentials to create Hetzner Object Storage (S3 bucket) for backups.

See the official documentation for instructions: Generating an API token, Generating S3 keys.

:::note
You can either add your API token in advance on the Settings page under the Secrets tab, or you will be prompted to enter them during the cluster creation process.
:::

{/* ===== EXTERNAL TABS: Console (UI) / Command line ===== */}
text
{/* ===== INTERNAL TAB: Basic ===== */}
<Tabs defaultValue="basic">
  <TabItem value="basic" label="Basic">
    Select **Hetzner** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::
    
    

    Specify the desired disk size for the database.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Review the summary and click the **"Create Cluster"** button.

    
  </TabItem>

{/* ===== INTERNAL TAB: Expert ===== */}
  <TabItem value="expert" label="Expert Mode">
    This mode unlocks advanced settings for fine-tuning clusters, including options hidden in standard mode. \
    Designed for experienced users.

    :::info
    To use **Expert Mode**, go to the **Settings** page and turn on β€œEnable expert mode”.
    :::

    Select **Hetzner** as the destination and choose the deployment region.

    

    

    Select the type of server with the required amount of CPU and RAM.

    :::tip
    If the required instance type is not listed, you can specify it in the **CUSTOM** tab. \
    Make sure it follows the format supported by the Hetzner API (e.g., `CCX33`).
    :::

    

    Select the number of servers to be created for the PostgreSQL cluster.

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::

    

    Specify the desired disk size for the database, along with the file system type (ext4, xfs, zfs).

    

    If needed, specify the Network name to which the database servers will be added. If not specified, a new network will be created.

    

    Specify your SSH public key to be able to access the database servers via SSH after deployment.

    

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Specify the desired database name, username, and user password.

    

    Optionally, specify connection pools for your databases, its size and mode.

    

    :::info Available pool modes
      - **session** - Server is released back to pool after client disconnects.
      - **transaction** - Server is released back to pool after transaction finishes. Recomended.
      - **statement** - Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
    :::

    Enable the necessary extensions for your databases.

    

    :::tip
    This list includes all contrib extensions and some popular third-party ones. However, [more than 400 extensions are available](/docs/extensions/list). \
    To install others, specify the [installation parameters](/docs/extensions/install) manually on the **YAML** tab.
    :::

    Configure backup settings such as the start time and retention period.

    

    :::info
    By default, Autobase automatically configures the settings for the selected backup tool. \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
      :::note
      For pgBackRest, you can specify the global section options β€” the stanza section will be populated automatically.
    :::

    Optionally, specify the Postgres and kernel parameters.

    

    :::info
    By default, Autobase automatically configures these parameters. See the default settings for [Postgres](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L331) and the [kernel](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L889). \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
    :::

    Example for Postgres parameters:

    

    Example for Kernel parameters:

    

    Optionally, specify the Additional settings.

    

    :::tip
    Use the hint (?) icon for a more detailed description of each option.
    :::

    Review the summary and click the **"Create Cluster"** button.

    

  </TabItem>

{/* ===== INTERNAL TAB: YAML ===== */}
  <TabItem value="yaml" label="YAML tab">
    The YAML editor allows you to specify any parameters that were previously available only in command-line mode. \
    Designed for experienced users.

    :::info
    To use the **YAML** tab, go to the **Settings** page and turn on β€œEnable expert mode” and β€œEnable YAML editor”.
    :::

    

    Autobase offers a wide range of functionality, and not all options can be fully represented in UI forms. That’s why we added a YAML editor β€” it allows you to set any parameters supported by Autobase. You can see available parameters [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/cloud_resources/defaults/main.yml) (for cloud resources) and [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml) (for cluster settings).

    Make the necessary changes and click the **"Create Cluster"** button.
  </TabItem>
</Tabs>

{/* ===== COMMON BLOCK (Basic / Expert / YAML) ===== */}

Wait until deployment is complete. This process takes about **10 to 15 minutes**.

:::info
You can see the deployment log in the **"Operations"** page.  
Select the relevant event with the **"deploy"** type and click **"Show details"** under the *Actions* tab.
:::

:::tip
After a successful deployment, you can obtain the connection info on the cluster page.  
Click on the name of your cluster on the **"Clusters"** page.
:::



Example of a cluster page:

{/* ===== EXTERNAL TAB: Command line ===== */}

:::tip
πŸ“© Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
:::

1. Set Hetzner Cloud API Token

Export your Hetzner Cloud API token to an environment variable:

text
export HCLOUD_API_TOKEN=<value>

2. Run the Deployment Command

Execute the following command to deploy a PostgreSQL cluster (example):

text
docker run --rm -it \
  --env HCLOUD_API_TOKEN=${HCLOUD_API_TOKEN} \
  autobase/automation:2.10.0 \
    ansible-playbook deploy_pgcluster.yml --extra-vars \
      "ansible_user=root \
      cloud_provider='hetzner' \
      cloud_load_balancer=true \
      server_count=3 \
      server_type='CCX23' \
      server_image='ubuntu-24.04' \
      server_location='fsn1' \
      volume_size=100 \
      hetzner_object_storage_access_key='YOUR_ACCESS_KEY' \
      hetzner_object_storage_secret_key='YOUR_SECRET_KEY' \
      hetzner_object_storage_region='nbg1' \
      pgbackrest_install=true \
      postgresql_version=18 \
      patroni_cluster_name='postgres-cluster-01' \
      ssh_public_keys='ssh-rsa AAAAB3NzaC1yc2EAAAA******whzcMINzKKCc7AVGbk='"

:::note
Replace YOUR_ACCESS_KEY and YOUR_SECRET_KEY with your actual S3 credentials.
Alternatively, you can remove the hetzner_object_storage_* and pgbackrest_install variables if you don’t plan to configure backups for your cluster (not recommended for production use).
:::

Key Parameters:

  • cloud_provider: Specifies Hetzner Cloud as the provider.
  • cloud_load_balancer: Adds a Hetzner Load Balancer to the cluster.
  • server_count: Number of servers in the cluster (at least 3 servers are needed for high availability).
  • server_type: Type of servers (e.g., 'CCX23' for 4 vCPU 16 GB RAM).
  • server_image: Operating system image for the servers (e.g., ubuntu-24.04).
  • server_location: Server location (e.g., 'ash' for Ashburn).
  • volume_size: Disk size (in GB) for the database.
  • postgresql_version: PostgreSQL version.
  • patroni_cluster_name: PostgreSQL cluster name.
  • ssh_public_keys: Your SSH public key to access the database servers after deployment.

Backup Parameters:

  • pgbackrest_install: Enables backups using pgBackRest. Use wal_g_install instead if you prefer WAL-G.
  • hetzner_object_storage_name: Name of the Object Storage (default: patroni_cluster_name-backup).
  • hetzner_object_storage_region: Region for the S3 bucket (default: server_location). Recommended to use a different region than the database cluster.
  • hetzner_object_storage_access_key: Object Storage ACCESS KEY (required).
  • hetzner_object_storage_secret_key: Object Storage SECRET KEY (required).

:::info
See the default automation variables for more details, including the list of available variables for cloud resources.
:::

3. Wait until deployment is complete

This process takes about 10 to 15 minutes.

:::tip
After a successful deployment, the connection information can be found in the Ansible log.
:::


File: docs/deployment/your-own-machines.md


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ThemedImage from '@theme/ThemedImage';

Your Own Machines

Deploy on existing servers

:::info
This method is suitable for deployment on existing servers, whether with another cloud provider or in your own data center.
:::

Prerequisites

You will need root access or a user with sudo privileges to access the servers via SSH. You can use your private SSH key (assuming the corresponding public key has already been added to the servers), or a username and password if password access is enabled on your servers.

See also the Requirements and Compatibility pages.

{/* ===== EXTERNAL TABS: Console (UI) / Command line ===== */}
text
{/* ===== INTERNAL TAB: Basic ===== */}
<Tabs defaultValue="basic">
  <TabItem value="basic" label="Basic">
    Select **Your Own Machines** in the deployment destination.

    

    Specify the name and IP addresses of your servers. Example:

    

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    :::

    Select authentication method.

    

    Optionally, specify an IP address to provide a single entry point for client access to databases in the cluster. Example:

    

    :::info
    This must be an IP address that is currently unused on your network. The address will be assigned to the cluster after deployment.
      :::note
      Not for cloud environments. Because VIP-based solutions like `keepalived` or `vip-manager` may not works in such environments.
    :::

    Optionally, check the box for "HAProxy load balancer".

    

    :::tip
    This feature supports load balancing for read operations, facilitating effective scale-out strategies through the use of read-only replicas.
    See the details on the [Architecture](https://postgresql-cluster.org/overview/architecture#2-postgresql-high-availability-with-load-balancing) page
    :::

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Review the summary and click the "Create Cluster" button.

    
  </TabItem>

{/* ===== INTERNAL TAB: Expert ===== */}
  <TabItem value="expert" label="Expert Mode">
    This mode unlocks advanced settings for fine-tuning clusters, including options hidden in standard mode. \
    Designed for experienced users.

    :::info
    To use **Expert Mode**, go to the **Settings** page and turn on β€œEnable expert mode”.
    :::

    Select **Your Own Machines** in the deployment destination.

    

    Specify the name and IP addresses of your servers. Example:

    

    :::warning
    Please note that at least 3 servers are required to ensure high availability.
    
    This requirement applies to the number of DCS servers (see [RAFT](http://thesecretlivesofdata.com/raft/) protocol), the database cluster itself may consist of two servers.
    :::

    :::tip
    We also support converting standalone PostgreSQL installation into a high-availability cluster.
    To do this, check the box "Postgres exists" above the server where the database is already present.
    :::

    Select the DCS type (etcd or consul) and where it will be installed, or use an existing DCS cluster.

    

    Select authentication method.

    

    Optionally, specify an IP address to provide a single entry point for client access to databases in the cluster. Example:

    

    :::info
    This must be an IP address that is currently unused on your network. The address will be assigned to the cluster after deployment.
      :::note
      Not for cloud environments. Because VIP-based solutions like `keepalived` or `vip-manager` may not works in such environments.
    :::

    Optionally, check the box for "HAProxy load balancer". Choose where to install β€” on DB servers or dedicated ones.

    

    :::tip
    This feature supports load balancing for read operations, facilitating effective scale-out strategies through the use of read-only replicas.
    See the details on the [Architecture](https://postgresql-cluster.org/overview/architecture#2-postgresql-high-availability-with-load-balancing) page
    :::

    Choose which environment your database cluster belongs to.

    

    Specify a name for your cluster.

    

    Optionally, specify a description.

    

    Select the PostgreSQL version to install.

    

    Optionally, specify the custom path to the data directory.

    


    Specify the desired database name, username, and user password.

    

    Optionally, specify connection pools for your databases, its size and mode.

    

    :::info Available pool modes
      - **session** - Server is released back to pool after client disconnects.
      - **transaction** - Server is released back to pool after transaction finishes. Recomended.
      - **statement** - Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
    :::

    Enable the necessary extensions for your databases.

    

    :::tip
    This list includes all contrib extensions and some popular third-party ones. However, [more than 400 extensions are available](/docs/extensions/list). \
    To install others, specify the [installation parameters](/docs/extensions/install) manually on the **YAML** tab.
    :::

    Configure backup settings.

    

    :::info
    Click **Configure** button and specify them in the usual key=value format.
      :::note
      For pgBackRest, you can specify the global section options β€” the stanza section will be populated automatically.
    :::

    Optionally, specify the Postgres and kernel parameters.

    

    :::info
    By default, Autobase automatically configures these parameters. See the default settings for [Postgres](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L331) and the [kernel](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml#L889). \
    If you prefer to set the parameters manually, click **Configure** button and specify them in the usual key=value format.
    :::

    Example for Postgres parameters:

    

    Example for Kernel parameters:

    

    Optionally, specify the Additional settings.

    

    :::tip
    Use the hint (?) icon for a more detailed description of each option.
    :::

    Review the summary and click the "Create Cluster" button.

    
  </TabItem>

{/* ===== INTERNAL TAB: YAML ===== */}
  <TabItem value="yaml" label="YAML tab">
    The YAML editor allows you to specify any parameters that were previously available only in command-line mode. \
    Designed for experienced users.

    :::info
    To use the **YAML** tab, go to the **Settings** page and turn on β€œEnable expert mode” and β€œEnable YAML editor”.
    :::

    

    Autobase offers a wide range of functionality, and not all options can be fully represented in UI forms. That’s why we added a YAML editor β€” it allows you to set any parameters supported by Autobase. You can see available parameters [here](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml).

    Make the necessary changes and click the **"Create Cluster"** button.
  </TabItem>
</Tabs>

{/* ===== COMMON BLOCK (Basic / Expert / YAML) ===== */}

    Wait until deployment is complete. This process takes about 10 minutes.

    :::info
    You can see the deployment log in the "Operations" section. To do this, select the relevant event with the "deploy" type and click "Show details" under the Actions tab.
    :::

    :::tip
    After a successful deployment, you can obtain the connection info on the cluster page. To do this, click on the name of your cluster on the "Clusters" page.
    :::

    

    Example of a cluster page:

{/* ===== EXTERNAL TAB: Command line ===== */}

:::tip
πŸ“© Contact us at [email protected], and our team will provide you with deployment instructions tailored specifically to your infrastructure, including the most suitable parameters for optimal performance and reliability.
:::

text
#### Prepare your inventory

```
curl -fsSL \
  https://raw.githubusercontent.com/autobase-tech/autobase/refs/tags/2.10.0/automation/inventory.example \
  --output ./inventory
```

Specify IP addresses and appropriate connection settings for your environment, such as ansible_user, ansible_ssh_pass, or ansible_ssh_private_key_file.

```
nano ./inventory
```

#### Prepare your variables

Refer to the default [variables](https://github.com/autobase-tech/autobase/blob/2.10.0/automation/roles/common/defaults/main.yml) for all configurable options. Override them as needed using group_vars, host_vars, or directly in the inventory file. 

```
mkdir -p ./group_vars
nano ./group_vars/all.yml
```

#### Run the deployment command

```
docker run --rm -it \
  -e ANSIBLE_SSH_ARGS="-F none" \
  -e ANSIBLE_INVENTORY=/project/inventory \
  -v $PWD:/project \
  -v $HOME/.ssh:/root/.ssh \
  autobase/automation:2.10.0 \
    ansible-playbook deploy_pgcluster.yml
```

Alternatively, you can use [Ansible Collection](https://github.com/autobase-tech/autobase/blob/main/automation/README.md)

#### Wait until deployment is complete

This process takes about 10 to 15 minutes.

:::tip
After a successful deployment, the connection information can be found in the Ansible log.
:::

#### How to start from scratch:

If you need to start from scratch, you can use the `remove_cluster.yml` playbook.


Click here to expand...

Run the following command to remove the specified components:

```
docker run --rm -it \
  -e ANSIBLE_SSH_ARGS="-F none" \
  -e ANSIBLE_INVENTORY=/project/inventory \
  -v $PWD:/project \
  -v $HOME/.ssh:/root/.ssh \
  autobase/automation:2.10.0 \
    ansible-playbook remove_cluster.yml -e "remove_postgres=true remove_etcd=true"
```

This command will delete the specified components, allowing you to start a new installation.

Available variables:
- `remove_postgres`: stop the PostgreSQL service and remove data.
- `remove_etcd`: stop the ETCD service and remove data.
- `remove_consul`: stop the Consul service and remove data.

:::warning
**Caution:** be careful when running this command in a production environment.
:::



:::info
We also support converting standalone PostgreSQL installation into a high-availability cluster. If you want to upgrade your current PostgreSQL setup to a clustered configuration, simply set `postgresql_exists=true` in the inventory file.
:::note
Please note that during the cluster setup process, your existing PostgreSQL service will be automatically restarted, leading to a brief period of database downtime. Plan this transition accordingly.
:::

File: docs/management/backup.md


Backup

Configure database backups

Console (UI)

When deploying to cloud providers (such as AWS, GCP, Azure) using the Console UI, the storage bucket and backups with pgBackRest are automatically configured.

:::note
Both DigitalOcean and Hetzner Cloud require providing access keys for the bucket. This option is available in Expert Mode.
:::

  • Backup schedule: Full backups every Sunday at 3:00 AM; differential backups Monday through Saturday at 3:00 AM.
  • Backup retention: 4 full backups (1 month).
  • Config path: /etc/pgbackrest/pgbackrest.conf
  • Log path: /var/log/pgbackrest
  • Cron job path: /etc/cron.d/pgbackrest-<cluster_name>

:::info
Backup configuration changes after deployment are currently supported only through the command line.
:::

Command line

:::note
When deploying to cloud providers (cloud_provider variable) such as AWS, GCP, Azure, the storage bucket and backups with pgBackRest are automatically configured, controlled by the pgbackrest_auto_conf variable (specify false if you prefer to manually configure the backup).
:::

The following backup tools are supported:

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:::tip
pgBackRest documentation: Configuration Reference
:::

To use pgBackRest, specify the pgbackrest_install: true variable.

Examples of configuration variables:

pgbackrest config ("posix" ssh mode)

text
/* Detailed source-code truncated for AI context efficiency. */

Additionally specify the IP address of the backup server (in this example "10.128.64.110") in the inventory in the "pgbackrest" group.

pgbackrest config (Minio S3)

text
/* Detailed source-code truncated for AI context efficiency. */

pgbackrest config (AWS S3)

text
/* Detailed source-code truncated for AI context efficiency. */

pgbackrest config (Hetzner S3)

text
/* Detailed source-code truncated for AI context efficiency. */

pgbackrest config (GCS)

text
/* Detailed source-code truncated for AI context efficiency. */

pgbackrest config (Azure Blob Storage)

text
/* Detailed source-code truncated for AI context efficiency. */

cron jobs config

yaml
# By default, the cron jobs is created on the database server.
# If 'repo_host' is defined, the cron jobs will be created on the pgbackrest server.
pgbackrest_cron_jobs:
  - name: "pgBackRest: Full Backup"
    file: "/etc/cron.d/pgbackrest-{{ patroni_cluster_name }}"
    user: "postgres"
    minute: "00"
    hour: "3"
    day: "*"
    month: "*"
    weekday: "0"
    job: "if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then pgbackrest --stanza={{ pgbackrest_stanza }} --type=full backup; fi"
  - name: "pgBackRest: Diff Backup"
    file: "/etc/cron.d/pgbackrest-{{ patroni_cluster_name }}"
    user: "postgres"
    minute: "00"
    hour: "3"
    day: "*"
    month: "*"
    weekday: "1-6"
    job: "if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then pgbackrest --stanza={{ pgbackrest_stanza }} --type=diff backup; fi"
  - name: "pgBackRest: Incr Backup"
    file: "/etc/cron.d/pgbackrest-{{ patroni_cluster_name }}"
    user: "postgres"
    minute: "00"
    hour: "*/4"
    day: "*"
    month: "*"
    weekday: "1-6"
    job: "if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then pgbackrest --stanza={{ pgbackrest_stanza }} --type=incr backup; fi"

:::tip
WAL-G documentation
:::

To use WAL-G, specify the wal_g_install: true variable.

Examples of configuration variables:

wal-g config (Minio S3)

yaml
# An example of a configuration using S3 (Minio)

wal_g_install: true
wal_g_version: "3.0.5"
wal_g_path: "/usr/local/bin/wal-g --config {{ postgresql_home_dir }}/.walg.json"
wal_g_json:
  - { option: "AWS_ACCESS_KEY_ID", value: "YOUR_MINIO_ACCESS_KEY_ID" }  # change this value
  - { option: "AWS_SECRET_ACCESS_KEY", value: "YOUR_MINIO_SECRET_ACCESS_KEY" }  # change this value
  - { option: "AWS_ENDPOINT", value: "http://YOUR_MINIO_ADDRESS:9000" }  # change this value
  - { option: "AWS_S3_FORCE_PATH_STYLE", value: "true" }
  - { option: "WALG_S3_PREFIX", value: "s3://YOUR_MINIO_BUCKET" }  # change this value
  - { option: "WALG_COMPRESSION_METHOD", value: "brotli" }  # or "lz4", "lzma", "zstd"
  - { option: "WALG_DELTA_MAX_STEPS", value: "6" }  # determines how many delta backups can be between full backups
  - { option: "WALG_UPLOAD_CONCURRENCY", value: "2" }
  - { option: "WALG_UPLOAD_DISK_CONCURRENCY", value: "2" }
  - { option: "WALG_DOWNLOAD_CONCURRENCY", value: "4" }
  - { option: "WALG_ALIVE_CHECK_INTERVAL", value: "1m" }
  - { option: "PGDATA", value: "{{ postgresql_data_dir }}" }
  - { option: "PGHOST", value: "{{ postgresql_unix_socket_dir }}" }
  - { option: "PGPORT", value: "{{ postgresql_port }}" }
  - { option: "PGUSER", value: "{{ patroni_superuser_username }}" }

wal_g_archive_command: "{{ wal_g_path }} wal-push %p"

wal-g config (AWS S3)

yaml
# An example of a configuration using AWS S3

wal_g_install: true
wal_g_version: "3.0.5"
wal_g_path: "/usr/local/bin/wal-g --config {{ postgresql_home_dir }}/.walg.json"
wal_g_json:
  - { option: "AWS_ACCESS_KEY_ID", value: "YOUR_AWS_ACCESS_KEY_ID" }  # change this value
  - { option: "AWS_SECRET_ACCESS_KEY", value: "YOUR_AWS_SECRET_ACCESS_KEY" }  # change this value
  - { option: "AWS_REGION", value: "YOUR_AWS_REGION" }  # change this value (e.g., us-east-1)
  - { option: "WALG_S3_PREFIX", value: "s3://YOUR_AWS_BUCKET" }  # change this value
  - { option: "WALG_COMPRESSION_METHOD", value: "brotli" }  # or "lz4", "lzma", "zstd"
  - { option: "WALG_DELTA_MAX_STEPS", value: "6" }  # determines how many delta backups can be between full backups
  - { option: "WALG_UPLOAD_CONCURRENCY", value: "2" }
  - { option: "WALG_UPLOAD_DISK_CONCURRENCY", value: "2" }
  - { option: "WALG_DOWNLOAD_CONCURRENCY", value: "4" }
  - { option: "WALG_ALIVE_CHECK_INTERVAL", value: "1m" }
  - { option: "PGDATA", value: "{{ postgresql_data_dir }}" }
  - { option: "PGHOST", value: "{{ postgresql_unix_socket_dir }}" }
  - { option: "PGPORT", value: "{{ postgresql_port }}" }
  - { option: "PGUSER", value: "{{ patroni_superuser_username }}" }

wal_g_archive_command: "{{ wal_g_path }} wal-push %p"

wal-g config (Hetzner S3)

yaml
# An example of a configuration using Hetzner Object Storage (S3 bucket)

wal_g_install: true
wal_g_version: "3.0.5"
wal_g_path: "/usr/local/bin/wal-g --config {{ postgresql_home_dir }}/.walg.json"
wal_g_json:
  - { option: "AWS_ACCESS_KEY_ID", value: "YOUR_ACCESS_KEY" }  # change this value
  - { option: "AWS_SECRET_ACCESS_KEY", value: "YOUR_SECRET_KEY" }  # change this value
  - { option: "AWS_ENDPOINT", value: "https://fsn1.your-objectstorage.com" }  # change this value (region)
  - { option: "AWS_REGION", value: "fsn1" }  # change this value
  - { option: "WALG_S3_PREFIX", value: "s3://YOUR_BUCKET_NAME" }  # change this value
  - { option: "AWS_S3_FORCE_PATH_STYLE", value: "true" }
  - { option: "WALG_COMPRESSION_METHOD", value: "brotli" }  # or "lz4", "lzma", "zstd"
  - { option: "WALG_DELTA_MAX_STEPS", value: "6" }  # determines how many delta backups can be between full backups
  - { option: "WALG_UPLOAD_CONCURRENCY", value: "2" }
  - { option: "WALG_UPLOAD_DISK_CONCURRENCY", value: "2" }
  - { option: "WALG_DOWNLOAD_CONCURRENCY", value: "4" }
  - { option: "WALG_ALIVE_CHECK_INTERVAL", value: "1m" }
  - { option: "PGDATA", value: "{{ postgresql_data_dir }}" }
  - { option: "PGHOST", value: "{{ postgresql_unix_socket_dir }}" }
  - { option: "PGPORT", value: "{{ postgresql_port }}" }
  - { option: "PGUSER", value: "{{ patroni_superuser_username }}" }

wal_g_archive_command: "{{ wal_g_path }} wal-push %p"

wal-g config (GCS)

yaml
# An example of a configuration using GCS

wal_g_install: true
wal_g_version: "3.0.5"
wal_g_path: "/usr/local/bin/wal-g --config {{ postgresql_home_dir }}/.walg.json"
wal_g_json:
  - { option: "GOOGLE_APPLICATION_CREDENTIALS", value: "{{ postgresql_home_dir }}/gcs-key.json" }  # change this value (path to GCS service account key file)
  - { option: "WALG_GS_PREFIX", value: "gs://YOUR_GCS_BUCKET" }  # change this value
  - { option: "WALG_COMPRESSION_METHOD", value: "brotli" }  # or "lz4", "lzma", "zstd"
  - { option: "WALG_DELTA_MAX_STEPS", value: "6" }  # determines how many delta backups can be between full backups
  - { option: "WALG_UPLOAD_CONCURRENCY", value: "2" }
  - { option: "WALG_UPLOAD_DISK_CONCURRENCY", value: "2" }
  - { option: "WALG_DOWNLOAD_CONCURRENCY", value: "4" }
  - { option: "WALG_ALIVE_CHECK_INTERVAL", value: "1m" }
  - { option: "PGDATA", value: "{{ postgresql_data_dir }}" }
  - { option: "PGHOST", value: "{{ postgresql_unix_socket_dir }}" }
  - { option: "PGPORT", value: "{{ postgresql_port }}" }
  - { option: "PGUSER", value: "{{ patroni_superuser_username }}" }

wal_g_archive_command: "{{ wal_g_path }} wal-push %p"

wal-g config (Azure Blob Storage)

yaml
# An example of a configuration using Azure Blob Storage

wal_g_install: true
wal_g_version: "3.0.5"
wal_g_path: "/usr/local/bin/wal-g --config {{ postgresql_home_dir }}/.walg.json"
wal_g_json:
  - { option: "AZURE_STORAGE_ACCOUNT", value: "YOUR_AZURE_STORAGE_ACCOUNT" }  # change this value
  - { option: "AZURE_STORAGE_ACCESS_KEY", value: "YOUR_AZURE_STORAGE_ACCOUNT_KEY" }  # change this value
  - { option: "WALG_AZ_PREFIX", value: "azure://YOUR_AZURE_STORAGE_CONTAINER" }  # change this value
  - { option: "WALG_COMPRESSION_METHOD", value: "brotli" }  # or "lz4", "lzma", "zstd"
  - { option: "WALG_DELTA_MAX_STEPS", value: "6" }  # determines how many delta backups can be between full backups
  - { option: "WALG_UPLOAD_CONCURRENCY", value: "2" }
  - { option: "WALG_UPLOAD_DISK_CONCURRENCY", value: "2" }
  - { option: "WALG_DOWNLOAD_CONCURRENCY", value: "4" }
  - { option: "WALG_ALIVE_CHECK_INTERVAL", value: "1m" }
  - { option: "PGDATA", value: "{{ postgresql_data_dir }}" }
  - { option: "PGHOST", value: "{{ postgresql_unix_socket_dir }}" }
  - { option: "PGPORT", value: "{{ postgresql_port }}" }
  - { option: "PGUSER", value: "{{ patroni_superuser_username }}" }

wal_g_archive_command: "{{ wal_g_path }} wal-push %p"

cron jobs config

yaml
# Define job_parts outside of wal_g_cron_jobs
# Ensure there is a space at the beginning of each part to prevent commands from concatenating.
wal_g_backup_command:
  - "curl -I -s http://{{ inventory_hostname }}:{{ patroni_restapi_port }} | grep 200"
  - " && {{ wal_g_path }} backup-push {{ postgresql_data_dir }} > {{ postgresql_log_dir }}/walg_backup.log 2>&1"
wal_g_delete_command:
  - "curl -I -s http://{{ inventory_hostname }}:{{ patroni_restapi_port }} | grep 200"
  - " && {{ wal_g_path }} delete retain FULL 4 --confirm > {{ postgresql_log_dir }}/walg_delete.log 2>&1"

wal_g_cron_jobs:
  - name: "WAL-G: Create daily backup"
    user: "postgres"
    file: /etc/cron.d/walg
    minute: "00"
    hour: "3"
    day: "*"
    month: "*"
    weekday: "*"
    job: "{{ wal_g_backup_command | join('') }}"
  - name: "WAL-G: Delete old backups"
    user: "postgres"
    file: /etc/cron.d/walg
    minute: "30"
    hour: "6"
    day: "*"
    month: "*"
    weekday: "*"
    job: "{{ wal_g_delete_command | join('') }}"