Inventory
Each Pigsty deployment has an inventory that describes the infrastructure and database clusters.
Configuration File
By default, Pigsty uses Ansible YAML configuration format. The inventory is a single file, pigsty.yml.
Edit this file to customize the deployment. Alternatively, use the configure wizard to generate it automatically.
Configuration Structure
The inventory uses Ansible YAML configuration format. It contains global parameters in all.vars and groups in all.children.
Define clusters in all.children. Define infrastructure settings in all.vars, as this example shows:
Cluster Definition
Each Ansible group can represent a cluster. Examples include node, PostgreSQL, Redis, Etcd, and Silo clusters.
A cluster definition contains members (hosts) and parameters (vars). Define members in <cls>.hosts. Set configuration parameters in <cls>.vars. This example defines a three-node HA PostgreSQL cluster:
Cluster vars override global parameters. Instance vars override both cluster and global parameters.
Splitting Configuration
For a large deployment, you can split the inventory into multiple files. This can also help organize and maintain configuration.
Put cluster members in hosts.yml. Put cluster configuration parameters in the corresponding files under group_vars.
Switching Configuration
When you run a playbook, use -i to temporarily select a different inventory.
Ansible also accepts local yaml|ini configuration files, a CMDB, or other dynamic configuration scripts.
The ansible.cfg file in the Pigsty home directory sets the default inventory to pigsty.yml in that directory. You can change this setting.
You can store the inventory in a CMDB metabase to integrate it with existing systems.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)