diff --git a/lib/ansible/modules/cloud/google/gcp_compute_disk.py b/lib/ansible/modules/cloud/google/gcp_compute_disk.py index c9c53d66776be5..4c2c197f4425db 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_disk.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_disk.py @@ -89,6 +89,15 @@ of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. required: false + physical_block_size_bytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a request, + a default value is used. Currently supported sizes are 4096 and 16384, other + sizes may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + required: false + version_added: 2.8 type: description: - URL of the disk type resource describing which disk type to use to create the @@ -262,6 +271,15 @@ .' returned: success type: list +physicalBlockSizeBytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a request, + a default value is used. Currently supported sizes are 4096 and 16384, other sizes + may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + returned: success + type: int type: description: - URL of the disk type resource describing which disk type to use to create the @@ -417,6 +435,7 @@ def main(): licenses=dict(type='list', elements='str'), name=dict(required=True, type='str'), size_gb=dict(type='int'), + physical_block_size_bytes=dict(type='int'), type=dict(type='str'), source_image=dict(type='str'), zone=dict(required=True, type='str'), @@ -507,6 +526,7 @@ def resource_to_request(module): u'licenses': module.params.get('licenses'), u'name': module.params.get('name'), u'sizeGb': module.params.get('size_gb'), + u'physicalBlockSizeBytes': module.params.get('physical_block_size_bytes'), u'type': disk_type_selflink(module.params.get('type'), module.params), u'sourceImage': module.params.get('source_image'), } @@ -585,6 +605,7 @@ def response_to_hash(module, response): u'name': module.params.get('name'), u'sizeGb': response.get(u'sizeGb'), u'users': response.get(u'users'), + u'physicalBlockSizeBytes': response.get(u'physicalBlockSizeBytes'), u'type': response.get(u'type'), u'sourceImage': module.params.get('source_image'), } diff --git a/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py index 4cd90eec417248..0eac0ae6d0a18e 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py @@ -138,6 +138,15 @@ .' returned: success type: list + physicalBlockSizeBytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a + request, a default value is used. Currently supported sizes are 4096 and 16384, + other sizes may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + returned: success + type: int type: description: - URL of the disk type resource describing which disk type to use to create diff --git a/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py b/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py index 416e85bced6167..cd2500b12f8ff4 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py @@ -88,6 +88,14 @@ of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. required: false + physical_block_size_bytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a request, + a default value is used. Currently supported sizes are 4096 and 16384, other + sizes may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + required: false replica_zones: description: - URLs of the zones where the disk should be replicated to. @@ -230,6 +238,15 @@ .' returned: success type: list +physicalBlockSizeBytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a request, + a default value is used. Currently supported sizes are 4096 and 16384, other sizes + may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + returned: success + type: int replicaZones: description: - URLs of the zones where the disk should be replicated to. @@ -332,6 +349,7 @@ def main(): licenses=dict(type='list', elements='str'), name=dict(required=True, type='str'), size_gb=dict(type='int'), + physical_block_size_bytes=dict(type='int'), replica_zones=dict(required=True, type='list', elements='str'), type=dict(type='str'), region=dict(required=True, type='str'), @@ -420,6 +438,7 @@ def resource_to_request(module): u'licenses': module.params.get('licenses'), u'name': module.params.get('name'), u'sizeGb': module.params.get('size_gb'), + u'physicalBlockSizeBytes': module.params.get('physical_block_size_bytes'), u'replicaZones': module.params.get('replica_zones'), u'type': region_disk_type_selflink(module.params.get('type'), module.params), } @@ -498,6 +517,7 @@ def response_to_hash(module, response): u'name': module.params.get('name'), u'sizeGb': response.get(u'sizeGb'), u'users': response.get(u'users'), + u'physicalBlockSizeBytes': response.get(u'physicalBlockSizeBytes'), u'replicaZones': response.get(u'replicaZones'), u'type': response.get(u'type'), } diff --git a/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py index d2f310d1cc20da..d571944e002b0f 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py @@ -138,6 +138,15 @@ .' returned: success type: list + physicalBlockSizeBytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a + request, a default value is used. Currently supported sizes are 4096 and 16384, + other sizes may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + returned: success + type: int replicaZones: description: - URLs of the zones where the disk should be replicated to.