community.general.gcspanner – Create and Delete Instances/Databases on Spanner
Note
This plugin is part of the community.general collection (version 1.3.2).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.gcspanner
.
DEPRECATED
- Removed in
-
version 2.0.0
- Why
-
Updated modules released with increased functionality
- Alternative
-
Use google.cloud.gcp_spanner_database and/or google.cloud.gcp_spanner_instance instead.
Synopsis
- Create and Delete Instances/Databases on Spanner. See https://cloud.google.com/spanner/docs for an overview.
Requirements
The below requirements are needed on the host that executes this module.
- python >= 2.6
- google-auth >= 0.5.0
- google-cloud-spanner >= 0.23.0
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
configuration string / required | Configuration the instance should use. Examples are us-central1, asia-east1 and europe-west1. | |
credentials_file string | path to the JSON file associated with the service account email | |
database_name string | Name of database contained on the instance. | |
force_instance_delete boolean |
| To delete an instance, this argument must exist and be true (along with state being equal to absent). |
instance_display_name string | Name of Instance to display. If not specified, instance_id will be used instead. | |
instance_id string / required | GCP spanner instance name. | |
node_count integer | Default: 1 | Number of nodes in the instance. |
project_id string | your GCE project ID | |
service_account_email string | service account email | |
state string |
| State of the instance or database. Applies to the most granular resource. If a database_name is specified we remove it.If only instance_id is specified, that is what is removed. |
Notes
Note
- Changing the configuration on an existing instance is not supported.
Examples
- name: Create instance community.general.gcspanner: instance_id: '{{ instance_id }}' configuration: '{{ configuration }}' state: present node_count: 1 - name: Create database community.general.gcspanner: instance_id: '{{ instance_id }}' configuration: '{{ configuration }}' database_name: '{{ database_name }}' state: present - name: Delete instance (and all databases) - community.general.gcspanner: instance_id: '{{ instance_id }}' configuration: '{{ configuration }}' state: absent force_instance_delete: yes
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
database_name string | When database name is specified | Name of database. Sample: mydatabase |
instance_id string | Always | Name of instance. Sample: myinstance |
previous_values dictionary | When an instance update has occurred and a field has been modified. | List of dictionaries containing previous values prior to update. Sample: 'previous_values': { 'instance': { 'instance_display_name': 'my-instance', 'node_count': 1 } } |
state string | Always | The state of the instance or database. Value will be either 'absent' or 'present'. Sample: present |
updated boolean | When an update has occurred. | Boolean field to denote an update has occurred. Sample: True |
Status
- This module will be removed in version 2.0.0. [deprecated]
- For more information see DEPRECATED.
Authors
- Tom Melendez (@supertom) <tom@supertom.com>
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/gcspanner_module.html