mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added the ability to set the size of the boot volume. (#19703)
* Added the ability to set the size of the boot volume. * Made disk_size parameter of type int with 10 default.
This commit is contained in:
parent
cd3fdca540
commit
1d80a8dbfb
1 changed files with 10 additions and 1 deletions
|
@ -171,6 +171,12 @@ options:
|
||||||
(requires libcloud >= 0.20.0)
|
(requires libcloud >= 0.20.0)
|
||||||
required: false
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
|
disk_size:
|
||||||
|
description:
|
||||||
|
- The size of the boot disk created for this instance (in GB)
|
||||||
|
required: false
|
||||||
|
default: 10
|
||||||
|
version_added: "2.3"
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
|
@ -197,6 +203,7 @@ EXAMPLES = '''
|
||||||
service_account_email: "your-sa@your-project-name.iam.gserviceaccount.com"
|
service_account_email: "your-sa@your-project-name.iam.gserviceaccount.com"
|
||||||
credentials_file: "/path/to/your-key.json"
|
credentials_file: "/path/to/your-key.json"
|
||||||
project_id: "your-project-name"
|
project_id: "your-project-name"
|
||||||
|
disk_size: 32
|
||||||
|
|
||||||
# Create a single Debian 8 instance in the us-central1-a Zone
|
# Create a single Debian 8 instance in the us-central1-a Zone
|
||||||
# Use existing disks, custom network/subnetwork, set service account permissions
|
# Use existing disks, custom network/subnetwork, set service account permissions
|
||||||
|
@ -384,6 +391,7 @@ def create_instances(module, gce, instance_names, number):
|
||||||
external_ip = module.params.get('external_ip')
|
external_ip = module.params.get('external_ip')
|
||||||
disk_auto_delete = module.params.get('disk_auto_delete')
|
disk_auto_delete = module.params.get('disk_auto_delete')
|
||||||
preemptible = module.params.get('preemptible')
|
preemptible = module.params.get('preemptible')
|
||||||
|
disk_size = module.params.get('disk_size')
|
||||||
service_account_permissions = module.params.get('service_account_permissions')
|
service_account_permissions = module.params.get('service_account_permissions')
|
||||||
service_account_email = module.params.get('service_account_email')
|
service_account_email = module.params.get('service_account_email')
|
||||||
|
|
||||||
|
@ -505,7 +513,7 @@ def create_instances(module, gce, instance_names, number):
|
||||||
try:
|
try:
|
||||||
pd = gce.ex_get_volume("%s" % instance, lc_zone)
|
pd = gce.ex_get_volume("%s" % instance, lc_zone)
|
||||||
except ResourceNotFoundError:
|
except ResourceNotFoundError:
|
||||||
pd = gce.create_volume(None, "%s" % instance, image=lc_image())
|
pd = gce.create_volume(disk_size, "%s" % instance, image=lc_image())
|
||||||
gce_args['ex_boot_disk'] = pd
|
gce_args['ex_boot_disk'] = pd
|
||||||
|
|
||||||
inst = None
|
inst = None
|
||||||
|
@ -635,6 +643,7 @@ def main():
|
||||||
ip_forward = dict(type='bool', default=False),
|
ip_forward = dict(type='bool', default=False),
|
||||||
external_ip=dict(default='ephemeral'),
|
external_ip=dict(default='ephemeral'),
|
||||||
disk_auto_delete = dict(type='bool', default=True),
|
disk_auto_delete = dict(type='bool', default=True),
|
||||||
|
disk_size = dict(type='int', default=10),
|
||||||
preemptible = dict(type='bool', default=None),
|
preemptible = dict(type='bool', default=None),
|
||||||
),
|
),
|
||||||
mutually_exclusive=[('instance_names', 'name')]
|
mutually_exclusive=[('instance_names', 'name')]
|
||||||
|
|
Loading…
Reference in a new issue