1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

add container name to return and document return

fixes #1848
This commit is contained in:
Brian Coca 2016-03-12 15:55:59 -05:00 committed by Matt Clay
parent 0798bfe2dc
commit bb355e6ccd

View file

@ -381,6 +381,48 @@ EXAMPLES = """
- test-container-new-archive-destroyed-clone - test-container-new-archive-destroyed-clone
""" """
RETURN="""
lxc_container:
description: container information
returned: success
type: list
contains:
name:
description: name of the lxc container
returned: success
type: string
sample: test_host
init_pid:
description: pid of the lxc init process
returned: success
type: int
sample: 19786
interfaces:
description: list of the container's network interfaces
returned: success
type: list
sample: [ "eth0", "lo" ]
ips:
description: list of ips
returned: success
type: list
sample: [ "10.0.3.3" ]
state:
description: resulting state of the container
returned: success
type: string
sample: "running"
archive:
description: resulting state of the container
returned: success, when archive is true
type: string
sample: "/tmp/test-container-config.tar",
clone:
description: if the container was cloned
returned: success, when clone_name is specified
type: boolean
sample: True
"""
try: try:
import lxc import lxc
@ -880,7 +922,8 @@ class LxcContainerManagement(object):
'interfaces': self.container.get_interfaces(), 'interfaces': self.container.get_interfaces(),
'ips': self.container.get_ips(), 'ips': self.container.get_ips(),
'state': self._get_state(), 'state': self._get_state(),
'init_pid': int(self.container.init_pid) 'init_pid': int(self.container.init_pid),
'name' : self.container_name,
} }
def _unfreeze(self): def _unfreeze(self):