Skip to content

Commit

Permalink
[PR #9513/7c54c703 backport][stable-10] xyz*: style adjustments (#9525)
Browse files Browse the repository at this point in the history
xyz*: style adjustments (#9513)

(cherry picked from commit 7c54c70)

Co-authored-by: Alexei Znamensky <[email protected]>
  • Loading branch information
patchback[bot] and russoz authored Jan 4, 2025
1 parent 8208e52 commit e2604e7
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 163 deletions.
3 changes: 2 additions & 1 deletion plugins/modules/xattr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
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 C(setfattr)/C(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:
Expand Down
16 changes: 9 additions & 7 deletions plugins/modules/xbps.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@
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:
Expand All @@ -56,8 +57,9 @@
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 C(xbps) package when necessary. Before installing new packages, C(xbps) requires the
user to update itself. Thus when this option is set to V(false), upgrades and installations fail when C(xbps) is not
up to date.
type: bool
default: true
version_added: '0.2.0'
Expand All @@ -68,8 +70,8 @@
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 remote repositories
or paths for local repositories.
type: list
elements: str
version_added: '10.2.0'
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/xcc_redfish_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
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 using GET method.
- Supports updating a configuration attribute using PATCH method.
Expand Down Expand Up @@ -110,7 +110,7 @@
resource_uri:
required: false
description:
- The resource uri to get or patch or post.
- The resource URI to get or patch or post.
type: str
request_body:
required: false
Expand Down
97 changes: 52 additions & 45 deletions plugins/modules/xenserver_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,35 @@
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.
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) <[email protected]>
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 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 parameters O(networks[].type), O(networks[].ip), O(networks[].gateway) and so on, 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 using 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).'
- '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
- '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 parameters O(networks[].type), O(networks[].ip), O(networks[].gateway)
and so on, is supported on XenServer 7.0 or newer for Windows guests by using official XenServer Guest agent support for
network configuration. The module tries to detect if such support is available and utilize it, else it uses a custom method
of configuration using 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://web.archive.org/web/20180218110151/https://xenserver.org/blog/entry/set-windows-guest-vm-static-ip-address-in-xenserver.html).'
- 'On platforms without official support for network configuration inside a guest OS, network parameters are 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 reads 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 requires 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
Expand All @@ -55,14 +56,16 @@
- If O(state) is set to V(present) and VM exists, ensure the VM configuration conforms to given parameters.
- If O(state) is set to V(present) and VM does not exist, then VM is deployed with given parameters.
- If O(state) is set to V(absent) and VM exists, then VM is removed with its associated components.
- If O(state) is set to V(poweredon) and VM does not exist, then VM is deployed with given parameters and powered on automatically.
- If O(state) is set to V(poweredon) and VM does not exist, then VM is deployed with given parameters and powered on
automatically.
type: str
default: present
choices: [present, absent, poweredon]
name:
description:
- Name of the VM to work with.
- VMs running on XenServer do not necessarily have unique names. The module will fail if multiple VMs with same name are found.
- VMs running on XenServer do not necessarily have unique names. The module fails if multiple VMs with same name are
found.
- In case of multiple VMs with same name, use O(uuid) to uniquely specify VM to manage.
- This parameter is case sensitive.
type: str
Expand All @@ -75,15 +78,15 @@
description:
- UUID of the VM to manage if known. This is XenServer's unique identifier.
- It is required if name is not unique.
- Please note that a supplied UUID will be ignored on VM creation, as XenServer creates the UUID internally.
- Please note that a supplied UUID is ignored on VM creation, as XenServer creates the UUID internally.
type: str
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 fails 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.
- If VM already exists, this setting is ignored.
- This parameter is case sensitive.
type: str
aliases: [template_src]
Expand All @@ -101,8 +104,7 @@
description:
- Destination folder for VM.
- This parameter is case sensitive.
- 'Example:'
- ' folder: /folder1/folder2'
- 'Example: O(folder=/folder1/folder2).'
type: str
hardware:
description:
Expand All @@ -126,15 +128,17 @@
- A list of disks to add to VM.
- All parameters are case sensitive.
- Removing or detaching existing disks of VM is not supported.
- New disks are required to have either a O(disks[].size) or one of O(ignore:disks[].size_[tb,gb,mb,kb,b]) parameters specified.
- New disks are required to have either a O(disks[].size) or one of O(ignore:disks[].size_[tb,gb,mb,kb,b]) parameters
specified.
- VM needs to be shut down to reconfigure disk size.
type: list
elements: dict
aliases: [disk]
suboptions:
size:
description:
- 'Disk size with unit. Unit must be: V(b), V(kb), V(mb), V(gb), V(tb). VM needs to be shut down to reconfigure this parameter.'
- 'Disk size with unit. Unit must be: V(b), V(kb), V(mb), V(gb), V(tb). VM needs to be shut down to reconfigure
this parameter.'
- If no unit is specified, size is assumed to be in bytes.
type: str
size_b:
Expand Down Expand Up @@ -168,7 +172,8 @@
type: str
sr:
description:
- Storage Repository to create disk on. If not specified, will use default SR. Cannot be used for moving disk to other SR.
- Storage Repository to create disk on. If not specified, it uses default SR. Cannot be used for moving disk to
other SR.
type: str
sr_uuid:
description:
Expand All @@ -182,12 +187,12 @@
suboptions:
type:
description:
- The type of CD-ROM. With V(none) the CD-ROM device will be present but empty.
- The type of CD-ROM. When V(none) the CD-ROM device is present but empty.
type: str
choices: [none, iso]
iso_name:
description:
- 'The file name of an ISO image from one of the XenServer ISO Libraries (implies O(cdrom.type=iso)).'
- The file name of an ISO image from one of the XenServer ISO Libraries (implies O(cdrom.type=iso)).
- Required if O(cdrom.type) is set to V(iso).
type: str
networks:
Expand All @@ -211,13 +216,14 @@
type:
description:
- Type of IPv4 assignment. Value V(none) means whatever is default for OS.
- On some operating systems it could be DHCP configured (for example Windows) or unconfigured interface (for example Linux).
- On some operating systems it could be DHCP configured (for example Windows) or unconfigured interface (for example
Linux).
type: str
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:
Expand All @@ -234,15 +240,15 @@
choices: [none, dhcp, static]
ip6:
description:
- 'Static IPv6 address (implies O(networks[].type6=static)) with prefix in format C(<IPv6 address>/<prefix>).'
- Static IPv6 address (implies O(networks[].type6=static)) with prefix in format C(<IPv6 address>/<prefix>).
type: str
gateway6:
description:
- Static IPv6 gateway.
type: str
home_server:
description:
- Name of a XenServer host that will be a Home Server for the VM.
- Name of a XenServer host that is a Home Server for the VM.
- This parameter is case sensitive.
type: str
custom_params:
Expand Down Expand Up @@ -271,14 +277,15 @@
default: false
state_change_timeout:
description:
- 'By default, module will wait indefinitely for VM to acquire an IP address if O(wait_for_ip_address=true).'
- If this parameter is set to positive value, the module will instead wait specified number of seconds for the state change.
- In case of timeout, module will generate an error message.
- By default, the module waits indefinitely for VM to acquire an IP address if O(wait_for_ip_address=true).
- If this parameter is set to a positive value, the module instead waits the specified number of seconds for the state
change.
- In case of timeout, module generates an error message.
type: int
default: 0
linked_clone:
description:
- Whether to create a Linked Clone from the template, existing VM or snapshot. If no, will create a full copy.
- Whether to create a Linked Clone from the template, existing VM or snapshot. If V(false), it creates a full copy.
- This is equivalent to C(Use storage-level fast disk clone) option in XenCenter.
type: bool
default: false
Expand Down
19 changes: 10 additions & 9 deletions plugins/modules/xenserver_guest_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@
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 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 O(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
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:
name:
description:
- Name of the VM to gather facts from.
- VMs running on XenServer do not necessarily have unique names. The module will fail if multiple VMs with same name are found.
- VMs running on XenServer do not necessarily have unique names. The module fails if multiple VMs with same name are
found.
- In case of multiple VMs with same name, use O(uuid) to uniquely specify VM to manage.
- This parameter is case sensitive.
type: str
Expand Down
Loading

0 comments on commit e2604e7

Please sign in to comment.