mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-26 22:51:30 -07:00
examples showing an improper auth value (#87)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
9782d6906b
commit
0a18332815
98 changed files with 2171 additions and 1727 deletions
|
@ -54,6 +54,8 @@ options:
|
|||
routes.
|
||||
required: false
|
||||
type: bool
|
||||
aliases:
|
||||
- ip_forward
|
||||
disks:
|
||||
description:
|
||||
- An array of disks that are associated with the instances that are created from
|
||||
|
@ -96,11 +98,6 @@ options:
|
|||
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
|
||||
encryption key to either encrypt or decrypt this resource.
|
||||
required: false
|
||||
sha256:
|
||||
description:
|
||||
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption
|
||||
key that protects this resource.
|
||||
required: false
|
||||
index:
|
||||
description:
|
||||
- Assigns a zero-based index to this disk, where 0 is reserved for the boot
|
||||
|
@ -137,6 +134,9 @@ options:
|
|||
create a disk with one of the public operating system images, specify
|
||||
the image by its family name.
|
||||
required: false
|
||||
aliases:
|
||||
- image
|
||||
- image_family
|
||||
source_image_encryption_key:
|
||||
description:
|
||||
- The customer-supplied encryption key of the source image. Required if
|
||||
|
@ -151,11 +151,6 @@ options:
|
|||
- Specifies a 256-bit customer-supplied encryption key, encoded in
|
||||
RFC 4648 base64 to either encrypt or decrypt this resource.
|
||||
required: false
|
||||
sha256:
|
||||
description:
|
||||
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
|
||||
encryption key that protects this resource.
|
||||
required: false
|
||||
interface:
|
||||
description:
|
||||
- Specifies the disk interface to use for attaching this disk, which is either
|
||||
|
@ -181,9 +176,10 @@ options:
|
|||
- If desired, you can also attach existing non-root persistent disks using
|
||||
this property. This field is only applicable for persistent disks.
|
||||
- 'This field represents a link to a Disk resource in GCP. It can be specified
|
||||
in two ways. First, you can place in the selfLink of the resource here as
|
||||
a string Alternatively, you can add `register: name-of-resource` to a gcp_compute_disk
|
||||
task and then set this source field to "{{ name-of-resource }}"'
|
||||
in two ways. First, you can place a dictionary with key ''selfLink'' and
|
||||
value of your resource''s selfLink Alternatively, you can add `register:
|
||||
name-of-resource` to a gcp_compute_disk task and then set this source field
|
||||
to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
type:
|
||||
description:
|
||||
|
@ -266,10 +262,10 @@ options:
|
|||
address pool. If you specify a static external IP address, it must live
|
||||
in the same region as the zone of the instance.
|
||||
- 'This field represents a link to a Address resource in GCP. It can be
|
||||
specified in two ways. First, you can place in the address of the resource
|
||||
here as a string Alternatively, you can add `register: name-of-resource`
|
||||
to a gcp_compute_address task and then set this nat_ip field to "{{
|
||||
name-of-resource }}"'
|
||||
specified in two ways. First, you can place a dictionary with key ''address''
|
||||
and value of your resource''s address Alternatively, you can add `register:
|
||||
name-of-resource` to a gcp_compute_address task and then set this nat_ip
|
||||
field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
type:
|
||||
description:
|
||||
|
@ -297,11 +293,6 @@ options:
|
|||
from which to allocate the IP CIDR range for this alias IP range. If
|
||||
left unspecified, the primary range of the subnetwork will be used.
|
||||
required: false
|
||||
name:
|
||||
description:
|
||||
- The name of the network interface, generated by the server. For network
|
||||
devices, these are eth0, eth1, etc .
|
||||
required: false
|
||||
network:
|
||||
description:
|
||||
- Specifies the title of an existing network. When creating an instance, if
|
||||
|
@ -309,9 +300,10 @@ options:
|
|||
global/networks/default is used; if the network is not specified but the
|
||||
subnetwork is specified, the network is inferred.
|
||||
- 'This field represents a link to a Network resource in GCP. It can be specified
|
||||
in two ways. First, you can place in the selfLink of the resource here as
|
||||
a string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network
|
||||
task and then set this network field to "{{ name-of-resource }}"'
|
||||
in two ways. First, you can place a dictionary with key ''selfLink'' and
|
||||
value of your resource''s selfLink Alternatively, you can add `register:
|
||||
name-of-resource` to a gcp_compute_network task and then set this network
|
||||
field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
network_ip:
|
||||
description:
|
||||
|
@ -326,10 +318,10 @@ options:
|
|||
If the network is in auto subnet mode, providing the subnetwork is optional.
|
||||
If the network is in custom subnet mode, then this field should be specified.
|
||||
- 'This field represents a link to a Subnetwork resource in GCP. It can be
|
||||
specified in two ways. First, you can place in the selfLink of the resource
|
||||
here as a string Alternatively, you can add `register: name-of-resource`
|
||||
to a gcp_compute_subnetwork task and then set this subnetwork field to "{{
|
||||
name-of-resource }}"'
|
||||
specified in two ways. First, you can place a dictionary with key ''selfLink''
|
||||
and value of your resource''s selfLink Alternatively, you can add `register:
|
||||
name-of-resource` to a gcp_compute_subnetwork task and then set this subnetwork
|
||||
field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
scheduling:
|
||||
description:
|
||||
|
@ -419,33 +411,33 @@ extends_documentation_fragment: gcp
|
|||
EXAMPLES = '''
|
||||
- name: create a disk
|
||||
gcp_compute_disk:
|
||||
name: "disk-instance"
|
||||
size_gb: 50
|
||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
||||
zone: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: disk-instance
|
||||
size_gb: 50
|
||||
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
|
||||
zone: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: disk
|
||||
|
||||
- name: create a network
|
||||
gcp_compute_network:
|
||||
name: "network-instance"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: network-instance
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: network
|
||||
|
||||
- name: create a address
|
||||
gcp_compute_address:
|
||||
name: "address-instance"
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
name: address-instance
|
||||
region: us-central1
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
state: present
|
||||
register: address
|
||||
|
||||
- name: create a instance
|
||||
|
@ -627,7 +619,7 @@ disks:
|
|||
- If desired, you can also attach existing non-root persistent disks using this
|
||||
property. This field is only applicable for persistent disks.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
type:
|
||||
description:
|
||||
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified,
|
||||
|
@ -723,7 +715,7 @@ networkInterfaces:
|
|||
address pool. If you specify a static external IP address, it must live
|
||||
in the same region as the zone of the instance.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
type:
|
||||
description:
|
||||
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
||||
|
@ -765,7 +757,7 @@ networkInterfaces:
|
|||
is used; if the network is not specified but the subnetwork is specified,
|
||||
the network is inferred.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
networkIP:
|
||||
description:
|
||||
- An IPv4 internal network address to assign to the instance for this network
|
||||
|
@ -780,7 +772,7 @@ networkInterfaces:
|
|||
the network is in auto subnet mode, providing the subnetwork is optional.
|
||||
If the network is in custom subnet mode, then this field should be specified.
|
||||
returned: success
|
||||
type: str
|
||||
type: dict
|
||||
scheduling:
|
||||
description:
|
||||
- Sets the scheduling options for this instance.
|
||||
|
@ -889,7 +881,7 @@ def main():
|
|||
module = GcpModule(
|
||||
argument_spec=dict(
|
||||
state=dict(default='present', choices=['present', 'absent'], type='str'),
|
||||
can_ip_forward=dict(type='bool'),
|
||||
can_ip_forward=dict(type='bool', aliases=['ip_forward']),
|
||||
disks=dict(
|
||||
type='list',
|
||||
elements='dict',
|
||||
|
@ -897,7 +889,7 @@ def main():
|
|||
auto_delete=dict(type='bool'),
|
||||
boot=dict(type='bool'),
|
||||
device_name=dict(type='str'),
|
||||
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'), sha256=dict(type='str'))),
|
||||
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))),
|
||||
index=dict(type='int'),
|
||||
initialize_params=dict(
|
||||
type='dict',
|
||||
|
@ -905,13 +897,13 @@ def main():
|
|||
disk_name=dict(type='str'),
|
||||
disk_size_gb=dict(type='int'),
|
||||
disk_type=dict(type='str'),
|
||||
source_image=dict(type='str'),
|
||||
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))),
|
||||
source_image=dict(type='str', aliases=['image', 'image_family']),
|
||||
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||
),
|
||||
),
|
||||
interface=dict(type='str', choices=['SCSI', 'NVME']),
|
||||
mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']),
|
||||
source=dict(),
|
||||
source=dict(type='dict'),
|
||||
type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']),
|
||||
),
|
||||
),
|
||||
|
@ -928,13 +920,14 @@ def main():
|
|||
access_configs=dict(
|
||||
type='list',
|
||||
elements='dict',
|
||||
options=dict(name=dict(required=True, type='str'), nat_ip=dict(), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])),
|
||||
options=dict(
|
||||
name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])
|
||||
),
|
||||
),
|
||||
alias_ip_ranges=dict(type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))),
|
||||
name=dict(type='str'),
|
||||
network=dict(),
|
||||
network=dict(type='dict'),
|
||||
network_ip=dict(type='str'),
|
||||
subnetwork=dict(),
|
||||
subnetwork=dict(type='dict'),
|
||||
),
|
||||
),
|
||||
scheduling=dict(
|
||||
|
@ -1170,7 +1163,7 @@ def raise_if_errors(response, err_path, module):
|
|||
|
||||
|
||||
def encode_request(request, module):
|
||||
if 'metadata' in request:
|
||||
if 'metadata' in request and request['metadata'] is not None:
|
||||
request['metadata'] = metadata_encoder(request['metadata'])
|
||||
return request
|
||||
|
||||
|
@ -1309,14 +1302,10 @@ class InstanceDiskencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
def to_request(self):
|
||||
return remove_nones_from_dict(
|
||||
{u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key'), u'sha256': self.request.get('sha256')}
|
||||
)
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key')})
|
||||
|
||||
def from_response(self):
|
||||
return remove_nones_from_dict(
|
||||
{u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey'), u'sha256': self.request.get(u'sha256')}
|
||||
)
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey')})
|
||||
|
||||
|
||||
class InstanceInitializeparams(object):
|
||||
|
@ -1359,10 +1348,10 @@ class InstanceSourceimageencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
def to_request(self):
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')})
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
|
||||
|
||||
def from_response(self):
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')})
|
||||
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
|
||||
|
||||
|
||||
class InstanceGuestacceleratorsArray(object):
|
||||
|
@ -1417,7 +1406,6 @@ class InstanceNetworkinterfacesArray(object):
|
|||
{
|
||||
u'accessConfigs': InstanceAccessconfigsArray(item.get('access_configs', []), self.module).to_request(),
|
||||
u'aliasIpRanges': InstanceAliasiprangesArray(item.get('alias_ip_ranges', []), self.module).to_request(),
|
||||
u'name': item.get('name'),
|
||||
u'network': replace_resource_dict(item.get(u'network', {}), 'selfLink'),
|
||||
u'networkIP': item.get('network_ip'),
|
||||
u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'),
|
||||
|
@ -1429,7 +1417,6 @@ class InstanceNetworkinterfacesArray(object):
|
|||
{
|
||||
u'accessConfigs': InstanceAccessconfigsArray(item.get(u'accessConfigs', []), self.module).from_response(),
|
||||
u'aliasIpRanges': InstanceAliasiprangesArray(item.get(u'aliasIpRanges', []), self.module).from_response(),
|
||||
u'name': item.get(u'name'),
|
||||
u'network': item.get(u'network'),
|
||||
u'networkIP': item.get(u'networkIP'),
|
||||
u'subnetwork': item.get(u'subnetwork'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue