Version v1.5.1 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.
CMDB Usage
Instead of a static config file, you can use postgres as an inventory for Pigsty.
Using CMDB as a dynamic Inventory for Ansible has several advantages: metadata is presented as data tables in a highly structured way, and database constraints ensure consistency. The CMDB also allows you to use third-party tools to manage Pigsty metadata.
Currently, Pigsty’s CMDB only supports PostgreSQL clusters. If your pigsty.yml contains Redis and MatrixDB, it will report an error. It is recommended to use a separate pigsty.yml config file to manage Redis and Greenplum clusters.
The Pigsty CMDBmode is automatically created during the initialization of the pg-meta meta DB (files/cmdb.sql) and is located in the meta database’s pigsty mode of the meta DB. Static config files can be loaded into the CMDB using bin/inventory_load.
You must execute infra.yml entirely in the meta node after installation before you can use CMDB.
By default, executing the script without parameters will load $PIGSTY_HOME/pigsty.yml into the CMDB under the name pgsql.
CMDB as Inventory
Once the original config file is loaded into the CMDB as the initial data, Ansible can be configured to use the CMDB as the inventory.
You can switch back to a static config file.
Modifying the inventory is essentially a matter of editing ansible. cfg in the Pigsty dir.