Bug fixes for GCP modules (#60089)

pull/60098/merge
The Magician 5 years ago committed by ansibot
parent 8241fd88de
commit 820cfbbb77

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -62,7 +62,6 @@ EXAMPLES = '''
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 = '''

@ -62,7 +62,6 @@ EXAMPLES = '''
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 = '''

@ -62,7 +62,6 @@ EXAMPLES = '''
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 = '''

@ -230,6 +230,12 @@ options:
- 'Some valid choices include: "SCRATCH", "PERSISTENT"' - 'Some valid choices include: "SCRATCH", "PERSISTENT"'
required: false required: false
type: str type: str
labels:
description:
- Labels to apply to this address. A list of key->value pairs.
required: false
type: dict
version_added: 2.9
machine_type: machine_type:
description: description:
- The machine type to use in the VM instance template. - The machine type to use in the VM instance template.
@ -673,6 +679,11 @@ properties:
the default is PERSISTENT. the default is PERSISTENT.
returned: success returned: success
type: str type: str
labels:
description:
- Labels to apply to this address. A list of key->value pairs.
returned: success
type: dict
machineType: machineType:
description: description:
- The machine type to use in the VM instance template. - The machine type to use in the VM instance template.
@ -921,6 +932,7 @@ def main():
type=dict(type='str'), type=dict(type='str'),
), ),
), ),
labels=dict(type='dict'),
machine_type=dict(required=True, type='str'), machine_type=dict(required=True, type='str'),
min_cpu_platform=dict(type='str'), min_cpu_platform=dict(type='str'),
metadata=dict(type='dict'), metadata=dict(type='dict'),
@ -1190,6 +1202,7 @@ class InstanceTemplateProperties(object):
u'canIpForward': self.request.get('can_ip_forward'), u'canIpForward': self.request.get('can_ip_forward'),
u'description': self.request.get('description'), u'description': self.request.get('description'),
u'disks': InstanceTemplateDisksArray(self.request.get('disks', []), self.module).to_request(), u'disks': InstanceTemplateDisksArray(self.request.get('disks', []), self.module).to_request(),
u'labels': self.request.get('labels'),
u'machineType': self.request.get('machine_type'), u'machineType': self.request.get('machine_type'),
u'minCpuPlatform': self.request.get('min_cpu_platform'), u'minCpuPlatform': self.request.get('min_cpu_platform'),
u'metadata': self.request.get('metadata'), u'metadata': self.request.get('metadata'),
@ -1207,6 +1220,7 @@ class InstanceTemplateProperties(object):
u'canIpForward': self.request.get(u'canIpForward'), u'canIpForward': self.request.get(u'canIpForward'),
u'description': self.request.get(u'description'), u'description': self.request.get(u'description'),
u'disks': InstanceTemplateDisksArray(self.request.get(u'disks', []), self.module).from_response(), u'disks': InstanceTemplateDisksArray(self.request.get(u'disks', []), self.module).from_response(),
u'labels': self.request.get(u'labels'),
u'machineType': self.request.get(u'machineType'), u'machineType': self.request.get(u'machineType'),
u'minCpuPlatform': self.request.get(u'minCpuPlatform'), u'minCpuPlatform': self.request.get(u'minCpuPlatform'),
u'metadata': self.request.get(u'metadata'), u'metadata': self.request.get(u'metadata'),

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''
@ -258,6 +257,11 @@ resources:
specified, the default is PERSISTENT. specified, the default is PERSISTENT.
returned: success returned: success
type: str type: str
labels:
description:
- Labels to apply to this address. A list of key->value pairs.
returned: success
type: dict
machineType: machineType:
description: description:
- The machine type to use in the VM instance template. - The machine type to use in the VM instance template.

@ -62,7 +62,6 @@ EXAMPLES = '''
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 = '''

@ -56,7 +56,6 @@ EXAMPLES = '''
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 = '''

@ -101,7 +101,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#forwardingRule'"
- name: verify that global_forwarding_rule was created - name: verify that global_forwarding_rule was created
gcp_compute_global_forwarding_rule_facts: gcp_compute_global_forwarding_rule_facts:
filters: filters:
@ -133,7 +132,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#forwardingRule'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a global forwarding rule - name: delete a global forwarding rule
gcp_compute_global_forwarding_rule: gcp_compute_global_forwarding_rule:

@ -49,7 +49,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#healthCheck'"
- name: verify that health_check was created - name: verify that health_check was created
gcp_compute_health_check_facts: gcp_compute_health_check_facts:
filters: filters:
@ -85,7 +84,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#healthCheck'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a health check - name: delete a health check
gcp_compute_health_check: gcp_compute_health_check:

@ -41,7 +41,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#httpHealthCheck'"
- name: verify that http_health_check was created - name: verify that http_health_check was created
gcp_compute_http_health_check_facts: gcp_compute_http_health_check_facts:
filters: filters:
@ -73,7 +72,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#httpHealthCheck'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a http health check - name: delete a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:

@ -41,7 +41,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#httpsHealthCheck'"
- name: verify that https_health_check was created - name: verify that https_health_check was created
gcp_compute_https_health_check_facts: gcp_compute_https_health_check_facts:
filters: filters:
@ -73,7 +72,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#httpsHealthCheck'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a https health check - name: delete a https health check
gcp_compute_https_health_check: gcp_compute_https_health_check:

@ -44,7 +44,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#image'"
- name: verify that image was created - name: verify that image was created
gcp_compute_image_facts: gcp_compute_image_facts:
filters: filters:
@ -73,7 +72,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#image'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a image - name: delete a image
gcp_compute_image: gcp_compute_image:

@ -95,7 +95,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#instance'"
- name: verify that instance was created - name: verify that instance was created
gcp_compute_instance_facts: gcp_compute_instance_facts:
filters: filters:
@ -141,7 +140,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#instance'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a instance - name: delete a instance
gcp_compute_instance: gcp_compute_instance:

@ -51,7 +51,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#instanceGroup'"
- name: verify that instance_group was created - name: verify that instance_group was created
gcp_compute_instance_group_facts: gcp_compute_instance_group_facts:
filters: filters:
@ -85,7 +84,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#instanceGroup'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a instance group - name: delete a instance group
gcp_compute_instance_group: gcp_compute_instance_group:

@ -79,7 +79,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#instanceGroupManager'"
- name: verify that instance_group_manager was created - name: verify that instance_group_manager was created
gcp_compute_instance_group_manager_facts: gcp_compute_instance_group_manager_facts:
filters: filters:
@ -112,7 +111,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#instanceGroupManager'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a instance group manager - name: delete a instance group manager
gcp_compute_instance_group_manager: gcp_compute_instance_group_manager:

@ -76,7 +76,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#instanceTemplate'"
- name: verify that instance_template was created - name: verify that instance_template was created
gcp_compute_instance_template_facts: gcp_compute_instance_template_facts:
filters: filters:
@ -117,7 +116,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#instanceTemplate'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a instance template - name: delete a instance template
gcp_compute_instance_template: gcp_compute_instance_template:

@ -35,7 +35,6 @@
assert: assert:
that: that:
- result.changed == true - result.changed == true
- "result.kind == 'compute#network'"
- name: verify that network was created - name: verify that network was created
gcp_compute_network_facts: gcp_compute_network_facts:
filters: filters:
@ -64,7 +63,6 @@
assert: assert:
that: that:
- result.changed == false - result.changed == false
- "result.kind == 'compute#network'"
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:

Loading…
Cancel
Save