Using Ansible
Using the AlloyDB Omni orchestrator CLI
Before you begin
Before you begin, create your cluster.
Ansible
To get your cluster's status using Ansible, complete the following instructions:
Create an Ansible playbook for the
google.alloydbomni_orchestrator.statusrole.- name: STATUS_PLAYBOOK_NAME hosts: localhost vars: ansible_become: true ansible_user: ANSIBLE_USER ansible_ssh_private_key_file: ANSIBLE_SSH_PRIVATE_KEY_FILE roles: - role: google.alloydbomni_orchestrator.statusReplace the following variables:
STATUS_PLAYBOOK_NAME: name of your Ansible playbook. For example,My cluster status.ANSIBLE_USER: OS user that Ansible uses to log into your AlloyDB Omni nodes.ANSIBLE_SSH_PRIVATE_KEY_FILE: private key Ansible uses to connect to your AlloyDB Omni nodes using SSH.
Run the playbook.
ansible-playbook STATUS_PLAYBOOK_PATH -i DEPLOYMENT_SPECIFICATION_PATH \ -e resource_type="RESOURCE_TYPE" -e resource_name=RESOURCE_NAMEReplace the following variables:
STATUS_PLAYBOOK_PATH: path to the playbook that you created in step one.DEPLOYMENT_SPECIFICATION_PATH: path to the deployment specification you created in Install AlloyDB Omni components.RESOURCE_TYPE: resource type you want the status of. For example, this could beDBClusterorPgBouncer.(Optional)
RESOURCE_NAME: name of the resource that you want the status of. For example, this could be the name of theDBClusterorPgBouncerresource.
AlloyDB Omni orchestrator CLI
To get your cluster's status using the AlloyDB Omni orchestrator
CLI, run the following alloydbctl command:
alloydbctl get -d DEPLOYMENT_SPECIFICATION_PATH_PATH -t RESOURCE_TYPE -n RESOURCE_NAMEReplace the following variables:
DEPLOYMENT_SPECIFICATION_PATH_PATH: path to the deployment specification you created in Install AlloyDB Omni components.RESOURCE_TYPE: resource type you want the status of. For example, this could beDBClusterorPgBouncer.(Optional)
RESOURCE_NAME: name of the resource that you want the status of. For example, this could be the name of theDBClusterorPgBouncerresource.