mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add virt guest creation to virt module docs
This commit is contained in:
parent
2e57c40cc2
commit
c83bdc1a8d
1 changed files with 18 additions and 8 deletions
26
library/virt
26
library/virt
|
@ -55,18 +55,28 @@ options:
|
|||
- XML document used with the define command
|
||||
required: false
|
||||
default: null
|
||||
examples:
|
||||
- code: "virt: name=alpha state=running"
|
||||
description: "Example from Ansible Playbooks"
|
||||
- code: ansible host -m virt -a "name=alpha command=status"
|
||||
description: "Example guest management with C(/usr/bin/ansible)"
|
||||
- code: ansible host -m virt -a "name=alpha command=get_xml"
|
||||
description: "Use C(/usr/bin/ansible) to get the xml of the guest machine alpha"
|
||||
- code: ansible host -m virt -a "name=alpha command=create uri=lxc:///"
|
||||
requirements: [ "libvirt" ]
|
||||
author: Michael DeHaan, Seth Vidal
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# a playbook task line:
|
||||
tasks:
|
||||
- virt: name=alpha state=running
|
||||
|
||||
# /usr/bin/ansible invocations
|
||||
ansible host -m virt -a "name=alpha command=status"
|
||||
ansible host -m virt -a "name=alpha command=get_xml"
|
||||
ansible host -m virt -a "name=alpha command=create uri=lxc:///"
|
||||
|
||||
# a playbook example of defining and launching an LXC guest
|
||||
tasks:
|
||||
- name: define vm
|
||||
virt: name=foo command=define xml="{{ lookup('template', 'container-template.xml.j2') }}" uri=lxc:///
|
||||
- name: start vm
|
||||
virt: name=foo state=running uri=lxc:///
|
||||
'''
|
||||
|
||||
VIRT_FAILED = 1
|
||||
VIRT_SUCCESS = 0
|
||||
VIRT_UNAVAILABLE=2
|
||||
|
|
Loading…
Reference in a new issue