mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
add example into os_server for server group (#51375)
* add example for server group
This commit is contained in:
parent
49afb3da34
commit
109ef8c79d
1 changed files with 14 additions and 0 deletions
|
@ -382,6 +382,20 @@ EXAMPLES = '''
|
||||||
ifdown eth0 && ifup eth0
|
ifdown eth0 && ifup eth0
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
|
# Create a new instance with server group for (anti-)affinity
|
||||||
|
# server group ID is returned from os_server_group module.
|
||||||
|
- name: launch a compute instance
|
||||||
|
hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: launch an instance
|
||||||
|
os_server:
|
||||||
|
state: present
|
||||||
|
name: vm1
|
||||||
|
image: 4f905f38-e52a-43d2-b6ec-754a13ffb529
|
||||||
|
flavor: 4
|
||||||
|
scheduler_hints:
|
||||||
|
group: f5c8c61a-9230-400a-8ed2-3b023c190a7f
|
||||||
|
|
||||||
# Deletes an instance via its ID
|
# Deletes an instance via its ID
|
||||||
- name: remove an instance
|
- name: remove an instance
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue