x*: adjust docs (#9308)

* adjust docs

* Update plugins/modules/xml.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix capitalisation

* add markup to references of the xe command (xenserver)

* add missing markup

* Update plugins/modules/xml.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/9344/head
Alexei Znamensky 2024-12-24 06:58:02 +13:00 committed by GitHub
parent 005c8f50db
commit f9bfe4e4a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 827 additions and 863 deletions

View File

@ -8,14 +8,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: xattr
short_description: Manage user defined extended attributes
description:
- Manages filesystem user defined extended attributes.
- Requires that extended attributes are enabled on the target filesystem
and that the setfattr/getfattr utilities are present.
- Requires that extended attributes are enabled on the target filesystem and that the C(setfattr)/C(getfattr) utilities are present.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -45,26 +43,25 @@ options:
type: str
state:
description:
- defines which state you want to do.
V(read) retrieves the current value for a O(key) (default)
V(present) sets O(path) to O(value), default if value is set
V(all) dumps all data
V(keys) retrieves all keys
V(absent) deletes the key
- Defines which state you want to do.
- V(read) retrieves the current value for a O(key).
- V(present) sets O(path) to O(value), default if value is set.
- V(all) dumps all data.
- V(keys) retrieves all keys.
- V(absent) deletes the key.
type: str
choices: [absent, all, keys, present, read]
default: read
follow:
description:
- If V(true), dereferences symlinks and sets/gets attributes on symlink target,
otherwise acts on symlink itself.
- If V(true), dereferences symlinks and sets/gets attributes on symlink target, otherwise acts on symlink itself.
type: bool
default: true
author:
- Brian Coca (@bcoca)
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Obtain the extended attributes of /etc/foo.conf
community.general.xattr:
path: /etc/foo.conf
@ -94,7 +91,7 @@ EXAMPLES = '''
namespace: trusted
key: glusterfs.volume-id
state: absent
'''
"""
import os

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: xbps
short_description: Manage packages with XBPS
description:
@ -41,29 +40,24 @@ options:
type: str
recurse:
description:
- When removing a package, also remove its dependencies, provided
that they are not required by other packages and were not
explicitly installed by a user.
- When removing a package, also remove its dependencies, provided that they are not required by other packages and were not explicitly installed
by a user.
type: bool
default: false
update_cache:
description:
- Whether or not to refresh the master package lists. This can be
run as part of a package installation or as a separate step.
- Whether or not to refresh the master package lists. This can be run as part of a package installation or as a separate step.
type: bool
default: true
upgrade:
description:
- Whether or not to upgrade whole system
- Whether or not to upgrade whole system.
type: bool
default: false
upgrade_xbps:
description:
- Whether or not to upgrade the xbps package when necessary.
Before installing new packages,
xbps requires the user to update the xbps package itself.
Thus when this option is set to V(false),
upgrades and installations will fail when xbps is not up to date.
- Whether or not to upgrade the xbps package when necessary. Before installing new packages, xbps requires the user to update the xbps package
itself. Thus when this option is set to V(false), upgrades and installations will fail when xbps is not up to date.
type: bool
default: true
version_added: '0.2.0'
@ -74,10 +68,8 @@ options:
version_added: '10.2.0'
repositories:
description:
- Repository URL(s) to prepend to the repository list for the
package installation.
The URL can be a URL to a repository for
remote repositories or a path for local repositories.
- Repository URL(s) to prepend to the repository list for the package installation. The URL can be a URL to a repository for remote repositories
or a path for local repositories.
type: list
elements: str
version_added: '10.2.0'
@ -87,9 +79,9 @@ options:
type: bool
default: false
version_added: '10.2.0'
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Install package foo (automatically updating the xbps package if needed)
community.general.xbps:
name: foo
@ -151,20 +143,20 @@ EXAMPLES = '''
state: present
repositories: https://repo-default.voidlinux.org/current
root: /mnt
'''
"""
RETURN = '''
RETURN = r"""
msg:
description: Message about results
description: Message about results.
returned: success
type: str
sample: "System Upgraded"
packages:
description: Packages that are affected/would be affected
description: Packages that are affected/would be affected.
type: list
sample: ["ansible"]
returned: success
'''
"""
import os

View File

@ -8,14 +8,13 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: xcc_redfish_command
short_description: Manages Lenovo Out-Of-Band controllers using Redfish APIs
version_added: 2.4.0
description:
- Builds Redfish URIs locally and sends them to remote OOB controllers to
perform an action or get information back or update a configuration attribute.
- Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action or get information back or update a configuration
attribute.
- Manages virtual media.
- Supports getting information back via GET method.
- Supports updating a configuration attribute via PATCH method.
@ -54,7 +53,7 @@ options:
type: str
auth_token:
description:
- Security token for authentication with OOB controller
- Security token for authentication with OOB controller.
type: str
timeout:
description:
@ -120,9 +119,9 @@ options:
type: dict
author: "Yuyan Pan (@panyy3)"
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Insert Virtual Media
community.general.xcc_redfish_command:
category: Manager
@ -255,9 +254,9 @@ EXAMPLES = '''
baseuri: "{{ baseuri }}"
auth_token: "{{ result.session.token }}"
session_uri: "{{ result.session.uri }}"
'''
"""
RETURN = '''
RETURN = r"""
msg:
description: A message related to the performed action(s).
returned: when failure or action/update success
@ -294,7 +293,7 @@ redfish_facts:
"ret": true
}
}'
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: xenserver_facts
short_description: Get facts reported on xenserver
description:
- Reads data out of XenAPI, can be used instead of multiple xe commands.
- Reads data out of XenAPI, can be used instead of multiple C(xe) commands.
author:
- Andy Hill (@andyhky)
- Tim Rupp (@caphrim007)
@ -28,9 +27,9 @@ attributes:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options: {}
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Gather facts from xenserver
community.general.xenserver_facts:
@ -48,7 +47,7 @@ EXAMPLES = '''
# "item": "Control domain on host: 10.0.13.22",
# "msg": "Control domain on host: 10.0.13.22"
# }
'''
"""
HAVE_XENAPI = False

View File

@ -8,41 +8,39 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: xenserver_guest
short_description: Manages virtual machines running on Citrix Hypervisor/XenServer host or pool
description: >
This module can be used to create new virtual machines from templates or other virtual machines,
modify various virtual machine components like network and disk, rename a virtual machine and
remove a virtual machine with associated components.
description: >-
This module can be used to create new virtual machines from templates or other virtual machines, modify various virtual machine components like
network and disk, rename a virtual machine and remove a virtual machine with associated components.
author:
- Bojan Vitnik (@bvitnik) <bvitnik@mainstream.rs>
notes:
- Minimal supported version of XenServer is 5.6.
- Module was tested with XenServer 6.5, 7.1, 7.2, 7.6, Citrix Hypervisor 8.0, XCP-ng 7.6 and 8.0.
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside
Citrix Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the XenAPI.py file from the SDK to your Python site-packages on your
Ansible Control Node to use it. Latest version of the library can also be acquired from GitHub:
U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py)'
- 'If no scheme is specified in O(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you are
accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside Citrix
Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the C(XenAPI.py) file from the SDK to your Python site-packages on your Ansible
Control Node to use it. Latest version of the library can also be acquired from GitHub:
U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py).'
- 'If no scheme is specified in O(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you
are accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To use C(https://) scheme for O(hostname) you have to either import host certificate to your OS certificate store or use O(validate_certs=false)
which requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.'
- 'Network configuration inside a guest OS, by using O(networks[].type), O(networks[].ip), O(networks[].gateway) etc. parameters, is supported on
XenServer 7.0 or newer for Windows guests by using official XenServer Guest agent support for network configuration. The module will try to
detect if such support is available and utilize it, else it will use a custom method of configuration via xenstore. Since XenServer Guest
- 'Network configuration inside a guest OS, by using O(networks[].type), O(networks[].ip), O(networks[].gateway) etc. parameters, is supported
on XenServer 7.0 or newer for Windows guests by using official XenServer Guest agent support for network configuration. The module will try
to detect if such support is available and utilize it, else it will use a custom method of configuration via xenstore. Since XenServer Guest
agent only support None and Static types of network configuration, where None means DHCP configured interface, O(networks[].type) and O(networks[].type6)
values V(none) and V(dhcp) have same effect. More info here:
U(https://www.citrix.com/community/citrix-developer/citrix-hypervisor-developer/citrix-hypervisor-developing-products/citrix-hypervisor-staticip.html)'
U(https://www.citrix.com/community/citrix-developer/citrix-hypervisor-developer/citrix-hypervisor-developing-products/citrix-hypervisor-staticip.html).'
- 'On platforms without official support for network configuration inside a guest OS, network parameters will be written to xenstore
C(vm-data/networks/<vif_device>) key. Parameters can be inspected by using C(xenstore ls) and C(xenstore read) tools on \*nix guests or through
WMI interface on Windows guests. They can also be found in VM facts C(instance.xenstore_data) key as returned by the module. It is up to the user
to implement a boot time scripts or custom agent that will read the parameters from xenstore and configure network with given parameters.
Take note that for xenstore data to become available inside a guest, a VM restart is needed hence module will require VM restart if any
parameter is changed. This is a limitation of XenAPI and xenstore. Considering these limitations, network configuration through xenstore is most
useful for bootstrapping newly deployed VMs, much less for reconfiguring existing ones. More info here:
U(https://support.citrix.com/article/CTX226713)'
C(vm-data/networks/<vif_device>) key. Parameters can be inspected by using C(xenstore ls) and C(xenstore read) tools on \*nix guests or through WMI
interface on Windows guests.
They can also be found in VM facts C(instance.xenstore_data) key as returned by the module. It is up to the user to implement a boot time
scripts or custom agent that will read the parameters from xenstore and configure network with given parameters. Take note that for xenstore
data to become available inside a guest, a VM restart is needed hence module will require VM restart if any parameter is changed. This is
a limitation of XenAPI and xenstore. Considering these limitations, network configuration through xenstore is most useful for bootstrapping
newly deployed VMs, much less for reconfiguring existing ones. More info here: U(https://support.citrix.com/article/CTX226713).'
requirements:
- XenAPI
attributes:
@ -82,7 +80,8 @@ options:
template:
description:
- Name of a template, an existing VM (must be shut down) or a snapshot that should be used to create VM.
- Templates/VMs/snapshots on XenServer do not necessarily have unique names. The module will fail if multiple templates with same name are found.
- Templates/VMs/snapshots on XenServer do not necessarily have unique names. The module will fail if multiple templates with same name are
found.
- In case of multiple templates/VMs/snapshots with same name, use O(template_uuid) to uniquely specify source template.
- If VM already exists, this setting will be ignored.
- This parameter is case sensitive.
@ -217,7 +216,8 @@ options:
choices: [none, dhcp, static]
ip:
description:
- 'Static IPv4 address (implies O(networks[].type=static)). Can include prefix in format C(<IPv4 address>/<prefix>) instead of using C(netmask).'
- Static IPv4 address (implies O(networks[].type=static)). Can include prefix in format C(<IPv4 address>/<prefix>) instead of using
C(netmask).
type: str
netmask:
description:
@ -248,7 +248,7 @@ options:
custom_params:
description:
- Define a list of custom VM params to set on VM.
- Useful for advanced users familiar with managing VM params through xe CLI.
- Useful for advanced users familiar with managing VM params through C(xe) CLI.
- A custom value object takes two fields O(custom_params[].key) and O(custom_params[].value) (see example below).
type: list
elements: dict
@ -291,10 +291,9 @@ options:
extends_documentation_fragment:
- community.general.xenserver.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Create a VM from a template
community.general.xenserver_guest:
hostname: "{{ xenserver_hostname }}"
@ -381,11 +380,11 @@ EXAMPLES = r'''
gateway: 192.168.1.1
- type: dhcp
delegate_to: localhost
'''
"""
RETURN = r'''
RETURN = r"""
instance:
description: Metadata about the VM
description: Metadata about the VM.
returned: always
type: dict
sample: {
@ -471,7 +470,7 @@ instance:
}
}
changes:
description: Detected or made changes to VM
description: Detected or made changes to VM.
returned: always
type: list
sample: [
@ -523,7 +522,7 @@ changes:
},
"need_poweredoff"
]
'''
"""
import re

View File

@ -8,25 +8,23 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: xenserver_guest_info
short_description: Gathers information for virtual machines running on Citrix Hypervisor/XenServer host or pool
description: >
This module can be used to gather essential VM facts.
description: This module can be used to gather essential VM facts.
author:
- Bojan Vitnik (@bvitnik) <bvitnik@mainstream.rs>
notes:
- Minimal supported version of XenServer is 5.6.
- Module was tested with XenServer 6.5, 7.1, 7.2, 7.6, Citrix Hypervisor 8.0, XCP-ng 7.6 and 8.0.
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside
Citrix Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the XenAPI.py file from the SDK to your Python site-packages on your
Ansible Control Node to use it. Latest version of the library can also be acquired from GitHub:
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside Citrix
Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the C(XenAPI.py) file from the SDK to your Python site-packages on your Ansible
Control Node to use it. Latest version of the library can also be acquired from GitHub:
U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py)'
- 'If no scheme is specified in C(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you are
accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To use C(https://) scheme for C(hostname) you have to either import host certificate to your OS certificate store or use C(validate_certs: no)
which requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.'
- 'If no scheme is specified in C(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you
are accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To use C(https://) scheme for C(hostname) you have to either import host certificate to your OS certificate store or use O(validate_certs=no) which
requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.'
requirements:
- XenAPI
options:
@ -47,9 +45,9 @@ extends_documentation_fragment:
- community.general.xenserver.documentation
- community.general.attributes
- community.general.attributes.info_module
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Gather facts
community.general.xenserver_guest_info:
hostname: "{{ xenserver_hostname }}"
@ -58,11 +56,11 @@ EXAMPLES = r'''
name: testvm_11
delegate_to: localhost
register: facts
'''
"""
RETURN = r'''
RETURN = r"""
instance:
description: Metadata about the VM
description: Metadata about the VM.
returned: always
type: dict
sample: {
@ -147,7 +145,7 @@ instance:
"vm-data": ""
}
}
'''
"""
from ansible.module_utils.basic import AnsibleModule

View File

@ -8,25 +8,23 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: xenserver_guest_powerstate
short_description: Manages power states of virtual machines running on Citrix Hypervisor/XenServer host or pool
description: >
This module can be used to power on, power off, restart or suspend virtual machine and gracefully reboot or shutdown guest OS of virtual machine.
description: This module can be used to power on, power off, restart or suspend virtual machine and gracefully reboot or shutdown guest OS of virtual machine.
author:
- Bojan Vitnik (@bvitnik) <bvitnik@mainstream.rs>
notes:
- Minimal supported version of XenServer is 5.6.
- Module was tested with XenServer 6.5, 7.1, 7.2, 7.6, Citrix Hypervisor 8.0, XCP-ng 7.6 and 8.0.
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside
Citrix Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the XenAPI.py file from the SDK to your Python site-packages on your
Ansible Control Node to use it. Latest version of the library can also be acquired from GitHub:
U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py)'
- 'If no scheme is specified in C(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you are
accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To use C(https://) scheme for C(hostname) you have to either import host certificate to your OS certificate store or use C(validate_certs: no)
which requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.'
- 'To acquire XenAPI Python library, just run C(pip install XenAPI) on your Ansible Control Node. The library can also be found inside Citrix
Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the C(XenAPI.py) file from the SDK to your Python site-packages on your Ansible
Control Node to use it. Latest version of the library can also be acquired from GitHub:
U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py).'
- 'If no scheme is specified in C(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you
are accessing XenServer host in trusted environment or use C(https://) scheme explicitly.'
- 'To use C(https://) scheme for C(hostname) you have to either import host certificate to your OS certificate store or use C(validate_certs:
no) which requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.'
requirements:
- XenAPI
attributes:
@ -72,10 +70,9 @@ options:
extends_documentation_fragment:
- community.general.xenserver.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Power on VM
community.general.xenserver_guest_powerstate:
hostname: "{{ xenserver_hostname }}"
@ -85,11 +82,11 @@ EXAMPLES = r'''
state: powered-on
delegate_to: localhost
register: facts
'''
"""
RETURN = r'''
RETURN = r"""
instance:
description: Metadata about the VM
description: Metadata about the VM.
returned: always
type: dict
sample: {
@ -174,7 +171,7 @@ instance:
"vm-data": ""
}
}
'''
"""
from ansible.module_utils.basic import AnsibleModule

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
DOCUMENTATION = r"""
module: xfconf
author:
- "Joseph Benden (@jbenden)"
@ -56,10 +55,10 @@ options:
description:
- The type of value being set.
- When providing more than one O(value_type), the length of the list must be equal to the length of O(value).
- If only one O(value_type) is provided, but O(value) contains more than on element, that O(value_type) will be applied to all elements of
O(value).
- If the O(property) being set is an array and it can possibly have only one element in the array, then O(force_array=true) must be used to
ensure that C(xfconf-query) will interpret the value as an array rather than a scalar.
- If only one O(value_type) is provided, but O(value) contains more than on element, that O(value_type) will be applied to all elements
of O(value).
- If the O(property) being set is an array and it can possibly have only one element in the array, then O(force_array=true) must be used
to ensure that C(xfconf-query) will interpret the value as an array rather than a scalar.
- Support for V(uchar), V(char), V(uint64), and V(int64) has been added in community.general 4.8.0.
type: list
elements: str
@ -80,8 +79,7 @@ options:
version_added: 1.0.0
"""
EXAMPLES = """
---
EXAMPLES = r"""
- name: Change the DPI to "192"
xfconf:
channel: "xsettings"
@ -105,15 +103,14 @@ EXAMPLES = """
force_array: true
"""
RETURN = """
---
RETURN = r"""
channel:
description: The channel specified in the module parameters
description: The channel specified in the module parameters.
returned: success
type: str
sample: "xsettings"
property:
description: The property specified in the module parameters
description: The property specified in the module parameters.
returned: success
type: str
sample: "/Xft/DPI"
@ -130,7 +127,7 @@ value:
- This is a string or a list of strings.
returned: success
type: any
sample: '"192" or ["orange", "yellow", "violet"]'
sample: "'192' or ['orange', 'yellow', 'violet']"
previous_value:
description:
- The value of the preference key before executing the module. Either a single string value or a list of strings for array types.

View File

@ -7,8 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
DOCUMENTATION = r"""
module: xfconf_info
author:
- "Alexei Znamensky (@russoz)"
@ -26,17 +25,13 @@ attributes:
options:
channel:
description:
- >
A Xfconf preference channel is a top-level tree key, inside of the
Xfconf repository that corresponds to the location for which all
application properties/keys are stored.
- "A Xfconf preference channel is a top-level tree key, inside of the Xfconf repository that corresponds to the location for which all application
properties/keys are stored."
- If not provided, the module will list all available channels.
type: str
property:
description:
- >
A Xfce preference key is an element in the Xfconf repository
that corresponds to an application preference.
- "A Xfce preference key is an element in the Xfconf repository that corresponds to an application preference."
- If provided, then O(channel) is required.
- If not provided and a O(channel) is provided, then the module will list all available properties in that O(channel).
type: str
@ -44,8 +39,7 @@ notes:
- See man xfconf-query(1) for more details.
"""
EXAMPLES = """
---
EXAMPLES = r"""
- name: Get list of all available channels
community.general.xfconf_info: {}
register: result
@ -68,8 +62,7 @@ EXAMPLES = """
register: result
"""
RETURN = """
---
RETURN = r"""
channels:
description:
- List of available channels.

View File

@ -12,7 +12,6 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
---
module: xfs_quota
short_description: Manage quotas on XFS filesystems
description:
@ -109,37 +108,36 @@ EXAMPLES = r"""
mountpoint: /home
isoft: 1024
ihard: 2048
"""
RETURN = r"""
bhard:
description: the current bhard setting in bytes
description: The current C(bhard) setting in bytes.
returned: always
type: int
sample: 1024
bsoft:
description: the current bsoft setting in bytes
description: The current C(bsoft) setting in bytes.
returned: always
type: int
sample: 1024
ihard:
description: the current ihard setting in bytes
description: The current C(ihard) setting in bytes.
returned: always
type: int
sample: 100
isoft:
description: the current isoft setting in bytes
description: The current C(isoft) setting in bytes.
returned: always
type: int
sample: 100
rtbhard:
description: the current rtbhard setting in bytes
description: The current C(rtbhard) setting in bytes.
returned: always
type: int
sample: 1024
rtbsoft:
description: the current rtbsoft setting in bytes
description: The current C(rtbsoft) setting in bytes.
returned: always
type: int
sample: 1024

View File

@ -11,8 +11,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: xml
short_description: Manage bits and pieces of XML files or strings
description:
@ -70,9 +69,8 @@ options:
add_children:
description:
- Add additional child-element(s) to a selected element for a given O(xpath).
- Child elements must be given in a list and each item may be either a string
(for example C(children=ansible) to add an empty C(<ansible/>) child element),
or a hash where the key is an element name and the value is the element value.
- Child elements must be given in a list and each item may be either a string (for example C(children=ansible) to add an empty C(<ansible/>)
child element), or a hash where the key is an element name and the value is the element value.
- This parameter requires O(xpath) to be set.
type: list
elements: raw
@ -115,8 +113,7 @@ options:
default: yaml
backup:
description:
- Create a backup file including the timestamp information so you can get
the original file back if you somehow clobbered it incorrectly.
- Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
type: bool
default: false
strip_cdata_tags:
@ -128,18 +125,16 @@ options:
insertbefore:
description:
- Add additional child-element(s) before the first selected element for a given O(xpath).
- Child elements must be given in a list and each item may be either a string
(for example C(children=ansible) to add an empty C(<ansible/>) child element),
or a hash where the key is an element name and the value is the element value.
- Child elements must be given in a list and each item may be either a string (for example C(children=ansible) to add an empty C(<ansible/>)
child element), or a hash where the key is an element name and the value is the element value.
- This parameter requires O(xpath) to be set.
type: bool
default: false
insertafter:
description:
- Add additional child-element(s) after the last selected element for a given O(xpath).
- Child elements must be given in a list and each item may be either a string
(for example C(children=ansible) to add an empty C(<ansible/>) child element),
or a hash where the key is an element name and the value is the element value.
- Child elements must be given in a list and each item may be either a string (for example C(children=ansible) to add an empty C(<ansible/>)
child element), or a hash where the key is an element name and the value is the element value.
- This parameter requires O(xpath) to be set.
type: bool
default: false
@ -152,7 +147,7 @@ notes:
- Beware that in case your XML elements are namespaced, you need to use the O(namespaces) parameter, see the examples.
- Namespaces prefix should be used for all children of an element where namespace is defined, unless another namespace is defined for them.
seealso:
- name: Xml module development community wiki
- name: XML module development community wiki (archived)
description: More information related to the development of this xml module.
link: https://github.com/ansible/community/wiki/Module:-xml
- name: Introduction to XPath
@ -165,9 +160,9 @@ author:
- Tim Bielawa (@tbielawa)
- Magnus Hedemark (@magnus919)
- Dag Wieers (@dagwieers)
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
# Consider the following XML file:
#
# <business type="bar">
@ -327,28 +322,28 @@ EXAMPLES = r'''
path: bar.xml
xpath: /config/element[@name='test1']
state: absent
'''
"""
RETURN = r'''
RETURN = r"""
actions:
description: A dictionary with the original xpath, namespaces and state.
type: dict
returned: success
sample: {xpath: xpath, namespaces: [namespace1, namespace2], state=present}
sample: {xpath: xpath, namespaces: [namespace1, namespace2], state: present}
backup_file:
description: The name of the backup file that was created
description: The name of the backup file that was created.
type: str
returned: when O(backup=true)
sample: /path/to/file.xml.1942.2017-08-24@14:16:01~
count:
description: The count of xpath matches.
type: int
returned: when parameter 'count' is set
returned: when parameter O(count) is set
sample: 2
matches:
description: The xpath matches found.
type: list
returned: when parameter 'print_match' is set
returned: when parameter O(print_match) is set
msg:
description: A message related to the performed action(s).
type: str
@ -356,8 +351,8 @@ msg:
xmlstring:
description: An XML string of the resulting output.
type: str
returned: when parameter 'xmlstring' is set
'''
returned: when parameter O(xmlstring) is set
"""
import copy
import json