community.general.sl_vm – create or cancel a virtual instance in SoftLayer¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.sl_vm
.
Synopsis¶
Creates or cancels SoftLayer instances.
When created, optionally waits for it to be ‘running’.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
softlayer >= 4.1.1
Parameters¶
Examples¶
- name: Build instance
hosts: localhost
gather_facts: no
tasks:
- name: Build instance request
community.general.sl_vm:
hostname: instance-1
domain: anydomain.com
datacenter: dal09
tags: ansible-module-test
hourly: yes
private: no
dedicated: no
local_disk: yes
cpus: 1
memory: 1024
disks: [25]
os_code: UBUNTU_LATEST
wait: no
- name: Build additional instances
hosts: localhost
gather_facts: no
tasks:
- name: Build instances request
community.general.sl_vm:
hostname: "{{ item.hostname }}"
domain: "{{ item.domain }}"
datacenter: "{{ item.datacenter }}"
tags: "{{ item.tags }}"
hourly: "{{ item.hourly }}"
private: "{{ item.private }}"
dedicated: "{{ item.dedicated }}"
local_disk: "{{ item.local_disk }}"
cpus: "{{ item.cpus }}"
memory: "{{ item.memory }}"
disks: "{{ item.disks }}"
os_code: "{{ item.os_code }}"
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: yes
private: no
dedicated: no
local_disk: yes
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: yes
private: no
dedicated: no
local_disk: yes
cpus: 1
memory: 1024
disks:
- 25
- 100
os_code: UBUNTU_LATEST
ssh_keys: []
wait: yes
- name: Cancel instances
hosts: localhost
gather_facts: no
tasks:
- name: Cancel by tag
community.general.sl_vm:
state: absent
tags: ansible-module-test
Authors¶
Matt Colton (@mcltn)