From ea46d5548b178e91351638b7d3d1c1a5948b6f5f Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Fri, 9 Dec 2016 14:11:31 +0000 Subject: [PATCH] Native YAML - cloud/softlayer/sl_vm.py (#19056) * Native YAML - cloud/softlayer/sl_vm.py * Pointless to delegate/localaction, since we are already running on localhost --- lib/ansible/modules/cloud/softlayer/sl_vm.py | 48 ++++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/cloud/softlayer/sl_vm.py b/lib/ansible/modules/cloud/softlayer/sl_vm.py index b24c0f06fac..ef0eba8dbc3 100644 --- a/lib/ansible/modules/cloud/softlayer/sl_vm.py +++ b/lib/ansible/modules/cloud/softlayer/sl_vm.py @@ -149,8 +149,7 @@ EXAMPLES = ''' gather_facts: False tasks: - name: Build instance request - local_action: - module: sl_vm + sl_vm: hostname: instance-1 domain: anydomain.com datacenter: dal09 @@ -170,8 +169,7 @@ EXAMPLES = ''' gather_facts: False tasks: - name: Build instances request - local_action: - module: sl_vm + sl_vm: hostname: "{{ item.hostname }}" domain: "{{ item.domain }}" datacenter: "{{ item.datacenter }}" @@ -187,17 +185,49 @@ EXAMPLES = ''' ssh_keys: "{{ item.ssh_keys }}" wait: "{{ item.wait }}" with_items: - - { hostname: 'instance-2', domain: 'anydomain.com', datacenter: 'dal09', tags: ['ansible-module-test', 'ansible-module-test-slaves'], hourly: True, private: False, dedicated: False, local_disk: True, cpus: 1, memory: 1024, disks: [25,100], os_code: 'UBUNTU_LATEST', ssh_keys: [], wait: True } - - { hostname: 'instance-3', domain: 'anydomain.com', datacenter: 'dal09', tags: ['ansible-module-test', 'ansible-module-test-slaves'], hourly: True, private: False, dedicated: False, local_disk: True, cpus: 1, memory: 1024, disks: [25,100], os_code: 'UBUNTU_LATEST', ssh_keys: [], wait: True } - + - hostname: instance-2 + domain: anydomain.com + datacenter: dal09 + tags: + - ansible-module-test + - ansible-module-test-slaves + hourly: True + private: False + dedicated: False + local_disk: True + cpus: 1 + memory: 1024 + disks: + - 25 + - 100 + os_code: UBUNTU_LATEST + ssh_keys: [] + wait: True + - hostname: instance-3 + domain: anydomain.com + datacenter: dal09 + tags: + - ansible-module-test + - ansible-module-test-slaves + hourly: True + private: False + dedicated: False + local_disk: True + cpus: 1 + memory: 1024 + disks: + - 25 + - 100 + os_code: UBUNTU_LATEST + ssh_keys: [] + wait: True - name: Cancel instances hosts: localhost gather_facts: False tasks: - name: Cancel by tag - local_action: - module: sl_vm + sl_vm: state: absent tags: ansible-module-test '''