gcspanner – Create and Delete Instances/Databases on Spanner¶
New in version 2.3.
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
-
/ required
|
Configuration the instance should use.
Examples are us-central1, asia-east1 and europe-west1.
|
|
database_name
-
|
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
-
|
Name of Instance to display.
If not specified, instance_id will be used instead.
|
|
instance_id
-
/ required
|
GCP spanner instance name.
|
|
node_count
-
|
Default: 1
|
Number of nodes in the instance.
|
state
-
|
|
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. |
Examples¶
- name: Create instance
gcspanner:
instance_id: '{{ instance_id }}'
configuration: '{{ configuration }}'
state: present
node_count: 1
- name: Create database
gcspanner:
instance_id: '{{ instance_id }}'
configuration: '{{ configuration }}'
database_name: '{{ database_name }}'
state: present
- name: Delete instance (and all databases)
- 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 is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Tom Melendez (@supertom) <tom@supertom.com>
Hint
If you notice any issues in this documentation you can edit this document to improve it.