Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Ansible support on the Magician. #7

Merged
merged 1 commit into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/ansible/modules/cloud/google/gcp_compute_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
required: false
region:
description:
- A reference to Region resource.
- URL of the region where the regional address resides.
- This field is not applicable to global addresses.
required: true
extends_documentation_fragment: gcp
'''
Expand Down Expand Up @@ -128,7 +129,8 @@
type: list
region:
description:
- A reference to Region resource.
- URL of the region where the regional address resides.
- This field is not applicable to global addresses.
returned: success
type: str
'''
Expand Down
20 changes: 16 additions & 4 deletions lib/ansible/modules/cloud/google/gcp_compute_backend_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@
required: false
group:
description:
- A reference to InstanceGroup resource.
- This instance group defines the list of instances that serve traffic. Member virtual
machine instances from each instance group must live in the same zone as the instance
group itself.
- No two backends in a backend service are allowed to use same Instance Group resource.
- When the BackendService has load balancing scheme INTERNAL, the instance group must
be in a zone within the same region as the BackendService.
required: false
max_connections:
description:
Expand Down Expand Up @@ -215,7 +220,8 @@
choices: ['HTTP', 'HTTPS', 'TCP', 'SSL']
region:
description:
- A reference to Region resource.
- The region where the regional backend service resides.
- This field is not applicable to global backend services.
required: false
session_affinity:
description:
Expand Down Expand Up @@ -318,7 +324,12 @@
type: str
group:
description:
- A reference to InstanceGroup resource.
- This instance group defines the list of instances that serve traffic. Member virtual
machine instances from each instance group must live in the same zone as the instance
group itself.
- No two backends in a backend service are allowed to use same Instance Group resource.
- When the BackendService has load balancing scheme INTERNAL, the instance group must
be in a zone within the same region as the BackendService.
returned: success
type: dict
max_connections:
Expand Down Expand Up @@ -476,7 +487,8 @@
type: str
region:
description:
- A reference to Region resource.
- The region where the regional backend service resides.
- This field is not applicable to global backend services.
returned: success
type: str
session_affinity:
Expand Down
25 changes: 22 additions & 3 deletions lib/ansible/modules/cloud/google/gcp_compute_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
- An optional description of this resource. Provide this property when you create
the resource.
required: false
labels:
description:
- Labels to apply to this disk. A list of key->value pairs.
required: false
licenses:
description:
- Any applicable publicly visible licenses.
Expand Down Expand Up @@ -96,9 +100,14 @@
family. Replace the image name with family/family-name: global/images/family/my-private-family
.'
required: false
type:
description:
- URL of the disk type resource describing which disk type to use to create the disk.
Provide this when creating the disk.
required: false
zone:
description:
- A reference to Zone resource.
- A reference to the zone where the disk resides.
required: true
disk_encryption_key:
description:
Expand Down Expand Up @@ -209,6 +218,11 @@
- Last dettach timestamp in RFC3339 text format.
returned: success
type: str
labels:
description:
- Labels to apply to this disk. A list of key->value pairs.
returned: success
type: dict
licenses:
description:
- Any applicable publicly visible licenses.
Expand Down Expand Up @@ -262,7 +276,7 @@
type: list
zone:
description:
- A reference to Zone resource.
- A reference to the zone where the disk resides.
returned: success
type: str
disk_encryption_key:
Expand Down Expand Up @@ -378,10 +392,12 @@ def main():
argument_spec=dict(
state=dict(default='present', choices=['present', 'absent'], type='str'),
description=dict(type='str'),
labels=dict(type='dict'),
licenses=dict(type='list', elements='str'),
name=dict(type='str'),
size_gb=dict(type='int'),
source_image=dict(type='str'),
type=dict(type='str'),
zone=dict(required=True, type='str'),
disk_encryption_key=dict(type='dict', options=dict(
raw_key=dict(type='str'),
Expand Down Expand Up @@ -447,10 +463,12 @@ def resource_to_request(module):
u'sourceImageEncryptionKey': DiskSourImagEncrKey(module.params.get('source_image_encryption_key', {}), module).to_request(),
u'sourceSnapshotEncryptionKey': DiskSourSnapEncrKey(module.params.get('source_snapshot_encryption_key', {}), module).to_request(),
u'description': module.params.get('description'),
u'labels': module.params.get('labels'),
u'licenses': module.params.get('licenses'),
u'name': module.params.get('name'),
u'sizeGb': module.params.get('size_gb'),
u'sourceImage': module.params.get('source_image')
u'sourceImage': module.params.get('source_image'),
u'type': module.params.get('type')
}
return_vals = {}
for k, v in request.items():
Expand Down Expand Up @@ -523,6 +541,7 @@ def response_to_hash(module, response):
u'id': response.get(u'id'),
u'lastAttachTimestamp': response.get(u'lastAttachTimestamp'),
u'lastDetachTimestamp': response.get(u'lastDetachTimestamp'),
u'labels': response.get(u'labels'),
u'licenses': response.get(u'licenses'),
u'name': response.get(u'name'),
u'sizeGb': response.get(u'sizeGb'),
Expand Down
50 changes: 40 additions & 10 deletions lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
choices: ['TCP', 'UDP', 'ESP', 'AH', 'SCTP', 'ICMP']
backend_service:
description:
- A reference to BackendService resource.
- A reference to a BackendService to receive the matched traffic.
- This is used for internal load balancing.
- "(not used for external load balancing) ."
required: false
ip_version:
description:
Expand Down Expand Up @@ -110,7 +112,10 @@
required: true
network:
description:
- A reference to Network resource.
- For internal load balancing, this field identifies the network that the load balanced
IP should belong to for this Forwarding Rule. If this field is not specified, the
default network will be used.
- This field is not used for external load balancing.
required: false
port_range:
description:
Expand All @@ -136,15 +141,25 @@
required: false
subnetwork:
description:
- A reference to Subnetwork resource.
- A reference to a subnetwork.
- For internal load balancing, this field identifies the subnetwork that the load
balanced IP should belong to for this Forwarding Rule.
- If the network specified is in auto subnet mode, this field is optional. However,
if the network is in custom subnet mode, a subnetwork must be specified.
- This field is not used for external load balancing.
required: false
target:
description:
- A reference to TargetPool resource.
- A reference to a TargetPool resource to receive the matched traffic.
- For regional forwarding rules, this target must live in the same region as the forwarding
rule. For global forwarding rules, this target must be a global load balancing resource.
The forwarded traffic must be of a type appropriate to the target object.
- This field is not used for internal load balancing.
required: false
region:
description:
- A reference to Region resource.
- A reference to the region where the regional forwarding rule resides.
- This field is not applicable to global forwarding rules.
required: true
extends_documentation_fragment: gcp
'''
Expand Down Expand Up @@ -235,7 +250,9 @@
type: str
backend_service:
description:
- A reference to BackendService resource.
- A reference to a BackendService to receive the matched traffic.
- This is used for internal load balancing.
- "(not used for external load balancing) ."
returned: success
type: dict
ip_version:
Expand Down Expand Up @@ -265,7 +282,10 @@
type: str
network:
description:
- A reference to Network resource.
- For internal load balancing, this field identifies the network that the load balanced
IP should belong to for this Forwarding Rule. If this field is not specified, the
default network will be used.
- This field is not used for external load balancing.
returned: success
type: dict
port_range:
Expand Down Expand Up @@ -294,17 +314,27 @@
type: list
subnetwork:
description:
- A reference to Subnetwork resource.
- A reference to a subnetwork.
- For internal load balancing, this field identifies the subnetwork that the load
balanced IP should belong to for this Forwarding Rule.
- If the network specified is in auto subnet mode, this field is optional. However,
if the network is in custom subnet mode, a subnetwork must be specified.
- This field is not used for external load balancing.
returned: success
type: dict
target:
description:
- A reference to TargetPool resource.
- A reference to a TargetPool resource to receive the matched traffic.
- For regional forwarding rules, this target must live in the same region as the forwarding
rule. For global forwarding rules, this target must be a global load balancing resource.
The forwarded traffic must be of a type appropriate to the target object.
- This field is not used for internal load balancing.
returned: success
type: dict
region:
description:
- A reference to Region resource.
- A reference to the region where the regional forwarding rule resides.
- This field is not applicable to global forwarding rules.
returned: success
type: str
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
type: str
region:
description:
- A reference to Region resource.
- A reference to the region where the regional address resides.
returned: success
type: str
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
choices: ['TCP', 'UDP', 'ESP', 'AH', 'SCTP', 'ICMP']
backend_service:
description:
- A reference to BackendService resource.
- A reference to a BackendService to receive the matched traffic.
- This is used for internal load balancing.
- "(not used for external load balancing) ."
required: false
ip_version:
description:
Expand Down Expand Up @@ -112,7 +114,10 @@
required: true
network:
description:
- A reference to Network resource.
- For internal load balancing, this field identifies the network that the load balanced
IP should belong to for this Forwarding Rule. If this field is not specified, the
default network will be used.
- This field is not used for external load balancing.
required: false
port_range:
description:
Expand All @@ -138,7 +143,12 @@
required: false
subnetwork:
description:
- A reference to Subnetwork resource.
- A reference to a subnetwork.
- For internal load balancing, this field identifies the subnetwork that the load
balanced IP should belong to for this Forwarding Rule.
- If the network specified is in auto subnet mode, this field is optional. However,
if the network is in custom subnet mode, a subnetwork must be specified.
- This field is not used for external load balancing.
required: false
target:
description:
Expand Down Expand Up @@ -284,7 +294,9 @@
type: str
backend_service:
description:
- A reference to BackendService resource.
- A reference to a BackendService to receive the matched traffic.
- This is used for internal load balancing.
- "(not used for external load balancing) ."
returned: success
type: dict
ip_version:
Expand Down Expand Up @@ -314,7 +326,10 @@
type: str
network:
description:
- A reference to Network resource.
- For internal load balancing, this field identifies the network that the load balanced
IP should belong to for this Forwarding Rule. If this field is not specified, the
default network will be used.
- This field is not used for external load balancing.
returned: success
type: dict
port_range:
Expand Down Expand Up @@ -343,12 +358,18 @@
type: list
subnetwork:
description:
- A reference to Subnetwork resource.
- A reference to a subnetwork.
- For internal load balancing, this field identifies the subnetwork that the load
balanced IP should belong to for this Forwarding Rule.
- If the network specified is in auto subnet mode, this field is optional. However,
if the network is in custom subnet mode, a subnetwork must be specified.
- This field is not used for external load balancing.
returned: success
type: dict
region:
description:
- A reference to Region resource.
- A reference to the region where the regional forwarding rule resides.
- This field is not applicable to global forwarding rules.
returned: success
type: str
target:
Expand Down
6 changes: 4 additions & 2 deletions lib/ansible/modules/cloud/google/gcp_compute_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@
required: false
source_disk:
description:
- A reference to Disk resource.
- Refers to a gcompute_disk object You must provide either this property or the rawDisk.source
property but not both to create an image.
required: false
source_disk_encryption_key:
description:
Expand Down Expand Up @@ -364,7 +365,8 @@
type: str
source_disk:
description:
- A reference to Disk resource.
- Refers to a gcompute_disk object You must provide either this property or the rawDisk.source
property but not both to create an image.
returned: success
type: dict
source_disk_encryption_key:
Expand Down
Loading