mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 04:10:27 -07:00
Pubsub + DNS Facts (#75)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
cec7d597fc
commit
2a6c1e408e
29 changed files with 366 additions and 315 deletions
|
@ -131,7 +131,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -213,7 +213,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -234,7 +234,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -126,7 +126,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -178,7 +178,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -302,7 +302,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -148,7 +148,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -148,7 +148,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -290,7 +290,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -472,7 +472,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -151,7 +151,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -151,7 +151,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -115,7 +115,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -153,7 +153,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -109,7 +109,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -132,7 +132,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -128,7 +128,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -114,7 +114,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -210,7 +210,11 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
filters=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
|
||||||
|
|
|
@ -18,123 +18,91 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Documentation
|
# Documentation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'}
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
|
'status': ["preview"],
|
||||||
|
'supported_by': 'community'}
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: gcp_dns_managed_zone_facts
|
module: gcp_dns_managed_zone_facts
|
||||||
description:
|
description:
|
||||||
- Gather facts for GCP ManagedZone
|
- Gather facts for GCP ManagedZone
|
||||||
short_description: Gather facts for GCP ManagedZone
|
short_description: Gather facts for GCP ManagedZone
|
||||||
version_added: 2.8
|
version_added: 2.7
|
||||||
author: Google Inc. (@googlecloudplatform)
|
author: Google Inc. (@googlecloudplatform)
|
||||||
requirements:
|
requirements:
|
||||||
- python >= 2.6
|
- python >= 2.6
|
||||||
- requests >= 2.18.4
|
- requests >= 2.18.4
|
||||||
- google-auth >= 1.3.0
|
- google-auth >= 1.3.0
|
||||||
options:
|
options:
|
||||||
dns_name:
|
dns_name:
|
||||||
description:
|
description:
|
||||||
- Restricts the list to return only zones with this domain name.
|
Restricts the list to return only zones with this domain name.
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: " a managed zone facts"
|
- name: a managed zone facts
|
||||||
gcp_dns_managed_zone_facts:
|
gcp_dns_managed_zone_facts:
|
||||||
dns_name: test.somewild2.example.com.
|
dns_name: test.somewild2.example.com.
|
||||||
project: test_project
|
project: test_project
|
||||||
auth_kind: serviceaccount
|
auth_kind: serviceaccount
|
||||||
service_account_file: "/tmp/auth.pem"
|
service_account_file: "/tmp/auth.pem"
|
||||||
state: facts
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
items:
|
items:
|
||||||
description: List of items
|
description: List of items
|
||||||
returned: always
|
returned: always
|
||||||
type: complex
|
type: complex
|
||||||
contains:
|
contains:
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- A mutable string of at most 1024 characters associated with this resource
|
- A mutable string of at most 1024 characters associated with this resource for the
|
||||||
for the user's convenience. Has no effect on the managed zone's function.
|
user's convenience. Has no effect on the managed zone's function.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
dnsName:
|
dns_name:
|
||||||
description:
|
description:
|
||||||
- The DNS name of this managed zone, for instance "example.com.".
|
- The DNS name of this managed zone, for instance "example.com.".
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
id:
|
id:
|
||||||
description:
|
description:
|
||||||
- Unique identifier for the resource; defined by the server.
|
- Unique identifier for the resource; defined by the server.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- User assigned name for this resource.
|
- User assigned name for this resource.
|
||||||
- Must be unique within the project.
|
- Must be unique within the project.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
nameServers:
|
name_servers:
|
||||||
description:
|
description:
|
||||||
- Delegate your managed_zone to these virtual name servers; defined by the server
|
- Delegate your managed_zone to these virtual name servers; defined by the server
|
||||||
.
|
.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
nameServerSet:
|
name_server_set:
|
||||||
description:
|
description:
|
||||||
- Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet
|
- Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is
|
||||||
is a set of DNS name servers that all host the same ManagedZones. Most users
|
a set of DNS name servers that all host the same ManagedZones. Most users will leave
|
||||||
will leave this field unset.
|
this field unset.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: list
|
||||||
creationTime:
|
creation_time:
|
||||||
description:
|
description:
|
||||||
- The time that this resource was created on the server.
|
- The time that this resource was created on the server.
|
||||||
- This is in RFC3339 text format.
|
- This is in RFC3339 text format.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
labels:
|
|
||||||
description:
|
|
||||||
- A set of key/value label pairs to assign to this ManagedZone.
|
|
||||||
returned: success
|
|
||||||
type: dict
|
|
||||||
visibility:
|
|
||||||
description:
|
|
||||||
- 'The zone''s visibility: public zones are exposed to the Internet, while private
|
|
||||||
zones are visible only to Virtual Private Cloud resources.'
|
|
||||||
- 'Must be one of: `public`, `private`.'
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
privateVisibilityConfig:
|
|
||||||
description:
|
|
||||||
- For privately visible zones, the set of Virtual Private Cloud resources that
|
|
||||||
the zone is visible from.
|
|
||||||
returned: success
|
|
||||||
type: complex
|
|
||||||
contains:
|
|
||||||
networks:
|
|
||||||
description:
|
|
||||||
- The list of VPC networks that can see this zone.
|
|
||||||
returned: success
|
|
||||||
type: complex
|
|
||||||
contains:
|
|
||||||
networkUrl:
|
|
||||||
description:
|
|
||||||
- The fully qualified URL of the VPC network to bind to.
|
|
||||||
- This should be formatted like `U(https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`)
|
|
||||||
.
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -149,9 +117,13 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(dns_name=dict(type='list', elements='str')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
dns_name=dict(type='list', elements='str')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if 'scopes' not in module.params:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/ndev.clouddns.readwrite']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/ndev.clouddns.readwrite']
|
||||||
|
|
||||||
items = fetch_list(module, collection(module), module.params['dns_name'])
|
items = fetch_list(module, collection(module), module.params['dns_name'])
|
||||||
|
@ -159,7 +131,9 @@ def main():
|
||||||
items = items.get('managedZones')
|
items = items.get('managedZones')
|
||||||
else:
|
else:
|
||||||
items = []
|
items = []
|
||||||
return_value = {'items': items}
|
return_value = {
|
||||||
|
'items': items
|
||||||
|
}
|
||||||
module.exit_json(**return_value)
|
module.exit_json(**return_value)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,81 +18,78 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Documentation
|
# Documentation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'}
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
|
'status': ["preview"],
|
||||||
|
'supported_by': 'community'}
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: gcp_dns_resource_record_set_facts
|
module: gcp_dns_resource_record_set_facts
|
||||||
description:
|
description:
|
||||||
- Gather facts for GCP ResourceRecordSet
|
- Gather facts for GCP ResourceRecordSet
|
||||||
short_description: Gather facts for GCP ResourceRecordSet
|
short_description: Gather facts for GCP ResourceRecordSet
|
||||||
version_added: 2.8
|
version_added: 2.7
|
||||||
author: Google Inc. (@googlecloudplatform)
|
author: Google Inc. (@googlecloudplatform)
|
||||||
requirements:
|
requirements:
|
||||||
- python >= 2.6
|
- python >= 2.6
|
||||||
- requests >= 2.18.4
|
- requests >= 2.18.4
|
||||||
- google-auth >= 1.3.0
|
- google-auth >= 1.3.0
|
||||||
options:
|
options:
|
||||||
managed_zone:
|
managed_zone:
|
||||||
description:
|
description:
|
||||||
- Identifies the managed zone addressed by this request.
|
- Identifies the managed zone addressed by this request.
|
||||||
- 'This field represents a link to a ManagedZone resource in GCP. It can be specified
|
- Can be the managed zone name or id.
|
||||||
in two ways. First, you can place a dictionary with key ''name'' and value of
|
required: true
|
||||||
your resource''s name Alternatively, you can add `register: name-of-resource`
|
|
||||||
to a gcp_dns_managed_zone task and then set this managed_zone field to "{{ name-of-resource
|
|
||||||
}}"'
|
|
||||||
required: true
|
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: " a resource record set facts"
|
- name: a resource record set facts
|
||||||
gcp_dns_resource_record_set_facts:
|
gcp_dns_resource_record_set_facts:
|
||||||
managed_zone: "{{ managed_zone }}"
|
managed_zone: "{{ managed_zone }}"
|
||||||
project: test_project
|
project: test_project
|
||||||
auth_kind: serviceaccount
|
auth_kind: serviceaccount
|
||||||
service_account_file: "/tmp/auth.pem"
|
service_account_file: "/tmp/auth.pem"
|
||||||
state: facts
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
items:
|
items:
|
||||||
description: List of items
|
description: List of items
|
||||||
returned: always
|
returned: always
|
||||||
type: complex
|
type: complex
|
||||||
contains:
|
contains:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- For example, U(www.example.com.)
|
- For example, U(www.example.com.)
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- One of valid DNS resource types.
|
- One of valid DNS resource types.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
ttl:
|
ttl:
|
||||||
description:
|
description:
|
||||||
- Number of seconds that this ResourceRecordSet can be cached by resolvers.
|
- Number of seconds that this ResourceRecordSet can be cached by resolvers.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) .
|
- As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) .
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
managed_zone:
|
managed_zone:
|
||||||
description:
|
description:
|
||||||
- Identifies the managed zone addressed by this request.
|
- Identifies the managed zone addressed by this request.
|
||||||
returned: success
|
- Can be the managed zone name or id.
|
||||||
type: dict
|
returned: success
|
||||||
|
type: dict
|
||||||
'''
|
'''
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -107,9 +104,13 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict(managed_zone=dict(required=True, type='dict')))
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
managed_zone=dict(required=True, type='dict')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if 'scopes' not in module.params:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/ndev.clouddns.readwrite']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/ndev.clouddns.readwrite']
|
||||||
|
|
||||||
items = fetch_list(module, collection(module))
|
items = fetch_list(module, collection(module))
|
||||||
|
@ -117,13 +118,18 @@ def main():
|
||||||
items = items.get('rrsets')
|
items = items.get('rrsets')
|
||||||
else:
|
else:
|
||||||
items = []
|
items = []
|
||||||
return_value = {'items': items}
|
return_value = {
|
||||||
|
'items': items
|
||||||
|
}
|
||||||
module.exit_json(**return_value)
|
module.exit_json(**return_value)
|
||||||
|
|
||||||
|
|
||||||
def collection(module):
|
def collection(module):
|
||||||
res = {'project': module.params['project'], 'managed_zone': replace_resource_dict(module.params['managed_zone'], 'name')}
|
res = {
|
||||||
return "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managed_zone}/changes".format(**res)
|
'project': module.params['project'],
|
||||||
|
'managed_zone': replace_resource_dict(module.params['managed_zone'], 'name')
|
||||||
|
}
|
||||||
|
return "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managed_zone}/rrsets".format(**res)
|
||||||
|
|
||||||
|
|
||||||
def fetch_list(module, link):
|
def fetch_list(module, link):
|
||||||
|
|
|
@ -440,8 +440,10 @@ def decode_request(response, module):
|
||||||
|
|
||||||
|
|
||||||
def encode_request(request, module):
|
def encode_request(request, module):
|
||||||
request['topic'] = '/'.join(['projects', module.params['project'], 'topics', request['topic']])
|
request['topic'] = '/'.join(['projects', module.params['project'],
|
||||||
request['name'] = '/'.join(['projects', module.params['project'], 'subscriptions', module.params['name']])
|
'topics', module.params['topic']['name']])
|
||||||
|
request['name'] = '/'.join(['projects', module.params['project'],
|
||||||
|
'subscriptions', module.params['name']])
|
||||||
|
|
||||||
return request
|
return request
|
||||||
|
|
||||||
|
|
|
@ -18,132 +18,87 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Documentation
|
# Documentation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'}
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
|
'status': ["preview"],
|
||||||
|
'supported_by': 'community'}
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: gcp_pubsub_subscription_facts
|
module: gcp_pubsub_subscription_facts
|
||||||
description:
|
description:
|
||||||
- Gather facts for GCP Subscription
|
- Gather facts for GCP Subscription
|
||||||
short_description: Gather facts for GCP Subscription
|
short_description: Gather facts for GCP Subscription
|
||||||
version_added: 2.8
|
version_added: 2.7
|
||||||
author: Google Inc. (@googlecloudplatform)
|
author: Google Inc. (@googlecloudplatform)
|
||||||
requirements:
|
requirements:
|
||||||
- python >= 2.6
|
- python >= 2.6
|
||||||
- requests >= 2.18.4
|
- requests >= 2.18.4
|
||||||
- google-auth >= 1.3.0
|
- google-auth >= 1.3.0
|
||||||
options: {}
|
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: " a subscription facts"
|
- name: a subscription facts
|
||||||
gcp_pubsub_subscription_facts:
|
gcp_pubsub_subscription_facts:
|
||||||
project: test_project
|
project: test_project
|
||||||
auth_kind: serviceaccount
|
auth_kind: serviceaccount
|
||||||
service_account_file: "/tmp/auth.pem"
|
service_account_file: "/tmp/auth.pem"
|
||||||
state: facts
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
items:
|
items:
|
||||||
description: List of items
|
description: List of items
|
||||||
returned: always
|
returned: always
|
||||||
type: complex
|
type: complex
|
||||||
contains:
|
contains:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the subscription.
|
- Name of the subscription.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
topic:
|
topic:
|
||||||
description:
|
description:
|
||||||
- A reference to a Topic resource.
|
- A reference to a Topic resource.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
labels:
|
push_config:
|
||||||
description:
|
description:
|
||||||
- A set of key/value label pairs to assign to this Subscription.
|
- If push delivery is used with this subscription, this field is used to configure
|
||||||
returned: success
|
it. An empty pushConfig signifies that the subscriber will pull and ack messages
|
||||||
type: dict
|
using API methods.
|
||||||
pushConfig:
|
returned: success
|
||||||
description:
|
type: complex
|
||||||
- If push delivery is used with this subscription, this field is used to configure
|
contains:
|
||||||
it. An empty pushConfig signifies that the subscriber will pull and ack messages
|
push_endpoint:
|
||||||
using API methods.
|
description:
|
||||||
returned: success
|
- A URL locating the endpoint to which messages should be pushed.
|
||||||
type: complex
|
- For example, a Webhook endpoint might use "U(https://example.com/push".)
|
||||||
contains:
|
returned: success
|
||||||
pushEndpoint:
|
type: str
|
||||||
description:
|
ack_deadline_seconds:
|
||||||
- A URL locating the endpoint to which messages should be pushed.
|
description:
|
||||||
- For example, a Webhook endpoint might use "U(https://example.com/push".)
|
- This value is the maximum time after a subscriber receives a message before the
|
||||||
returned: success
|
subscriber should acknowledge the message. After message delivery but before the
|
||||||
type: str
|
ack deadline expires and before the message is acknowledged, it is an outstanding
|
||||||
attributes:
|
message and will not be delivered again during that time (on a best-effort basis).
|
||||||
description:
|
- For pull subscriptions, this value is used as the initial value for the ack deadline.
|
||||||
- Endpoint configuration attributes.
|
To override this value for a given message, call subscriptions.modifyAckDeadline
|
||||||
- Every endpoint has a set of API supported attributes that can be used
|
with the corresponding ackId if using pull. The minimum custom deadline you can
|
||||||
to control different aspects of the message delivery.
|
specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds
|
||||||
- The currently supported attribute is x-goog-version, which you can use
|
(10 minutes).
|
||||||
to change the format of the pushed message. This attribute indicates the
|
- If this parameter is 0, a default value of 10 seconds is used.
|
||||||
version of the data expected by the endpoint. This controls the shape
|
- For push delivery, this value is also used to set the request timeout for the call
|
||||||
of the pushed message (i.e., its fields and metadata). The endpoint version
|
to the push endpoint.
|
||||||
is based on the version of the Pub/Sub API.
|
- If the subscriber never acknowledges the message, the Pub/Sub system will eventually
|
||||||
- If not present during the subscriptions.create call, it will default to
|
redeliver the message.
|
||||||
the version of the API used to make such call. If not present during a
|
returned: success
|
||||||
subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get
|
type: int
|
||||||
calls will always return a valid version, even if the subscription was
|
|
||||||
created without this attribute.
|
|
||||||
- 'The possible values for this attribute are: - v1beta1: uses the push
|
|
||||||
format defined in the v1beta1 Pub/Sub API.'
|
|
||||||
- "- v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API."
|
|
||||||
returned: success
|
|
||||||
type: dict
|
|
||||||
ackDeadlineSeconds:
|
|
||||||
description:
|
|
||||||
- This value is the maximum time after a subscriber receives a message before
|
|
||||||
the subscriber should acknowledge the message. After message delivery but
|
|
||||||
before the ack deadline expires and before the message is acknowledged, it
|
|
||||||
is an outstanding message and will not be delivered again during that time
|
|
||||||
(on a best-effort basis).
|
|
||||||
- For pull subscriptions, this value is used as the initial value for the ack
|
|
||||||
deadline. To override this value for a given message, call subscriptions.modifyAckDeadline
|
|
||||||
with the corresponding ackId if using pull. The minimum custom deadline you
|
|
||||||
can specify is 10 seconds. The maximum custom deadline you can specify is
|
|
||||||
600 seconds (10 minutes).
|
|
||||||
- If this parameter is 0, a default value of 10 seconds is used.
|
|
||||||
- For push delivery, this value is also used to set the request timeout for
|
|
||||||
the call to the push endpoint.
|
|
||||||
- If the subscriber never acknowledges the message, the Pub/Sub system will
|
|
||||||
eventually redeliver the message.
|
|
||||||
returned: success
|
|
||||||
type: int
|
|
||||||
messageRetentionDuration:
|
|
||||||
description:
|
|
||||||
- How long to retain unacknowledged messages in the subscription's backlog,
|
|
||||||
from the moment a message is published. If retainAckedMessages is true, then
|
|
||||||
this also configures the retention of acknowledged messages, and thus configures
|
|
||||||
how far back in time a subscriptions.seek can be done. Defaults to 7 days.
|
|
||||||
Cannot be more than 7 days (`"604800s"`) or less than 10 minutes (`"600s"`).
|
|
||||||
- 'A duration in seconds with up to nine fractional digits, terminated by ''s''.
|
|
||||||
Example: `"600.5s"`.'
|
|
||||||
returned: success
|
|
||||||
type: str
|
|
||||||
retainAckedMessages:
|
|
||||||
description:
|
|
||||||
- Indicates whether to retain acknowledged messages. If `true`, then messages
|
|
||||||
are not expunged from the subscription's backlog, even if they are acknowledged,
|
|
||||||
until they fall out of the messageRetentionDuration window.
|
|
||||||
returned: success
|
|
||||||
type: bool
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -158,9 +113,12 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict())
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if 'scopes' not in module.params:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/pubsub']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/pubsub']
|
||||||
|
|
||||||
items = fetch_list(module, collection(module))
|
items = fetch_list(module, collection(module))
|
||||||
|
@ -168,7 +126,9 @@ def main():
|
||||||
items = items.get('subscriptions')
|
items = items.get('subscriptions')
|
||||||
else:
|
else:
|
||||||
items = []
|
items = []
|
||||||
return_value = {'items': items}
|
return_value = {
|
||||||
|
'items': items
|
||||||
|
}
|
||||||
module.exit_json(**return_value)
|
module.exit_json(**return_value)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,56 +18,50 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Documentation
|
# Documentation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'}
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
|
'status': ["preview"],
|
||||||
|
'supported_by': 'community'}
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: gcp_pubsub_topic_facts
|
module: gcp_pubsub_topic_facts
|
||||||
description:
|
description:
|
||||||
- Gather facts for GCP Topic
|
- Gather facts for GCP Topic
|
||||||
short_description: Gather facts for GCP Topic
|
short_description: Gather facts for GCP Topic
|
||||||
version_added: 2.8
|
version_added: 2.7
|
||||||
author: Google Inc. (@googlecloudplatform)
|
author: Google Inc. (@googlecloudplatform)
|
||||||
requirements:
|
requirements:
|
||||||
- python >= 2.6
|
- python >= 2.6
|
||||||
- requests >= 2.18.4
|
- requests >= 2.18.4
|
||||||
- google-auth >= 1.3.0
|
- google-auth >= 1.3.0
|
||||||
options: {}
|
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: " a topic facts"
|
- name: a topic facts
|
||||||
gcp_pubsub_topic_facts:
|
gcp_pubsub_topic_facts:
|
||||||
project: test_project
|
project: test_project
|
||||||
auth_kind: serviceaccount
|
auth_kind: serviceaccount
|
||||||
service_account_file: "/tmp/auth.pem"
|
service_account_file: "/tmp/auth.pem"
|
||||||
state: facts
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
items:
|
items:
|
||||||
description: List of items
|
description: List of items
|
||||||
returned: always
|
returned: always
|
||||||
type: complex
|
type: complex
|
||||||
contains:
|
contains:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the topic.
|
- Name of the topic.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
labels:
|
|
||||||
description:
|
|
||||||
- A set of key/value label pairs to assign to this Topic.
|
|
||||||
returned: success
|
|
||||||
type: dict
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -82,9 +76,12 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = GcpModule(argument_spec=dict())
|
module = GcpModule(
|
||||||
|
argument_spec=dict(
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if 'scopes' not in module.params:
|
||||||
module.params['scopes'] = ['https://www.googleapis.com/auth/pubsub']
|
module.params['scopes'] = ['https://www.googleapis.com/auth/pubsub']
|
||||||
|
|
||||||
items = fetch_list(module, collection(module))
|
items = fetch_list(module, collection(module))
|
||||||
|
@ -92,7 +89,9 @@ def main():
|
||||||
items = items.get('topics')
|
items = items.get('topics')
|
||||||
else:
|
else:
|
||||||
items = []
|
items = []
|
||||||
return_value = {'items': items}
|
return_value = {
|
||||||
|
'items': items
|
||||||
|
}
|
||||||
module.exit_json(**return_value)
|
module.exit_json(**return_value)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,10 @@
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- name: verify that node_pool was created
|
- name: verify that node_pool was created
|
||||||
gcp_container_node_pool_facts:
|
gcp_container_node_pool_facts:
|
||||||
|
filters:
|
||||||
|
- name = {{ resource_name }}
|
||||||
cluster: "{{ cluster }}"
|
cluster: "{{ cluster }}"
|
||||||
location: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
@ -97,8 +99,10 @@
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- name: verify that node_pool was deleted
|
- name: verify that node_pool was deleted
|
||||||
gcp_container_node_pool_facts:
|
gcp_container_node_pool_facts:
|
||||||
|
filters:
|
||||||
|
- name = {{ resource_name }}
|
||||||
cluster: "{{ cluster }}"
|
cluster: "{{ cluster }}"
|
||||||
location: us-central1-a
|
zone: us-central1-a
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
|
|
@ -56,6 +56,19 @@
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- "result.kind == 'dns#resourceRecordSet'"
|
- "result.kind == 'dns#resourceRecordSet'"
|
||||||
|
- name: verify that resource_record_set was created
|
||||||
|
gcp_dns_resource_record_set_facts:
|
||||||
|
managed_zone: "{{ managed_zone }}"
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/ndev.clouddns.readwrite
|
||||||
|
register: results
|
||||||
|
- name: verify that command succeeded
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- results['items'] | length >= 2
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a resource record set that already exists
|
- name: create a resource record set that already exists
|
||||||
gcp_dns_resource_record_set:
|
gcp_dns_resource_record_set:
|
||||||
|
@ -96,6 +109,19 @@
|
||||||
that:
|
that:
|
||||||
- result.changed == true
|
- result.changed == true
|
||||||
- result.has_key('kind') == False
|
- result.has_key('kind') == False
|
||||||
|
- name: verify that resource_record_set was deleted
|
||||||
|
gcp_dns_resource_record_set_facts:
|
||||||
|
managed_zone: "{{ managed_zone }}"
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/ndev.clouddns.readwrite
|
||||||
|
register: results
|
||||||
|
- name: verify that command succeeded
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- results['items'] | length >= 2
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a resource record set that does not exist
|
- name: delete a resource record set that does not exist
|
||||||
gcp_dns_resource_record_set:
|
gcp_dns_resource_record_set:
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
|
- results['items'] | length == 1
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a subscription that already exists
|
- name: create a subscription that already exists
|
||||||
gcp_pubsub_subscription:
|
gcp_pubsub_subscription:
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
- results['items'] | length == 0
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a subscription that does not exist
|
- name: delete a subscription that does not exist
|
||||||
gcp_pubsub_subscription:
|
gcp_pubsub_subscription:
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'test-topic1' in \"{{ results['items'] | map(attribute='name') | list }}\""
|
- results['items'] | length == 1
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a topic that already exists
|
- name: create a topic that already exists
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
- name: verify that command succeeded
|
- name: verify that command succeeded
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "'test-topic1' not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
- results['items'] | length == 0
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a topic that does not exist
|
- name: delete a topic that does not exist
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
|
|
|
@ -57,6 +57,8 @@
|
||||||
- "result.kind == 'sql#user'"
|
- "result.kind == 'sql#user'"
|
||||||
- name: verify that user was created
|
- name: verify that user was created
|
||||||
gcp_sql_user_facts:
|
gcp_sql_user_facts:
|
||||||
|
filters:
|
||||||
|
- name = test-user
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
@ -104,6 +106,8 @@
|
||||||
- result.has_key('kind') == False
|
- result.has_key('kind') == False
|
||||||
- name: verify that user was deleted
|
- name: verify that user was deleted
|
||||||
gcp_sql_user_facts:
|
gcp_sql_user_facts:
|
||||||
|
filters:
|
||||||
|
- name = test-user
|
||||||
instance: "{{ instance }}"
|
instance: "{{ instance }}"
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue