1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Bug fixes for GCP modules (#53881)

This commit is contained in:
The Magician 2019-03-15 14:49:38 -07:00 committed by ansibot
parent b429ba61dc
commit 3a43e41b39
32 changed files with 873 additions and 705 deletions

View file

@ -53,14 +53,15 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a vpn tunnel facts - name: " a vpn tunnel facts"
gcp_compute_vpn_tunnel_facts: gcp_compute_vpn_tunnel_facts:
region: us-west1 region: us-west1
filters: filters:
- name = test_object - name = test_object
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 = '''

View file

@ -170,20 +170,6 @@ options:
Because the master endpoint is open to the Internet, you should create a Because the master endpoint is open to the Internet, you should create a
strong password. strong password.
required: false required: false
cluster_ca_certificate:
description:
- Base64-encoded public certificate that is the root of trust for the cluster.
required: false
client_certificate:
description:
- Base64-encoded public certificate used by clients to authenticate to the
cluster endpoint.
required: false
client_key:
description:
- Base64-encoded private key used by clients to authenticate to the cluster
endpoint.
required: false
logging_service: logging_service:
description: description:
- 'The logging service the cluster should use to write logs. Currently available - 'The logging service the cluster should use to write logs. Currently available
@ -210,6 +196,31 @@ options:
- The name of the Google Compute Engine network to which the cluster is connected. - The name of the Google Compute Engine network to which the cluster is connected.
If left unspecified, the default network will be used. If left unspecified, the default network will be used.
required: false required: false
private_cluster_config:
description:
- Configuration for a private cluster.
required: false
version_added: 2.8
suboptions:
enable_private_nodes:
description:
- Whether nodes have internal IP addresses only. If enabled, all nodes are
given only RFC 1918 private addresses and communicate with the master via
private networking.
required: false
type: bool
enable_private_endpoint:
description:
- Whether the master's internal IP address is used as the cluster endpoint.
required: false
type: bool
master_ipv4_cidr_block:
description:
- The IP range in CIDR notation to use for the hosted master network. This
range will be used for assigning internal IP addresses to the master or
set of masters, as well as the ILB VIP. This range must not overlap with
any other ranges in use within the cluster's network.
required: false
cluster_ipv4_cidr: cluster_ipv4_cidr:
description: description:
- The IP address range of the container pods in this cluster, in CIDR notation - The IP address range of the container pods in this cluster, in CIDR notation
@ -265,19 +276,19 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a cluster - name: create a cluster
gcp_container_cluster: gcp_container_cluster:
name: my-cluster name: my-cluster
initial_node_count: 2 initial_node_count: 2
master_auth: master_auth:
username: cluster_admin username: cluster_admin
password: my-secret-password password: my-secret-password
node_config: node_config:
machine_type: n1-standard-4 machine_type: n1-standard-4
disk_size_gb: 500 disk_size_gb: 500
location: us-central1-a location: us-central1-a
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: present state: present
''' '''
RETURN = ''' RETURN = '''
@ -459,6 +470,42 @@ network:
If left unspecified, the default network will be used. If left unspecified, the default network will be used.
returned: success returned: success
type: str type: str
privateClusterConfig:
description:
- Configuration for a private cluster.
returned: success
type: complex
contains:
enablePrivateNodes:
description:
- Whether nodes have internal IP addresses only. If enabled, all nodes are given
only RFC 1918 private addresses and communicate with the master via private
networking.
returned: success
type: bool
enablePrivateEndpoint:
description:
- Whether the master's internal IP address is used as the cluster endpoint.
returned: success
type: bool
masterIpv4CidrBlock:
description:
- The IP range in CIDR notation to use for the hosted master network. This range
will be used for assigning internal IP addresses to the master or set of masters,
as well as the ILB VIP. This range must not overlap with any other ranges
in use within the cluster's network.
returned: success
type: str
privateEndpoint:
description:
- The internal IP address of this cluster's master endpoint.
returned: success
type: str
publicEndpoint:
description:
- The external IP address of this cluster's master endpoint.
returned: success
type: str
clusterIpv4Cidr: clusterIpv4Cidr:
description: description:
- The IP address range of the container pods in this cluster, in CIDR notation (e.g. - The IP address range of the container pods in this cluster, in CIDR notation (e.g.
@ -603,19 +650,14 @@ def main():
preemptible=dict(type='bool'), preemptible=dict(type='bool'),
), ),
), ),
master_auth=dict( master_auth=dict(type='dict', options=dict(username=dict(type='str'), password=dict(type='str'))),
type='dict',
options=dict(
username=dict(type='str'),
password=dict(type='str'),
cluster_ca_certificate=dict(type='str'),
client_certificate=dict(type='str'),
client_key=dict(type='str'),
),
),
logging_service=dict(type='str', choices=['logging.googleapis.com', 'none']), logging_service=dict(type='str', choices=['logging.googleapis.com', 'none']),
monitoring_service=dict(type='str', choices=['monitoring.googleapis.com', 'none']), monitoring_service=dict(type='str', choices=['monitoring.googleapis.com', 'none']),
network=dict(type='str'), network=dict(type='str'),
private_cluster_config=dict(
type='dict',
options=dict(enable_private_nodes=dict(type='bool'), enable_private_endpoint=dict(type='bool'), master_ipv4_cidr_block=dict(type='str')),
),
cluster_ipv4_cidr=dict(type='str'), cluster_ipv4_cidr=dict(type='str'),
addons_config=dict( addons_config=dict(
type='dict', type='dict',
@ -684,6 +726,7 @@ def resource_to_request(module):
u'loggingService': module.params.get('logging_service'), u'loggingService': module.params.get('logging_service'),
u'monitoringService': module.params.get('monitoring_service'), u'monitoringService': module.params.get('monitoring_service'),
u'network': module.params.get('network'), u'network': module.params.get('network'),
u'privateClusterConfig': ClusterPrivateclusterconfig(module.params.get('private_cluster_config', {}), module).to_request(),
u'clusterIpv4Cidr': module.params.get('cluster_ipv4_cidr'), u'clusterIpv4Cidr': module.params.get('cluster_ipv4_cidr'),
u'addonsConfig': ClusterAddonsconfig(module.params.get('addons_config', {}), module).to_request(), u'addonsConfig': ClusterAddonsconfig(module.params.get('addons_config', {}), module).to_request(),
u'subnetwork': module.params.get('subnetwork'), u'subnetwork': module.params.get('subnetwork'),
@ -761,6 +804,7 @@ def response_to_hash(module, response):
u'loggingService': response.get(u'loggingService'), u'loggingService': response.get(u'loggingService'),
u'monitoringService': response.get(u'monitoringService'), u'monitoringService': response.get(u'monitoringService'),
u'network': response.get(u'network'), u'network': response.get(u'network'),
u'privateClusterConfig': ClusterPrivateclusterconfig(response.get(u'privateClusterConfig', {}), module).from_response(),
u'clusterIpv4Cidr': response.get(u'clusterIpv4Cidr'), u'clusterIpv4Cidr': response.get(u'clusterIpv4Cidr'),
u'addonsConfig': ClusterAddonsconfig(response.get(u'addonsConfig', {}), module).from_response(), u'addonsConfig': ClusterAddonsconfig(response.get(u'addonsConfig', {}), module).from_response(),
u'subnetwork': response.get(u'subnetwork'), u'subnetwork': response.get(u'subnetwork'),
@ -897,6 +941,37 @@ class ClusterMasterauth(object):
) )
class ClusterPrivateclusterconfig(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'enablePrivateNodes': self.request.get('enable_private_nodes'),
u'enablePrivateEndpoint': self.request.get('enable_private_endpoint'),
u'masterIpv4CidrBlock': self.request.get('master_ipv4_cidr_block'),
u'privateEndpoint': self.request.get('private_endpoint'),
u'publicEndpoint': self.request.get('public_endpoint'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'enablePrivateNodes': self.request.get(u'enablePrivateNodes'),
u'enablePrivateEndpoint': self.request.get(u'enablePrivateEndpoint'),
u'masterIpv4CidrBlock': self.request.get(u'masterIpv4CidrBlock'),
u'privateEndpoint': self.request.get(u'privateEndpoint'),
u'publicEndpoint': self.request.get(u'publicEndpoint'),
}
)
class ClusterAddonsconfig(object): class ClusterAddonsconfig(object):
def __init__(self, request, module): def __init__(self, request, module):
self.module = module self.module = module

View file

@ -52,12 +52,13 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a cluster facts - name: " a cluster facts"
gcp_container_cluster_facts: gcp_container_cluster_facts:
location: us-central1-a location: us-central1-a
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 = '''
@ -245,6 +246,42 @@ items:
If left unspecified, the default network will be used. If left unspecified, the default network will be used.
returned: success returned: success
type: str type: str
privateClusterConfig:
description:
- Configuration for a private cluster.
returned: success
type: complex
contains:
enablePrivateNodes:
description:
- Whether nodes have internal IP addresses only. If enabled, all nodes are
given only RFC 1918 private addresses and communicate with the master
via private networking.
returned: success
type: bool
enablePrivateEndpoint:
description:
- Whether the master's internal IP address is used as the cluster endpoint.
returned: success
type: bool
masterIpv4CidrBlock:
description:
- The IP range in CIDR notation to use for the hosted master network. This
range will be used for assigning internal IP addresses to the master or
set of masters, as well as the ILB VIP. This range must not overlap with
any other ranges in use within the cluster's network.
returned: success
type: str
privateEndpoint:
description:
- The internal IP address of this cluster's master endpoint.
returned: success
type: str
publicEndpoint:
description:
- The external IP address of this cluster's master endpoint.
returned: success
type: str
clusterIpv4Cidr: clusterIpv4Cidr:
description: description:
- The IP address range of the container pods in this cluster, in CIDR notation - The IP address range of the container pods in this cluster, in CIDR notation

View file

@ -144,6 +144,11 @@ options:
resource quota is sufficient for this number of instances. You must also have resource quota is sufficient for this number of instances. You must also have
available firewall and routes quota. available firewall and routes quota.
required: true required: true
version:
description:
- The version of the Kubernetes of this node.
required: false
version_added: 2.8
autoscaling: autoscaling:
description: description:
- Autoscaler configuration for this NodePool. Autoscaler is enabled only if a - Autoscaler configuration for this NodePool. Autoscaler is enabled only if a
@ -188,17 +193,7 @@ options:
description: description:
- Specifies the Auto Upgrade knobs for the node pool. - Specifies the Auto Upgrade knobs for the node pool.
required: false required: false
suboptions: suboptions: {}
auto_upgrade_start_time:
description:
- This field is set when upgrades are about to commence with the approximate
start time for the upgrades, in RFC3339 text format.
required: false
description:
description:
- This field is set when upgrades are about to commence with the description
of the upgrade.
required: false
cluster: cluster:
description: description:
- The cluster this node pool belongs to. - The cluster this node pool belongs to.
@ -221,25 +216,25 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a cluster - name: create a cluster
gcp_container_cluster: gcp_container_cluster:
name: "cluster-nodepool" name: cluster-nodepool
initial_node_count: 4 initial_node_count: 4
location: us-central1-a location: 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 }}"
state: present state: present
register: cluster register: cluster
- name: create a node pool - name: create a node pool
gcp_container_node_pool: gcp_container_node_pool:
name: my-pool name: my-pool
initial_node_count: 4 initial_node_count: 4
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: us-central1-a
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: present state: present
''' '''
RETURN = ''' RETURN = '''
@ -462,14 +457,10 @@ def main():
), ),
), ),
initial_node_count=dict(required=True, type='int'), initial_node_count=dict(required=True, type='int'),
version=dict(type='str'),
autoscaling=dict(type='dict', options=dict(enabled=dict(type='bool'), min_node_count=dict(type='int'), max_node_count=dict(type='int'))), autoscaling=dict(type='dict', options=dict(enabled=dict(type='bool'), min_node_count=dict(type='int'), max_node_count=dict(type='int'))),
management=dict( management=dict(
type='dict', type='dict', options=dict(auto_upgrade=dict(type='bool'), auto_repair=dict(type='bool'), upgrade_options=dict(type='dict', options=dict()))
options=dict(
auto_upgrade=dict(type='bool'),
auto_repair=dict(type='bool'),
upgrade_options=dict(type='dict', options=dict(auto_upgrade_start_time=dict(type='str'), description=dict(type='str'))),
),
), ),
cluster=dict(required=True), cluster=dict(required=True),
location=dict(required=True, type='str', aliases=['region', 'zone']), location=dict(required=True, type='str', aliases=['region', 'zone']),
@ -526,6 +517,7 @@ def resource_to_request(module):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'config': NodePoolConfig(module.params.get('config', {}), module).to_request(), u'config': NodePoolConfig(module.params.get('config', {}), module).to_request(),
u'initialNodeCount': module.params.get('initial_node_count'), u'initialNodeCount': module.params.get('initial_node_count'),
u'version': module.params.get('version'),
u'autoscaling': NodePoolAutoscaling(module.params.get('autoscaling', {}), module).to_request(), u'autoscaling': NodePoolAutoscaling(module.params.get('autoscaling', {}), module).to_request(),
u'management': NodePoolManagement(module.params.get('management', {}), module).to_request(), u'management': NodePoolManagement(module.params.get('management', {}), module).to_request(),
} }
@ -604,7 +596,7 @@ def response_to_hash(module, response):
u'name': response.get(u'name'), u'name': response.get(u'name'),
u'config': NodePoolConfig(response.get(u'config', {}), module).from_response(), u'config': NodePoolConfig(response.get(u'config', {}), module).from_response(),
u'initialNodeCount': module.params.get('initial_node_count'), u'initialNodeCount': module.params.get('initial_node_count'),
u'version': response.get(u'version'), u'version': module.params.get('version'),
u'autoscaling': NodePoolAutoscaling(response.get(u'autoscaling', {}), module).from_response(), u'autoscaling': NodePoolAutoscaling(response.get(u'autoscaling', {}), module).from_response(),
u'management': NodePoolManagement(response.get(u'management', {}), module).from_response(), u'management': NodePoolManagement(response.get(u'management', {}), module).from_response(),
} }

View file

@ -60,13 +60,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a node pool facts - name: " a node pool facts"
gcp_container_node_pool_facts: gcp_container_node_pool_facts:
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: us-central1-a
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 = '''

View file

@ -82,13 +82,13 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a managed zone - name: create a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "test_object" name: test_object
dns_name: test.somewild2.example.com. dns_name: test.somewild2.example.com.
description: test zone description: test 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: present state: present
''' '''
RETURN = ''' RETURN = '''
@ -126,7 +126,7 @@ nameServerSet:
a set of DNS name servers that all host the same ManagedZones. Most users will a set of DNS name servers that all host the same ManagedZones. Most users will
leave this field unset. leave this field unset.
returned: success returned: success
type: list type: str
creationTime: creationTime:
description: description:
- The time that this resource was created on the server. - The time that this resource was created on the server.
@ -161,7 +161,7 @@ def main():
description=dict(required=True, type='str'), description=dict(required=True, type='str'),
dns_name=dict(required=True, type='str'), dns_name=dict(required=True, type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
name_server_set=dict(type='list', elements='str'), name_server_set=dict(type='str'),
labels=dict(type='dict'), labels=dict(type='dict'),
) )
) )

View file

@ -47,12 +47,13 @@ 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 = '''
@ -95,7 +96,7 @@ items:
is a set of DNS name servers that all host the same ManagedZones. Most users is a set of DNS name servers that all host the same ManagedZones. Most users
will leave this field unset. will leave this field unset.
returned: success returned: success
type: list type: str
creationTime: creationTime:
description: description:
- The time that this resource was created on the server. - The time that this resource was created on the server.

View file

@ -95,28 +95,28 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a managed zone - name: create a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "managedzone-rrs" name: managedzone-rrs
dns_name: testzone-4.com. dns_name: testzone-4.com.
description: test zone description: test zone
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 }}"
state: present state: present
register: managed_zone register: managed_zone
- name: create a resource record set - name: create a resource record set
gcp_dns_resource_record_set: gcp_dns_resource_record_set:
name: www.testzone-4.com. name: www.testzone-4.com.
managed_zone: "{{ managed_zone }}" managed_zone: "{{ managed_zone }}"
type: A type: A
ttl: 600 ttl: 600
target: target:
- 10.1.2.3 - 10.1.2.3
- 40.5.6.7 - 40.5.6.7
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: present state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -52,12 +52,13 @@ 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 = '''

View file

@ -61,14 +61,12 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a service account - name: create a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"'
display_name: My Ansible test key
' project: test_project
display_name: My Ansible test key auth_kind: serviceaccount
project: "test_project" service_account_file: "/tmp/auth.pem"
auth_kind: "serviceaccount" state: present
service_account_file: "/tmp/auth.pem"
state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a service account facts - name: " a service account facts"
gcp_iam_service_account_facts: gcp_iam_service_account_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 = '''

View file

@ -83,23 +83,23 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a service account - name: create a service account
gcp_iam_service_account: gcp_iam_service_account:
name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com
display_name: My Ansible test key display_name: My Ansible test key
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 }}"
state: present state: present
register: serviceaccount register: serviceaccount
- name: create a service account key - name: create a service account key
gcp_iam_service_account_key: gcp_iam_service_account_key:
service_account: "{{ serviceaccount }}" service_account: "{{ serviceaccount }}"
private_key_type: TYPE_GOOGLE_CREDENTIALS_FILE private_key_type: TYPE_GOOGLE_CREDENTIALS_FILE
path: "~/test_account.json" path: "~/test_account.json"
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: present state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -113,6 +113,26 @@ options:
- If the subscriber never acknowledges the message, the Pub/Sub system will eventually - If the subscriber never acknowledges the message, the Pub/Sub system will eventually
redeliver the message. redeliver the message.
required: false required: false
message_retention_duration:
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"`.'
required: false
default: 604800s
version_added: 2.8
retain_acked_messages:
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.
required: false
type: bool
version_added: 2.8
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
- 'API Reference: U(https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions)' - 'API Reference: U(https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions)'
@ -122,22 +142,22 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a topic - name: create a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: "topic-subscription" name: topic-subscription
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 }}"
state: present state: present
register: topic register: topic
- name: create a subscription - name: create a subscription
gcp_pubsub_subscription: gcp_pubsub_subscription:
name: "test_object" name: test_object
topic: "{{ topic }}" topic: "{{ topic }}"
ack_deadline_seconds: 300 ack_deadline_seconds: 300
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: present state: present
''' '''
RETURN = ''' RETURN = '''
@ -207,6 +227,24 @@ ackDeadlineSeconds:
redeliver the message. redeliver the message.
returned: success returned: success
type: int 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
''' '''
################################################################################ ################################################################################
@ -232,6 +270,8 @@ def main():
labels=dict(type='dict'), labels=dict(type='dict'),
push_config=dict(type='dict', options=dict(push_endpoint=dict(required=True, type='str'), attributes=dict(type='dict'))), push_config=dict(type='dict', options=dict(push_endpoint=dict(required=True, type='str'), attributes=dict(type='dict'))),
ack_deadline_seconds=dict(type='int'), ack_deadline_seconds=dict(type='int'),
message_retention_duration=dict(default='604800s', type='str'),
retain_acked_messages=dict(type='bool'),
) )
) )
@ -286,6 +326,10 @@ def updateMask(request, response):
update_mask.append('pushConfig') update_mask.append('pushConfig')
if request.get('ackDeadlineSeconds') != response.get('ackDeadlineSeconds'): if request.get('ackDeadlineSeconds') != response.get('ackDeadlineSeconds'):
update_mask.append('ackDeadlineSeconds') update_mask.append('ackDeadlineSeconds')
if request.get('messageRetentionDuration') != response.get('messageRetentionDuration'):
update_mask.append('messageRetentionDuration')
if request.get('retainAckedMessages') != response.get('retainAckedMessages'):
update_mask.append('retainAckedMessages')
return ','.join(update_mask) return ','.join(update_mask)
@ -301,6 +345,8 @@ def resource_to_request(module):
u'labels': module.params.get('labels'), u'labels': module.params.get('labels'),
u'pushConfig': SubscriptionPushconfig(module.params.get('push_config', {}), module).to_request(), u'pushConfig': SubscriptionPushconfig(module.params.get('push_config', {}), module).to_request(),
u'ackDeadlineSeconds': module.params.get('ack_deadline_seconds'), u'ackDeadlineSeconds': module.params.get('ack_deadline_seconds'),
u'messageRetentionDuration': module.params.get('message_retention_duration'),
u'retainAckedMessages': module.params.get('retain_acked_messages'),
} }
request = encode_request(request, module) request = encode_request(request, module)
return_vals = {} return_vals = {}
@ -375,6 +421,8 @@ def response_to_hash(module, response):
u'labels': response.get(u'labels'), u'labels': response.get(u'labels'),
u'pushConfig': SubscriptionPushconfig(response.get(u'pushConfig', {}), module).from_response(), u'pushConfig': SubscriptionPushconfig(response.get(u'pushConfig', {}), module).from_response(),
u'ackDeadlineSeconds': response.get(u'ackDeadlineSeconds'), u'ackDeadlineSeconds': response.get(u'ackDeadlineSeconds'),
u'messageRetentionDuration': response.get(u'messageRetentionDuration'),
u'retainAckedMessages': response.get(u'retainAckedMessages'),
} }

View file

@ -44,11 +44,12 @@ 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 = '''
@ -125,6 +126,24 @@ items:
eventually redeliver the message. eventually redeliver the message.
returned: success returned: success
type: int 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
''' '''
################################################################################ ################################################################################

View file

@ -65,11 +65,11 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a topic - name: create a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: test-topic1 name: test-topic1
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: present state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -44,11 +44,12 @@ 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 = '''

View file

@ -123,30 +123,30 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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 }}"
state: present state: present
register: network register: network
- name: create a instance - name: create a instance
gcp_redis_instance: gcp_redis_instance:
name: instance37 name: instance37
tier: STANDARD_HA tier: STANDARD_HA
memory_size_gb: 1 memory_size_gb: 1
region: us-central1 region: us-central1
location_id: us-central1-a location_id: us-central1-a
redis_version: REDIS_3_2 redis_version: REDIS_3_2
display_name: Ansible Test Instance display_name: Ansible Test Instance
reserved_ip_range: 192.168.0.0/29 reserved_ip_range: 192.168.0.0/29
labels: labels:
my_key: my_val my_key: my_val
other_key: other_val other_key: other_val
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: present state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -48,12 +48,13 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance facts - name: " a instance facts"
gcp_redis_instance_facts: gcp_redis_instance_facts:
region: us-central1 region: us-central1
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 = '''

View file

@ -90,14 +90,14 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a project - name: create a project
gcp_resourcemanager_project: gcp_resourcemanager_project:
name: My Sample Project name: My Sample Project
id: alextest-{{ 10000000000 | random }} id: alextest-{{ 10000000000 | random }}
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
parent: parent:
type: organization type: organization
id: 636173955921 id: 636173955921
state: present state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a project facts - name: " a project facts"
gcp_resourcemanager_project_facts: gcp_resourcemanager_project_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 = '''

View file

@ -62,11 +62,11 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a repository - name: create a repository
gcp_sourcerepo_repository: gcp_sourcerepo_repository:
name: projects/test_project/repos/test_object name: projects/test_project/repos/test_object
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: present state: present
''' '''
RETURN = ''' RETURN = '''

View file

@ -44,11 +44,12 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a repository facts - name: " a repository facts"
gcp_sourcerepo_repository_facts: gcp_sourcerepo_repository_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 = '''

View file

@ -15,35 +15,35 @@
# Pre-test setup # Pre-test setup
- name: delete a cluster - name: delete a cluster
gcp_container_cluster: gcp_container_cluster:
name: my-cluster name: my-cluster
initial_node_count: 2 initial_node_count: 2
master_auth: master_auth:
username: cluster_admin username: cluster_admin
password: my-secret-password password: my-secret-password
node_config: node_config:
machine_type: n1-standard-4 machine_type: n1-standard-4
disk_size_gb: 500 disk_size_gb: 500
location: us-central1-a location: 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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a cluster - name: create a cluster
gcp_container_cluster: gcp_container_cluster:
name: my-cluster name: my-cluster
initial_node_count: 2 initial_node_count: 2
master_auth: master_auth:
username: cluster_admin username: cluster_admin
password: my-secret-password password: my-secret-password
node_config: node_config:
machine_type: n1-standard-4 machine_type: n1-standard-4
disk_size_gb: 500 disk_size_gb: 500
location: us-central1-a location: 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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -65,19 +65,19 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a cluster that already exists - name: create a cluster that already exists
gcp_container_cluster: gcp_container_cluster:
name: my-cluster name: my-cluster
initial_node_count: 2 initial_node_count: 2
master_auth: master_auth:
username: cluster_admin username: cluster_admin
password: my-secret-password password: my-secret-password
node_config: node_config:
machine_type: n1-standard-4 machine_type: n1-standard-4
disk_size_gb: 500 disk_size_gb: 500
location: us-central1-a location: 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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -86,19 +86,19 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a cluster - name: delete a cluster
gcp_container_cluster: gcp_container_cluster:
name: my-cluster name: my-cluster
initial_node_count: 2 initial_node_count: 2
master_auth: master_auth:
username: cluster_admin username: cluster_admin
password: my-secret-password password: my-secret-password
node_config: node_config:
machine_type: n1-standard-4 machine_type: n1-standard-4
disk_size_gb: 500 disk_size_gb: 500
location: us-central1-a location: 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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -120,19 +120,19 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a cluster that does not exist - name: delete a cluster that does not exist
gcp_container_cluster: gcp_container_cluster:
name: my-cluster name: my-cluster
initial_node_count: 2 initial_node_count: 2
master_auth: master_auth:
username: cluster_admin username: cluster_admin
password: my-secret-password password: my-secret-password
node_config: node_config:
machine_type: n1-standard-4 machine_type: n1-standard-4
disk_size_gb: 500 disk_size_gb: 500
location: us-central1-a location: 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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:

View file

@ -15,35 +15,35 @@
# Pre-test setup # Pre-test setup
- name: create a cluster - name: create a cluster
gcp_container_cluster: gcp_container_cluster:
name: "cluster-nodepool" name: cluster-nodepool
initial_node_count: 4 initial_node_count: 4
location: us-central1-a location: 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 }}"
state: present state: present
register: cluster register: cluster
- name: delete a node pool - name: delete a node pool
gcp_container_node_pool: gcp_container_node_pool:
name: my-pool name: my-pool
initial_node_count: 4 initial_node_count: 4
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: 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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a node pool - name: create a node pool
gcp_container_node_pool: gcp_container_node_pool:
name: my-pool name: my-pool
initial_node_count: 4 initial_node_count: 4
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: 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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -66,14 +66,14 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a node pool that already exists - name: create a node pool that already exists
gcp_container_node_pool: gcp_container_node_pool:
name: my-pool name: my-pool
initial_node_count: 4 initial_node_count: 4
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: 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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -82,14 +82,14 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a node pool - name: delete a node pool
gcp_container_node_pool: gcp_container_node_pool:
name: my-pool name: my-pool
initial_node_count: 4 initial_node_count: 4
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: 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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -112,14 +112,14 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a node pool that does not exist - name: delete a node pool that does not exist
gcp_container_node_pool: gcp_container_node_pool:
name: my-pool name: my-pool
initial_node_count: 4 initial_node_count: 4
cluster: "{{ cluster }}" cluster: "{{ cluster }}"
location: us-central1-a location: 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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -130,12 +130,12 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a cluster - name: delete a cluster
gcp_container_cluster: gcp_container_cluster:
name: "cluster-nodepool" name: cluster-nodepool
initial_node_count: 4 initial_node_count: 4
location: us-central1-a location: 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 }}"
state: absent state: absent
register: cluster register: cluster
ignore_errors: true ignore_errors: true

View file

@ -15,23 +15,23 @@
# Pre-test setup # Pre-test setup
- name: delete a managed zone - name: delete a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "{{ resource_name }}" name: "{{ resource_name }}"
dns_name: test.somewild2.example.com. dns_name: test.somewild2.example.com.
description: test zone description: test zone
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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a managed zone - name: create a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "{{ resource_name }}" name: "{{ resource_name }}"
dns_name: test.somewild2.example.com. dns_name: test.somewild2.example.com.
description: test zone description: test zone
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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -54,13 +54,13 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a managed zone that already exists - name: create a managed zone that already exists
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "{{ resource_name }}" name: "{{ resource_name }}"
dns_name: test.somewild2.example.com. dns_name: test.somewild2.example.com.
description: test zone description: test zone
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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -70,13 +70,13 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a managed zone - name: delete a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "{{ resource_name }}" name: "{{ resource_name }}"
dns_name: test.somewild2.example.com. dns_name: test.somewild2.example.com.
description: test zone description: test zone
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -99,13 +99,13 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a managed zone that does not exist - name: delete a managed zone that does not exist
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "{{ resource_name }}" name: "{{ resource_name }}"
dns_name: test.somewild2.example.com. dns_name: test.somewild2.example.com.
description: test zone description: test zone
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:

View file

@ -15,41 +15,41 @@
# Pre-test setup # Pre-test setup
- name: create a managed zone - name: create a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "managedzone-rrs" name: managedzone-rrs
dns_name: testzone-4.com. dns_name: testzone-4.com.
description: test zone description: test zone
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 }}"
state: present state: present
register: managed_zone register: managed_zone
- name: delete a resource record set - name: delete a resource record set
gcp_dns_resource_record_set: gcp_dns_resource_record_set:
name: www.testzone-4.com. name: www.testzone-4.com.
managed_zone: "{{ managed_zone }}" managed_zone: "{{ managed_zone }}"
type: A type: A
ttl: 600 ttl: 600
target: target:
- 10.1.2.3 - 10.1.2.3
- 40.5.6.7 - 40.5.6.7
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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a resource record set - name: create a resource record set
gcp_dns_resource_record_set: gcp_dns_resource_record_set:
name: www.testzone-4.com. name: www.testzone-4.com.
managed_zone: "{{ managed_zone }}" managed_zone: "{{ managed_zone }}"
type: A type: A
ttl: 600 ttl: 600
target: target:
- 10.1.2.3 - 10.1.2.3
- 40.5.6.7 - 40.5.6.7
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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -72,17 +72,17 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- 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:
name: www.testzone-4.com. name: www.testzone-4.com.
managed_zone: "{{ managed_zone }}" managed_zone: "{{ managed_zone }}"
type: A type: A
ttl: 600 ttl: 600
target: target:
- 10.1.2.3 - 10.1.2.3
- 40.5.6.7 - 40.5.6.7
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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -92,17 +92,17 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a resource record set - name: delete a resource record set
gcp_dns_resource_record_set: gcp_dns_resource_record_set:
name: www.testzone-4.com. name: www.testzone-4.com.
managed_zone: "{{ managed_zone }}" managed_zone: "{{ managed_zone }}"
type: A type: A
ttl: 600 ttl: 600
target: target:
- 10.1.2.3 - 10.1.2.3
- 40.5.6.7 - 40.5.6.7
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -125,17 +125,17 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- 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:
name: www.testzone-4.com. name: www.testzone-4.com.
managed_zone: "{{ managed_zone }}" managed_zone: "{{ managed_zone }}"
type: A type: A
ttl: 600 ttl: 600
target: target:
- 10.1.2.3 - 10.1.2.3
- 40.5.6.7 - 40.5.6.7
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -147,12 +147,12 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a managed zone - name: delete a managed zone
gcp_dns_managed_zone: gcp_dns_managed_zone:
name: "managedzone-rrs" name: managedzone-rrs
dns_name: testzone-4.com. dns_name: testzone-4.com.
description: test zone description: test zone
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 }}"
state: absent state: absent
register: managed_zone register: managed_zone
ignore_errors: true ignore_errors: true

View file

@ -15,25 +15,21 @@
# Pre-test setup # Pre-test setup
- name: delete a service account - name: delete a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"'
display_name: My Ansible test key
' project: "{{ gcp_project }}"
display_name: My Ansible test key auth_kind: "{{ gcp_cred_kind }}"
project: "{{ gcp_project }}" service_account_file: "{{ gcp_cred_file }}"
auth_kind: "{{ gcp_cred_kind }}" state: absent
service_account_file: "{{ gcp_cred_file }}"
state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a service account - name: create a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"'
display_name: My Ansible test key
' project: "{{ gcp_project }}"
display_name: My Ansible test key auth_kind: "{{ gcp_cred_kind }}"
project: "{{ gcp_project }}" service_account_file: "{{ gcp_cred_file }}"
auth_kind: "{{ gcp_cred_kind }}" state: present
service_account_file: "{{ gcp_cred_file }}"
state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -54,14 +50,12 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a service account that already exists - name: create a service account that already exists
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"'
display_name: My Ansible test key
' project: "{{ gcp_project }}"
display_name: My Ansible test key auth_kind: "{{ gcp_cred_kind }}"
project: "{{ gcp_project }}" service_account_file: "{{ gcp_cred_file }}"
auth_kind: "{{ gcp_cred_kind }}" state: present
service_account_file: "{{ gcp_cred_file }}"
state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -70,14 +64,12 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a service account - name: delete a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"'
display_name: My Ansible test key
' project: "{{ gcp_project }}"
display_name: My Ansible test key auth_kind: "{{ gcp_cred_kind }}"
project: "{{ gcp_project }}" service_account_file: "{{ gcp_cred_file }}"
auth_kind: "{{ gcp_cred_kind }}" state: absent
service_account_file: "{{ gcp_cred_file }}"
state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -98,14 +90,12 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a service account that does not exist - name: delete a service account that does not exist
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"'
display_name: My Ansible test key
' project: "{{ gcp_project }}"
display_name: My Ansible test key auth_kind: "{{ gcp_cred_kind }}"
project: "{{ gcp_project }}" service_account_file: "{{ gcp_cred_file }}"
auth_kind: "{{ gcp_cred_kind }}" state: absent
service_account_file: "{{ gcp_cred_file }}"
state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:

View file

@ -15,31 +15,31 @@
# Pre-test setup # Pre-test setup
- name: create a topic - name: create a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: "topic-subscription" name: topic-subscription
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 }}"
state: present state: present
register: topic register: topic
- name: delete a subscription - name: delete a subscription
gcp_pubsub_subscription: gcp_pubsub_subscription:
name: "{{ resource_name }}" name: "{{ resource_name }}"
topic: "{{ topic }}" topic: "{{ topic }}"
ack_deadline_seconds: 300 ack_deadline_seconds: 300
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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a subscription - name: create a subscription
gcp_pubsub_subscription: gcp_pubsub_subscription:
name: "{{ resource_name }}" name: "{{ resource_name }}"
topic: "{{ topic }}" topic: "{{ topic }}"
ack_deadline_seconds: 300 ack_deadline_seconds: 300
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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -60,13 +60,13 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a subscription that already exists - name: create a subscription that already exists
gcp_pubsub_subscription: gcp_pubsub_subscription:
name: "{{ resource_name }}" name: "{{ resource_name }}"
topic: "{{ topic }}" topic: "{{ topic }}"
ack_deadline_seconds: 300 ack_deadline_seconds: 300
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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -75,13 +75,13 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a subscription - name: delete a subscription
gcp_pubsub_subscription: gcp_pubsub_subscription:
name: "{{ resource_name }}" name: "{{ resource_name }}"
topic: "{{ topic }}" topic: "{{ topic }}"
ack_deadline_seconds: 300 ack_deadline_seconds: 300
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -102,13 +102,13 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a subscription that does not exist - name: delete a subscription that does not exist
gcp_pubsub_subscription: gcp_pubsub_subscription:
name: "{{ resource_name }}" name: "{{ resource_name }}"
topic: "{{ topic }}" topic: "{{ topic }}"
ack_deadline_seconds: 300 ack_deadline_seconds: 300
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -119,10 +119,10 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a topic - name: delete a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: "topic-subscription" name: topic-subscription
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 }}"
state: absent state: absent
register: topic register: topic
ignore_errors: true ignore_errors: true

View file

@ -15,19 +15,19 @@
# Pre-test setup # Pre-test setup
- name: delete a topic - name: delete a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: test-topic1 name: test-topic1
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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a topic - name: create a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: test-topic1 name: test-topic1
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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -48,11 +48,11 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a topic that already exists - name: create a topic that already exists
gcp_pubsub_topic: gcp_pubsub_topic:
name: test-topic1 name: test-topic1
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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -61,11 +61,11 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a topic - name: delete a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: test-topic1 name: test-topic1
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -86,11 +86,11 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a topic that does not exist - name: delete a topic that does not exist
gcp_pubsub_topic: gcp_pubsub_topic:
name: test-topic1 name: test-topic1
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:

View file

@ -15,47 +15,47 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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 }}"
state: present state: present
register: network register: network
- name: delete a instance - name: delete a instance
gcp_redis_instance: gcp_redis_instance:
name: instance37 name: instance37
tier: STANDARD_HA tier: STANDARD_HA
memory_size_gb: 1 memory_size_gb: 1
region: us-central1 region: us-central1
location_id: us-central1-a location_id: us-central1-a
redis_version: REDIS_3_2 redis_version: REDIS_3_2
display_name: Ansible Test Instance display_name: Ansible Test Instance
reserved_ip_range: 192.168.0.0/29 reserved_ip_range: 192.168.0.0/29
labels: labels:
my_key: my_val my_key: my_val
other_key: other_val other_key: other_val
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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a instance - name: create a instance
gcp_redis_instance: gcp_redis_instance:
name: instance37 name: instance37
tier: STANDARD_HA tier: STANDARD_HA
memory_size_gb: 1 memory_size_gb: 1
region: us-central1 region: us-central1
location_id: us-central1-a location_id: us-central1-a
redis_version: REDIS_3_2 redis_version: REDIS_3_2
display_name: Ansible Test Instance display_name: Ansible Test Instance
reserved_ip_range: 192.168.0.0/29 reserved_ip_range: 192.168.0.0/29
labels: labels:
my_key: my_val my_key: my_val
other_key: other_val other_key: other_val
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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -77,21 +77,21 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a instance that already exists - name: create a instance that already exists
gcp_redis_instance: gcp_redis_instance:
name: instance37 name: instance37
tier: STANDARD_HA tier: STANDARD_HA
memory_size_gb: 1 memory_size_gb: 1
region: us-central1 region: us-central1
location_id: us-central1-a location_id: us-central1-a
redis_version: REDIS_3_2 redis_version: REDIS_3_2
display_name: Ansible Test Instance display_name: Ansible Test Instance
reserved_ip_range: 192.168.0.0/29 reserved_ip_range: 192.168.0.0/29
labels: labels:
my_key: my_val my_key: my_val
other_key: other_val other_key: other_val
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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -100,21 +100,21 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a instance - name: delete a instance
gcp_redis_instance: gcp_redis_instance:
name: instance37 name: instance37
tier: STANDARD_HA tier: STANDARD_HA
memory_size_gb: 1 memory_size_gb: 1
region: us-central1 region: us-central1
location_id: us-central1-a location_id: us-central1-a
redis_version: REDIS_3_2 redis_version: REDIS_3_2
display_name: Ansible Test Instance display_name: Ansible Test Instance
reserved_ip_range: 192.168.0.0/29 reserved_ip_range: 192.168.0.0/29
labels: labels:
my_key: my_val my_key: my_val
other_key: other_val other_key: other_val
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -136,21 +136,21 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a instance that does not exist - name: delete a instance that does not exist
gcp_redis_instance: gcp_redis_instance:
name: instance37 name: instance37
tier: STANDARD_HA tier: STANDARD_HA
memory_size_gb: 1 memory_size_gb: 1
region: us-central1 region: us-central1
location_id: us-central1-a location_id: us-central1-a
redis_version: REDIS_3_2 redis_version: REDIS_3_2
display_name: Ansible Test Instance display_name: Ansible Test Instance
reserved_ip_range: 192.168.0.0/29 reserved_ip_range: 192.168.0.0/29
labels: labels:
my_key: my_val my_key: my_val
other_key: other_val other_key: other_val
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -161,10 +161,10 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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 }}"
state: absent state: absent
register: network register: network
ignore_errors: true ignore_errors: true

View file

@ -15,25 +15,25 @@
# Pre-test setup # Pre-test setup
- name: delete a project - name: delete a project
gcp_resourcemanager_project: gcp_resourcemanager_project:
name: My Sample Project name: My Sample Project
id: alextest-{{ 10000000000 | random }} id: alextest-{{ 10000000000 | random }}
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
parent: parent:
type: organization type: organization
id: 636173955921 id: 636173955921
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a project - name: create a project
gcp_resourcemanager_project: gcp_resourcemanager_project:
name: My Sample Project name: My Sample Project
id: alextest-{{ 10000000000 | random }} id: alextest-{{ 10000000000 | random }}
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
parent: parent:
type: organization type: organization
id: 636173955921 id: 636173955921
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -54,14 +54,14 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a project that already exists - name: create a project that already exists
gcp_resourcemanager_project: gcp_resourcemanager_project:
name: My Sample Project name: My Sample Project
id: alextest-{{ 10000000000 | random }} id: alextest-{{ 10000000000 | random }}
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
parent: parent:
type: organization type: organization
id: 636173955921 id: 636173955921
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -70,14 +70,14 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a project - name: delete a project
gcp_resourcemanager_project: gcp_resourcemanager_project:
name: My Sample Project name: My Sample Project
id: alextest-{{ 10000000000 | random }} id: alextest-{{ 10000000000 | random }}
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
parent: parent:
type: organization type: organization
id: 636173955921 id: 636173955921
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -98,14 +98,14 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a project that does not exist - name: delete a project that does not exist
gcp_resourcemanager_project: gcp_resourcemanager_project:
name: My Sample Project name: My Sample Project
id: alextest-{{ 10000000000 | random }} id: alextest-{{ 10000000000 | random }}
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
parent: parent:
type: organization type: organization
id: 636173955921 id: 636173955921
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:

View file

@ -15,19 +15,19 @@
# Pre-test setup # Pre-test setup
- name: delete a repository - name: delete a repository
gcp_sourcerepo_repository: gcp_sourcerepo_repository:
name: projects/{{ gcp_project }}/repos/{{ resource_name }} name: projects/{{ gcp_project }}/repos/{{ resource_name }}
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 }}"
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a repository - name: create a repository
gcp_sourcerepo_repository: gcp_sourcerepo_repository:
name: projects/{{ gcp_project }}/repos/{{ resource_name }} name: projects/{{ gcp_project }}/repos/{{ resource_name }}
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 }}"
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -48,11 +48,11 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a repository that already exists - name: create a repository that already exists
gcp_sourcerepo_repository: gcp_sourcerepo_repository:
name: projects/{{ gcp_project }}/repos/{{ resource_name }} name: projects/{{ gcp_project }}/repos/{{ resource_name }}
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 }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert:
@ -61,11 +61,11 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a repository - name: delete a repository
gcp_sourcerepo_repository: gcp_sourcerepo_repository:
name: projects/{{ gcp_project }}/repos/{{ resource_name }} name: projects/{{ gcp_project }}/repos/{{ resource_name }}
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
assert: assert:
@ -86,11 +86,11 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a repository that does not exist - name: delete a repository that does not exist
gcp_sourcerepo_repository: gcp_sourcerepo_repository:
name: projects/{{ gcp_project }}/repos/{{ resource_name }} name: projects/{{ gcp_project }}/repos/{{ resource_name }}
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 }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false
assert: assert: