From 28d30a04aa865f00eba9e5906c9dac990173e977 Mon Sep 17 00:00:00 2001 From: Majeed Mirza Date: Tue, 24 Sep 2019 11:18:49 -0400 Subject: [PATCH] SoftLayer: Added flavor option (#56036) * Added flavor option Added flavor option to allow for use of SoftLayer flavor templates when creating new virtual machines. See here for examples of ordering a vm with the flavor parameter: https://softlayer-python.readthedocs.io/en/latest/api/managers/vs.html To see flavor options use: `slcli vs create-options` * Update sl_vm.py * Update sl_vm.py * fixed version --- lib/ansible/modules/cloud/softlayer/sl_vm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/cloud/softlayer/sl_vm.py b/lib/ansible/modules/cloud/softlayer/sl_vm.py index b46704c9e98..f47f0562b5a 100644 --- a/lib/ansible/modules/cloud/softlayer/sl_vm.py +++ b/lib/ansible/modules/cloud/softlayer/sl_vm.py @@ -63,6 +63,10 @@ options: description: - Amount of memory to be assigned to new virtual instance. required: true + flavor: + description: + - Specify which SoftLayer flavor template to use instead of cpus and memory. + version_added: "2.10" disks: description: - List of disk sizes to be assigned to new virtual instance. @@ -263,6 +267,7 @@ def create_virtual_instance(module): domain=module.params.get('domain'), cpus=module.params.get('cpus'), memory=module.params.get('memory'), + flavor=module.params.get('flavor'), hourly=module.params.get('hourly'), datacenter=module.params.get('datacenter'), os_code=module.params.get('os_code'), @@ -338,6 +343,7 @@ def main(): local_disk=dict(type='bool', default=True), cpus=dict(type='int', choices=CPU_SIZES), memory=dict(type='int', choices=MEMORY_SIZES), + flavor=dict(type='str'), disks=dict(type='list', default=[25]), os_code=dict(type='str'), image_id=dict(type='str'),