Ansible has several modules and collections that can be used for database maintenance, upgrade, and patching tasks. However, please note that the landscape of Ansible modules and collections may have evolved since then. Always refer to the official Ansible documentation and the Ansible Galaxy website for the most up-to-date information. Here are some modules and collections that were relevant as of my last update:
Modules for Database Maintenance, Upgrade, and Patching:
- MySQL Modules:
mysql_db
: Create, delete, or modify MySQL databases.mysql_user
: Manage MySQL users and their privileges.mysql_replication
: Manage MySQL replication configuration.
- PostgreSQL Modules:
postgresql_db
: Manage PostgreSQL databases.postgresql_user
: Manage PostgreSQL users and their privileges.
- MongoDB Modules:
mongodb_user
: Manage MongoDB users and their privileges.mongodb_database
: Manage MongoDB databases.
- Oracle Modules:
oracle_db
: Manage Oracle databases (community-contributed module).
- Common Modules:
command
andshell
: Execute arbitrary commands and scripts, which can be used for running database maintenance scripts or custom tasks.systemd
: Manage the status of systemd services, useful for starting, stopping, or restarting database services.
Collections for Database Maintenance, Upgrade, and Patching:
- Community Collections:
- PostgreSQL Collection: Includes various modules and roles for PostgreSQL database management, maintenance, and configuration.
- MySQL Collection: Contains roles and modules for managing MySQL databases, users, and configurations.
- MongoDB Collection: Provides roles and modules to manage MongoDB instances, databases, and users.
- Red Hat Collections:
- redhat.rhsa_ansible_collections.os_linux: This collection includes modules and plugins for interacting with the Red Hat Security Data API to get information about security vulnerabilities and patches.
Database modules
Aerospike
Influxdb
Misc
Mongodb
Mssql
Mysql
Postgresql
- postgresql_db – Add or remove PostgreSQL databases from a remote host
- postgresql_ext – Add or remove PostgreSQL extensions from a database
- postgresql_idx – Create or drop indexes from a PostgreSQL database
- postgresql_info – Gather information about PostgreSQL servers
- postgresql_lang – Adds, removes or changes procedural languages with a PostgreSQL database
- postgresql_membership – Add or remove PostgreSQL roles from groups
- postgresql_owner – Change an owner of PostgreSQL database object
- postgresql_pg_hba – Add, remove or modify a rule in a pg_hba file
- postgresql_ping – Check remote PostgreSQL server availability
- postgresql_privs – Grant or revoke privileges on PostgreSQL database objects
- postgresql_query – Run PostgreSQL queries
- postgresql_schema – Add or remove PostgreSQL schema
- postgresql_set – Change a PostgreSQL server configuration parameter
- postgresql_slot – Add or remove slots from a PostgreSQL database
- postgresql_table – Create, drop, or modify a PostgreSQL table
- postgresql_tablespace – Add or remove PostgreSQL tablespaces from remote hosts
- postgresql_user – Add or remove a user (role) from a PostgreSQL server instance
Proxysql
- proxysql_backend_servers – Adds or removes mysql hosts from proxysql admin interface
- proxysql_global_variables – Gets or sets the proxysql global variables
- proxysql_manage_config – Writes the proxysql configuration settings between layers
- proxysql_mysql_users – Adds or removes mysql users from proxysql admin interface
- proxysql_query_rules – Modifies query rules using the proxysql admin interface
- proxysql_replication_hostgroups – Manages replication hostgroups using the proxysql admin interface
- proxysql_scheduler – Adds or removes schedules from proxysql admin interface
Vertica
- vertica_configuration – Updates Vertica configuration parameters
- vertica_facts – Gathers Vertica database facts
- vertica_role – Adds or removes Vertica database roles and assigns roles to them
- vertica_schema – Adds or removes Vertica database schema and roles
- vertica_user – Adds or removes Vertica database users and assigns roles
Oracle
- https://galaxy.ansible.com/ari_stark/ansible_oracle_modules
- https://github.com/oravirt/ansible-oracle-modules
- https://github.com/oracle/oci-ansible-collection
- https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/ansible.htm
- https://github.com/oracle/oci-ansible-collection
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024