Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 23. Installing and configuring PostgreSQL by using RHEL system roles
As a system administrator, you can use the postgresql
RHEL system role to install, configure, manage, start, and improve performance of the PostgreSQL server.
23.1. Introduction to the postgresql
RHEL system role
To install, configure, manage, and start the PostgreSQL server using Ansible, you can use the postgresql
RHEL system role.
You can also use the postgresql
role to optimize the database server settings and improve performance.
The role supports the currently released and supported versions of PostgreSQL on RHEL 8 and RHEL 9 managed nodes.
23.2. Configuring the PostgreSQL server by using the postgresql
RHEL system role
You can use the postgresql
RHEL system role to install, configure, manage, and start the PostgreSQL server.
The postgresql
role replaces PostgreSQL configuration files in the /var/lib/pgsql/data/
directory on the managed hosts. Previous settings are changed to those specified in the role variables, and lost if they are not specified in the role variables.
Prerequisites
- You have prepared the control node and the managed nodes.
- You are logged in to the control node as a user who can run playbooks on the managed nodes.
-
The account you use to connect to the managed nodes has
sudo
permissions on them.
Procedure
Create a playbook file, for example
~/playbook.yml
, with the following content:--- - name: Manage PostgreSQL hosts: managed-node-01.example.com roles: - rhel-system-roles.postgresql vars: postgresql_version: "13"
Validate the playbook syntax:
$ ansible-playbook --syntax-check ~/playbook.yml
Note that this command only validates the syntax and does not protect against a wrong but valid configuration.
Run the playbook:
$ ansible-playbook ~/playbook.yml
Additional resources
-
/usr/share/ansible/roles/rhel-system-roles.postgresql/README.md
file -
/usr/share/doc/rhel-system-roles/postgresql/
directory - Using PostgreSQL