mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-28 07:31:29 -07:00
Changing NodePool from Zone to Location (#182)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
ba60e76aee
commit
1ec588abb1
5 changed files with 59 additions and 46 deletions
|
@ -40,10 +40,14 @@ requirements:
|
|||
- requests >= 2.18.4
|
||||
- google-auth >= 1.3.0
|
||||
options:
|
||||
zone:
|
||||
location:
|
||||
description:
|
||||
- The zone where the node pool is deployed.
|
||||
- The location where the node pool is deployed.
|
||||
required: true
|
||||
aliases:
|
||||
- region
|
||||
- zone
|
||||
version_added: 2.8
|
||||
cluster:
|
||||
description:
|
||||
- The cluster this node pool belongs to.
|
||||
|
@ -59,7 +63,7 @@ EXAMPLES = '''
|
|||
- name: a node pool facts
|
||||
gcp_container_node_pool_facts:
|
||||
cluster: "{{ cluster }}"
|
||||
zone: us-central1-a
|
||||
location: us-central1-a
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
service_account_file: "/tmp/auth.pem"
|
||||
|
@ -248,9 +252,9 @@ items:
|
|||
- The cluster this node pool belongs to.
|
||||
returned: success
|
||||
type: str
|
||||
zone:
|
||||
location:
|
||||
description:
|
||||
- The zone where the node pool is deployed.
|
||||
- The location where the node pool is deployed.
|
||||
returned: success
|
||||
type: str
|
||||
'''
|
||||
|
@ -267,7 +271,7 @@ import json
|
|||
|
||||
|
||||
def main():
|
||||
module = GcpModule(argument_spec=dict(zone=dict(required=True, type='str'), cluster=dict(required=True)))
|
||||
module = GcpModule(argument_spec=dict(location=dict(required=True, type='str', aliases=['region', 'zone']), cluster=dict(required=True)))
|
||||
|
||||
if not module.params['scopes']:
|
||||
module.params['scopes'] = ['https://www.googleapis.com/auth/cloud-platform']
|
||||
|
@ -282,8 +286,8 @@ def main():
|
|||
|
||||
|
||||
def collection(module):
|
||||
res = {'project': module.params['project'], 'zone': module.params['zone'], 'cluster': replace_resource_dict(module.params['cluster'], 'name')}
|
||||
return "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/clusters/{cluster}/nodePools".format(**res)
|
||||
res = {'project': module.params['project'], 'location': module.params['location'], 'cluster': replace_resource_dict(module.params['cluster'], 'name')}
|
||||
return "https://container.googleapis.com/v1/projects/{project}/zones/{location}/clusters/{cluster}/nodePools".format(**res)
|
||||
|
||||
|
||||
def fetch_list(module, link):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue