|
|
@ -223,8 +223,7 @@ extends_documentation_fragment: cloudstack
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = '''
|
|
|
|
# Create a instance from an ISO
|
|
|
|
# Create a instance from an ISO
|
|
|
|
# NOTE: Names of offerings and ISOs depending on the CloudStack configuration.
|
|
|
|
# NOTE: Names of offerings and ISOs depending on the CloudStack configuration.
|
|
|
|
- local_action:
|
|
|
|
- cs_instance:
|
|
|
|
module: cs_instance
|
|
|
|
|
|
|
|
name: web-vm-1
|
|
|
|
name: web-vm-1
|
|
|
|
iso: Linux Debian 7 64-bit
|
|
|
|
iso: Linux Debian 7 64-bit
|
|
|
|
hypervisor: VMware
|
|
|
|
hypervisor: VMware
|
|
|
@ -237,50 +236,64 @@ EXAMPLES = '''
|
|
|
|
- Server Integration
|
|
|
|
- Server Integration
|
|
|
|
- Sync Integration
|
|
|
|
- Sync Integration
|
|
|
|
- Storage Integration
|
|
|
|
- Storage Integration
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
# For changing a running instance, use the 'force' parameter
|
|
|
|
# For changing a running instance, use the 'force' parameter
|
|
|
|
- local_action:
|
|
|
|
- cs_instance:
|
|
|
|
module: cs_instance
|
|
|
|
|
|
|
|
name: web-vm-1
|
|
|
|
name: web-vm-1
|
|
|
|
display_name: web-vm-01.example.com
|
|
|
|
display_name: web-vm-01.example.com
|
|
|
|
iso: Linux Debian 7 64-bit
|
|
|
|
iso: Linux Debian 7 64-bit
|
|
|
|
service_offering: 2cpu_2gb
|
|
|
|
service_offering: 2cpu_2gb
|
|
|
|
force: yes
|
|
|
|
force: yes
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
# Create or update a instance on Exoscale's public cloud using display_name.
|
|
|
|
# Create or update a instance on Exoscale's public cloud using display_name.
|
|
|
|
# Note: user_data can be used to kickstart the instance using cloud-init yaml config.
|
|
|
|
# Note: user_data can be used to kickstart the instance using cloud-init yaml config.
|
|
|
|
- local_action:
|
|
|
|
- cs_instance:
|
|
|
|
module: cs_instance
|
|
|
|
|
|
|
|
display_name: web-vm-1
|
|
|
|
display_name: web-vm-1
|
|
|
|
template: Linux Debian 7 64-bit
|
|
|
|
template: Linux Debian 7 64-bit
|
|
|
|
service_offering: Tiny
|
|
|
|
service_offering: Tiny
|
|
|
|
ssh_key: john@example.com
|
|
|
|
ssh_key: john@example.com
|
|
|
|
tags:
|
|
|
|
tags:
|
|
|
|
- { key: admin, value: john }
|
|
|
|
- key: admin
|
|
|
|
- { key: foo, value: bar }
|
|
|
|
value: john
|
|
|
|
|
|
|
|
- key: foo
|
|
|
|
|
|
|
|
value: bar
|
|
|
|
user_data: |
|
|
|
|
user_data: |
|
|
|
|
#cloud-config
|
|
|
|
#cloud-config
|
|
|
|
packages:
|
|
|
|
packages:
|
|
|
|
- nginx
|
|
|
|
- nginx
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
# Create an instance with multiple interfaces specifying the IP addresses
|
|
|
|
# Create an instance with multiple interfaces specifying the IP addresses
|
|
|
|
- local_action:
|
|
|
|
- cs_instance:
|
|
|
|
module: cs_instance
|
|
|
|
|
|
|
|
name: web-vm-1
|
|
|
|
name: web-vm-1
|
|
|
|
template: Linux Debian 7 64-bit
|
|
|
|
template: Linux Debian 7 64-bit
|
|
|
|
service_offering: Tiny
|
|
|
|
service_offering: Tiny
|
|
|
|
ip_to_networks:
|
|
|
|
ip_to_networks:
|
|
|
|
- {'network': NetworkA, 'ip': '10.1.1.1'}
|
|
|
|
- network: NetworkA
|
|
|
|
- {'network': NetworkB, 'ip': '192.168.1.1'}
|
|
|
|
ip: 10.1.1.1
|
|
|
|
|
|
|
|
- network: NetworkB
|
|
|
|
|
|
|
|
ip: 192.0.2.1
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
# Ensure an instance is stopped
|
|
|
|
# Ensure an instance is stopped
|
|
|
|
- local_action: cs_instance name=web-vm-1 state=stopped
|
|
|
|
- cs_instance:
|
|
|
|
|
|
|
|
name: web-vm-1
|
|
|
|
|
|
|
|
state: stopped
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
# Ensure an instance is running
|
|
|
|
# Ensure an instance is running
|
|
|
|
- local_action: cs_instance name=web-vm-1 state=started
|
|
|
|
- cs_instance:
|
|
|
|
|
|
|
|
name: web-vm-1
|
|
|
|
|
|
|
|
state: started
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
# Remove an instance
|
|
|
|
# Remove an instance
|
|
|
|
- local_action: cs_instance name=web-vm-1 state=absent
|
|
|
|
- cs_instance:
|
|
|
|
|
|
|
|
name: web-vm-1
|
|
|
|
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
delegate_to: localhost
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
RETURN = '''
|
|
|
|
RETURN = '''
|
|
|
|