[prox ... pyth]*: normalize docs (#9364)
* [prox ... pyth]*: normalize docs * Apply suggestions from code review Co-authored-by: IamLunchbox <56757745+IamLunchbox@users.noreply.github.com> * Update plugins/modules/pushbullet.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/pushbullet.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: IamLunchbox <56757745+IamLunchbox@users.noreply.github.com> Co-authored-by: Felix Fontein <felix@fontein.de>pull/9101/merge
parent
9fc3092bb3
commit
6b7ea3443d
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox
|
module: proxmox
|
||||||
short_description: Management of instances in Proxmox VE cluster
|
short_description: Management of instances in Proxmox VE cluster
|
||||||
description:
|
description:
|
||||||
|
@ -26,28 +25,26 @@ attributes:
|
||||||
options:
|
options:
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- the instance root password
|
- The instance root password.
|
||||||
type: str
|
type: str
|
||||||
hostname:
|
hostname:
|
||||||
description:
|
description:
|
||||||
- the instance hostname
|
- The instance hostname.
|
||||||
- required only for O(state=present)
|
- Required only for O(state=present).
|
||||||
- must be unique if vmid is not passed
|
- Must be unique if vmid is not passed.
|
||||||
type: str
|
type: str
|
||||||
ostemplate:
|
ostemplate:
|
||||||
description:
|
description:
|
||||||
- the template for VM creating
|
- The template for VM creating.
|
||||||
- required only for O(state=present)
|
- Required only for O(state=present).
|
||||||
type: str
|
type: str
|
||||||
disk:
|
disk:
|
||||||
description:
|
description:
|
||||||
- This option was previously described as "hard disk size in GB for instance" however several formats describing
|
- This option was previously described as "hard disk size in GB for instance" however several formats describing a lxc mount are permitted.
|
||||||
a lxc mount are permitted.
|
- Older versions of Proxmox will accept a numeric value for size using the O(storage) parameter to automatically choose which storage to
|
||||||
- Older versions of Proxmox will accept a numeric value for size using the O(storage) parameter to automatically
|
allocate from, however new versions enforce the C(<STORAGE>:<SIZE>) syntax.
|
||||||
choose which storage to allocate from, however new versions enforce the C(<STORAGE>:<SIZE>) syntax.
|
- Additional options are available by using some combination of the following key-value pairs as a comma-delimited list C([volume=]<volume>
|
||||||
- "Additional options are available by using some combination of the following key-value pairs as a
|
[,acl=<1|0>] [,mountoptions=<opt[;opt...]>] [,quota=<1|0>] [,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>]).
|
||||||
comma-delimited list C([volume=]<volume> [,acl=<1|0>] [,mountoptions=<opt[;opt...]>] [,quota=<1|0>]
|
|
||||||
[,replicate=<1|0>] [,ro=<1|0>] [,shared=<1|0>] [,size=<DiskSize>])."
|
|
||||||
- See U(https://pve.proxmox.com/wiki/Linux_Container) for a full description.
|
- See U(https://pve.proxmox.com/wiki/Linux_Container) for a full description.
|
||||||
- This option is mutually exclusive with O(storage) and O(disk_volume).
|
- This option is mutually exclusive with O(storage) and O(disk_volume).
|
||||||
type: str
|
type: str
|
||||||
|
@ -93,19 +90,19 @@ options:
|
||||||
type: int
|
type: int
|
||||||
cpus:
|
cpus:
|
||||||
description:
|
description:
|
||||||
- numbers of allocated cpus for instance
|
- Number of allocated cpus for instance.
|
||||||
type: int
|
type: int
|
||||||
memory:
|
memory:
|
||||||
description:
|
description:
|
||||||
- memory size in MB for instance
|
- Memory size in MB for instance.
|
||||||
type: int
|
type: int
|
||||||
swap:
|
swap:
|
||||||
description:
|
description:
|
||||||
- swap memory size in MB for instance
|
- Swap memory size in MB for instance.
|
||||||
type: int
|
type: int
|
||||||
netif:
|
netif:
|
||||||
description:
|
description:
|
||||||
- specifies network interfaces for the container. As a hash/dictionary defining interfaces.
|
- Specifies network interfaces for the container. As a hash/dictionary defining interfaces.
|
||||||
type: dict
|
type: dict
|
||||||
features:
|
features:
|
||||||
description:
|
description:
|
||||||
|
@ -177,11 +174,11 @@ options:
|
||||||
type: dict
|
type: dict
|
||||||
ip_address:
|
ip_address:
|
||||||
description:
|
description:
|
||||||
- specifies the address the container will be assigned
|
- Specifies the address the container will be assigned.
|
||||||
type: str
|
type: str
|
||||||
onboot:
|
onboot:
|
||||||
description:
|
description:
|
||||||
- specifies whether a VM will be started during system bootup
|
- Specifies whether a VM will be started during system bootup.
|
||||||
type: bool
|
type: bool
|
||||||
storage:
|
storage:
|
||||||
description:
|
description:
|
||||||
|
@ -199,15 +196,15 @@ options:
|
||||||
version_added: 8.1.0
|
version_added: 8.1.0
|
||||||
cpuunits:
|
cpuunits:
|
||||||
description:
|
description:
|
||||||
- CPU weight for a VM
|
- CPU weight for a VM.
|
||||||
type: int
|
type: int
|
||||||
nameserver:
|
nameserver:
|
||||||
description:
|
description:
|
||||||
- sets DNS server IP address for a container
|
- Sets DNS server IP address for a container.
|
||||||
type: str
|
type: str
|
||||||
searchdomain:
|
searchdomain:
|
||||||
description:
|
description:
|
||||||
- sets DNS search domain for a container
|
- Sets DNS search domain for a container.
|
||||||
type: str
|
type: str
|
||||||
tags:
|
tags:
|
||||||
description:
|
description:
|
||||||
|
@ -219,7 +216,7 @@ options:
|
||||||
version_added: 6.2.0
|
version_added: 6.2.0
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- timeout for operations
|
- Timeout for operations.
|
||||||
type: int
|
type: int
|
||||||
default: 30
|
default: 30
|
||||||
update:
|
update:
|
||||||
|
@ -232,8 +229,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- Forcing operations.
|
- Forcing operations.
|
||||||
- Can be used only with states V(present), V(stopped), V(restarted).
|
- Can be used only with states V(present), V(stopped), V(restarted).
|
||||||
- with O(state=present) force option allow to overwrite existing container.
|
- With O(state=present) force option allow to overwrite existing container.
|
||||||
- with states V(stopped), V(restarted) allow to force stop instance.
|
- With states V(stopped), V(restarted) allow to force stop instance.
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
purge:
|
purge:
|
||||||
|
@ -247,14 +244,14 @@ options:
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Indicate desired state of the instance
|
- Indicate desired state of the instance.
|
||||||
- V(template) was added in community.general 8.1.0.
|
- V(template) was added in community.general 8.1.0.
|
||||||
type: str
|
type: str
|
||||||
choices: ['present', 'started', 'absent', 'stopped', 'restarted', 'template']
|
choices: ['present', 'started', 'absent', 'stopped', 'restarted', 'template']
|
||||||
default: present
|
default: present
|
||||||
pubkey:
|
pubkey:
|
||||||
description:
|
description:
|
||||||
- Public key to add to /root/.ssh/authorized_keys. This was added on Proxmox 4.2, it is ignored for earlier versions
|
- Public key to add to /root/.ssh/authorized_keys. This was added on Proxmox 4.2, it is ignored for earlier versions.
|
||||||
type: str
|
type: str
|
||||||
unprivileged:
|
unprivileged:
|
||||||
description:
|
description:
|
||||||
|
@ -292,8 +289,8 @@ options:
|
||||||
- Type of the clone created.
|
- Type of the clone created.
|
||||||
- V(full) creates a full clone, and O(storage) must be specified.
|
- V(full) creates a full clone, and O(storage) must be specified.
|
||||||
- V(linked) creates a linked clone, and the cloned container must be a template container.
|
- V(linked) creates a linked clone, and the cloned container must be a template container.
|
||||||
- V(opportunistic) creates a linked clone if the cloned container is a template container, and a full clone if not.
|
- V(opportunistic) creates a linked clone if the cloned container is a template container, and a full clone if not. O(storage) may be specified,
|
||||||
O(storage) may be specified, if not it will fall back to the default.
|
if not it will fall back to the default.
|
||||||
type: str
|
type: str
|
||||||
choices: ['full', 'linked', 'opportunistic']
|
choices: ['full', 'linked', 'opportunistic']
|
||||||
default: opportunistic
|
default: opportunistic
|
||||||
|
@ -306,9 +303,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.proxmox.selection
|
- community.general.proxmox.selection
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r"""
|
||||||
- name: Create new container with minimal options
|
- name: Create new container with minimal options
|
||||||
community.general.proxmox:
|
community.general.proxmox:
|
||||||
vmid: 100
|
vmid: 100
|
||||||
|
@ -599,7 +596,7 @@ EXAMPLES = r'''
|
||||||
api_password: 1q2w3e
|
api_password: 1q2w3e
|
||||||
api_host: node1
|
api_host: node1
|
||||||
state: absent
|
state: absent
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_backup
|
module: proxmox_backup
|
||||||
author: "Raphael Grieger (@IamLunchbox) <r.grieger@hotmail.com>"
|
author: "Raphael Grieger (@IamLunchbox) <r.grieger@hotmail.com>"
|
||||||
short_description: Start a VM backup in Proxmox VE cluster
|
short_description: Start a VM backup in Proxmox VE cluster
|
||||||
|
@ -42,9 +41,7 @@ options:
|
||||||
change_detection_mode:
|
change_detection_mode:
|
||||||
description:
|
description:
|
||||||
- Set the change detection mode (available from Proxmox VE 8.3).
|
- Set the change detection mode (available from Proxmox VE 8.3).
|
||||||
- >
|
- It is only used when backing up containers, Proxmox silently ignores this option when applied to kvm guests.
|
||||||
Is only used when backing up containers,
|
|
||||||
Proxmox silently ignores this option when applied to kvm guests.
|
|
||||||
type: str
|
type: str
|
||||||
choices: ["legacy", "data", "metadata"]
|
choices: ["legacy", "data", "metadata"]
|
||||||
compress:
|
compress:
|
||||||
|
@ -63,13 +60,9 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specify the description of the backup.
|
- Specify the description of the backup.
|
||||||
- Needs to be a single line, newline and backslash need to be escaped as V(\\n) and V(\\\\) respectively.
|
- Needs to be a single line, newline and backslash need to be escaped as V(\\n) and V(\\\\) respectively.
|
||||||
- >
|
- If you need variable interpolation, you can set the content as usual through ansible jinja templating and/or let Proxmox substitute templates.
|
||||||
If you need variable interpolation, you can set the content as usual
|
- Proxmox currently supports V({{cluster}}), V({{guestname}}), V({{node}}), and V({{vmid}}) as templating variables. Since this is also
|
||||||
through ansible jinja templating and/or let Proxmox substitute templates.
|
a jinja delimiter, you need to set these values as raw jinja.
|
||||||
- >
|
|
||||||
Proxmox currently supports V({{cluster}}), V({{guestname}}),
|
|
||||||
V({{node}}), and V({{vmid}}) as templating variables.
|
|
||||||
Since this is also a jinja delimiter, you need to set these values as raw jinja.
|
|
||||||
default: "{{guestname}}"
|
default: "{{guestname}}"
|
||||||
type: str
|
type: str
|
||||||
fleecing:
|
fleecing:
|
||||||
|
@ -99,7 +92,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Enable other performance-related settings.
|
- Enable other performance-related settings.
|
||||||
- Must be entered as a string, containing comma separated key-value pairs.
|
- Must be entered as a string, containing comma separated key-value pairs.
|
||||||
- "For example: V(max-workers=2,pbs-entries-max=2)."
|
- 'For example: V(max-workers=2,pbs-entries-max=2).'
|
||||||
type: str
|
type: str
|
||||||
pool:
|
pool:
|
||||||
description:
|
description:
|
||||||
|
@ -110,19 +103,14 @@ options:
|
||||||
protected:
|
protected:
|
||||||
description:
|
description:
|
||||||
- Marks backups as protected.
|
- Marks backups as protected.
|
||||||
- >
|
- '"Might fail, when the PBS backend has verify enabled due to this bug: U(https://bugzilla.proxmox.com/show_bug.cgi?id=4289)".'
|
||||||
"Might fail, when the PBS backend has verify enabled
|
|
||||||
due to this bug: U(https://bugzilla.proxmox.com/show_bug.cgi?id=4289)"
|
|
||||||
type: bool
|
type: bool
|
||||||
retention:
|
retention:
|
||||||
description:
|
description:
|
||||||
- >
|
- Use custom retention options instead of those from the default cluster configuration (which is usually V("keep-all=1")).
|
||||||
Use custom retention options instead of those from the default cluster
|
|
||||||
configuration (which is usually V("keep-all")).
|
|
||||||
- Always requires Datastore.Allocate permission at the storage endpoint.
|
- Always requires Datastore.Allocate permission at the storage endpoint.
|
||||||
- >
|
- Specifying a retention time other than V(keep-all=1) might trigger pruning on the datastore, if an existing backup should be deleted
|
||||||
Specifying a retention time other than V(keep-all=1) might trigger pruning on the datastore,
|
due to your specified timeframe.
|
||||||
if an existing backup should be deleted target due to your specified timeframe.
|
|
||||||
- Deleting requires C(Datastore.Modify) or C(Datastore.Prune) permissions on the backup storage.
|
- Deleting requires C(Datastore.Modify) or C(Datastore.Prune) permissions on the backup storage.
|
||||||
type: str
|
type: str
|
||||||
storage:
|
storage:
|
||||||
|
@ -153,9 +141,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.actiongroup_proxmox
|
- community.general.proxmox.actiongroup_proxmox
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r"""
|
||||||
- name: Backup all vms in the Proxmox cluster to storage mypbs
|
- name: Backup all vms in the Proxmox cluster to storage mypbs
|
||||||
community.general.proxmox_backup:
|
community.general.proxmox_backup:
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
|
@ -204,9 +192,9 @@ EXAMPLES = r'''
|
||||||
vmids:
|
vmids:
|
||||||
- 100
|
- 100
|
||||||
- 101
|
- 101
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = r'''
|
RETURN = r"""
|
||||||
backups:
|
backups:
|
||||||
description: List of nodes and their task IDs.
|
description: List of nodes and their task IDs.
|
||||||
returned: on success
|
returned: on success
|
||||||
|
@ -223,13 +211,12 @@ backups:
|
||||||
type: str
|
type: str
|
||||||
choices: ["unknown", "success", "failed"]
|
choices: ["unknown", "success", "failed"]
|
||||||
upid:
|
upid:
|
||||||
description: >
|
description: >-
|
||||||
Proxmox cluster UPID, which is needed to lookup task info.
|
Proxmox cluster UPID, which is needed to lookup task info. Returns OK, when a cluster node did not create a task after being called, for
|
||||||
Returns OK, when a cluster node did not create a task after being called,
|
example due to no matching targets.
|
||||||
e.g. due to no matching targets.
|
|
||||||
returned: on success
|
returned: on success
|
||||||
type: str
|
type: str
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_disk
|
module: proxmox_disk
|
||||||
short_description: Management of a disk of a Qemu(KVM) VM in a Proxmox VE cluster
|
short_description: Management of a disk of a Qemu(KVM) VM in a Proxmox VE cluster
|
||||||
version_added: 5.7.0
|
version_added: 5.7.0
|
||||||
|
@ -38,31 +37,21 @@ options:
|
||||||
description:
|
description:
|
||||||
- The disk key (V(unused[n]), V(ide[n]), V(sata[n]), V(scsi[n]) or V(virtio[n])) you want to operate on.
|
- The disk key (V(unused[n]), V(ide[n]), V(sata[n]), V(scsi[n]) or V(virtio[n])) you want to operate on.
|
||||||
- Disk buses (IDE, SATA and so on) have fixed ranges of V(n) that accepted by Proxmox API.
|
- Disk buses (IDE, SATA and so on) have fixed ranges of V(n) that accepted by Proxmox API.
|
||||||
- >
|
- 'For IDE: 0-3; for SCSI: 0-30; for SATA: 0-5; for VirtIO: 0-15; for Unused: 0-255.'
|
||||||
For IDE: 0-3;
|
|
||||||
for SCSI: 0-30;
|
|
||||||
for SATA: 0-5;
|
|
||||||
for VirtIO: 0-15;
|
|
||||||
for Unused: 0-255.
|
|
||||||
type: str
|
type: str
|
||||||
required: true
|
required: true
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Indicates desired state of the disk.
|
- Indicates desired state of the disk.
|
||||||
- >
|
- O(state=present) can be used to create, replace disk or update options in existing disk. It will create missing disk or update options
|
||||||
O(state=present) can be used to create, replace disk or update options in existing disk. It will create missing
|
in existing one by default. See the O(create) parameter description to control behavior of this option.
|
||||||
disk or update options in existing one by default. See the O(create) parameter description to control behavior
|
|
||||||
of this option.
|
|
||||||
- Some updates on options (like O(cache)) are not being applied instantly and require VM restart.
|
- Some updates on options (like O(cache)) are not being applied instantly and require VM restart.
|
||||||
- >
|
- Use O(state=detached) to detach existing disk from VM but do not remove it entirely. When O(state=detached) and disk is V(unused[n]) it
|
||||||
Use O(state=detached) to detach existing disk from VM but do not remove it entirely.
|
will be left in same state (not removed).
|
||||||
When O(state=detached) and disk is V(unused[n]) it will be left in same state (not removed).
|
- O(state=moved) may be used to change backing storage for the disk in bounds of the same VM or to send the disk to another VM (using the
|
||||||
- >
|
same backing storage).
|
||||||
O(state=moved) may be used to change backing storage for the disk in bounds of the same VM
|
- O(state=resized) intended to change the disk size. As of Proxmox 7.2 you can only increase the disk size because shrinking disks is not
|
||||||
or to send the disk to another VM (using the same backing storage).
|
supported by the PVE API and has to be done manually.
|
||||||
- >
|
|
||||||
O(state=resized) intended to change the disk size. As of Proxmox 7.2 you can only increase the disk size
|
|
||||||
because shrinking disks is not supported by the PVE API and has to be done manually.
|
|
||||||
- To entirely remove the disk from backing storage use O(state=absent).
|
- To entirely remove the disk from backing storage use O(state=absent).
|
||||||
type: str
|
type: str
|
||||||
choices: ['present', 'resized', 'detached', 'moved', 'absent']
|
choices: ['present', 'resized', 'detached', 'moved', 'absent']
|
||||||
|
@ -84,10 +73,8 @@ options:
|
||||||
size:
|
size:
|
||||||
description:
|
description:
|
||||||
- Desired volume size in GB to allocate when O(state=present) (specify O(size) without suffix).
|
- Desired volume size in GB to allocate when O(state=present) (specify O(size) without suffix).
|
||||||
- >
|
- New (or additional) size of volume when O(state=resized). With the V(+) sign the value is added to the actual size of the volume and without
|
||||||
New (or additional) size of volume when O(state=resized). With the V(+) sign
|
it, the value is taken as an absolute one.
|
||||||
the value is added to the actual size of the volume
|
|
||||||
and without it, the value is taken as an absolute one.
|
|
||||||
type: str
|
type: str
|
||||||
bwlimit:
|
bwlimit:
|
||||||
description:
|
description:
|
||||||
|
@ -176,8 +163,8 @@ options:
|
||||||
import_from:
|
import_from:
|
||||||
description:
|
description:
|
||||||
- Import volume from this existing one.
|
- Import volume from this existing one.
|
||||||
- Volume string format
|
- Volume string format.
|
||||||
- C(<STORAGE>:<VMID>/<FULL_NAME>) or C(<ABSOLUTE_PATH>/<FULL_NAME>)
|
- V(<STORAGE>:<VMID>/<FULL_NAME>) or V(<ABSOLUTE_PATH>/<FULL_NAME>).
|
||||||
- Attention! Only root can use absolute paths.
|
- Attention! Only root can use absolute paths.
|
||||||
- This parameter is mutually exclusive with O(size).
|
- This parameter is mutually exclusive with O(size).
|
||||||
- Increase O(timeout) parameter when importing large disk images or using slow storage.
|
- Increase O(timeout) parameter when importing large disk images or using slow storage.
|
||||||
|
@ -223,7 +210,7 @@ options:
|
||||||
type: int
|
type: int
|
||||||
iothread:
|
iothread:
|
||||||
description:
|
description:
|
||||||
- Whether to use iothreads for this drive (only for SCSI and VirtIO)
|
- Whether to use iothreads for this drive (only for SCSI and VirtIO).
|
||||||
type: bool
|
type: bool
|
||||||
mbps:
|
mbps:
|
||||||
description:
|
description:
|
||||||
|
@ -262,10 +249,9 @@ options:
|
||||||
description:
|
description:
|
||||||
- The ISO image to be mounted on the specified in O(disk) CD-ROM.
|
- The ISO image to be mounted on the specified in O(disk) CD-ROM.
|
||||||
- O(media=cdrom) needs to be specified for this option to work.
|
- O(media=cdrom) needs to be specified for this option to work.
|
||||||
- "Image string format:"
|
- Use V(<STORAGE>:iso/<ISO_NAME>) to mount ISO.
|
||||||
- V(<STORAGE>:iso/<ISO_NAME>) to mount ISO.
|
- Use V(cdrom) to access the physical CD/DVD drive.
|
||||||
- V(cdrom) to use physical CD/DVD drive.
|
- Use V(none) to unmount image from existent CD-ROM or create empty CD-ROM drive.
|
||||||
- V(none) to unmount image from existent CD-ROM or create empty CD-ROM drive.
|
|
||||||
type: str
|
type: str
|
||||||
version_added: 8.1.0
|
version_added: 8.1.0
|
||||||
queues:
|
queues:
|
||||||
|
@ -330,9 +316,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.actiongroup_proxmox
|
- community.general.proxmox.actiongroup_proxmox
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create new disk in VM (do not rewrite in case it exists already)
|
- name: Create new disk in VM (do not rewrite in case it exists already)
|
||||||
community.general.proxmox_disk:
|
community.general.proxmox_disk:
|
||||||
api_host: node1
|
api_host: node1
|
||||||
|
@ -437,9 +423,9 @@ EXAMPLES = '''
|
||||||
media: cdrom
|
media: cdrom
|
||||||
iso_image: local:iso/favorite_distro_amd64.iso
|
iso_image: local:iso/favorite_distro_amd64.iso
|
||||||
state: present
|
state: present
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
vmid:
|
vmid:
|
||||||
description: The VM vmid.
|
description: The VM vmid.
|
||||||
returned: success
|
returned: success
|
||||||
|
@ -450,7 +436,7 @@ msg:
|
||||||
returned: always
|
returned: always
|
||||||
type: str
|
type: str
|
||||||
sample: "Disk scsi3 created in VM 101"
|
sample: "Disk scsi3 created in VM 101"
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec,
|
from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec,
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_domain_info
|
module: proxmox_domain_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE domains
|
short_description: Retrieve information about one or more Proxmox VE domains
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
|
@ -31,10 +30,10 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List existing domains
|
- name: List existing domains
|
||||||
community.general.proxmox_domain_info:
|
community.general.proxmox_domain_info:
|
||||||
api_host: helldorado
|
api_host: helldorado
|
||||||
|
@ -53,10 +52,10 @@ EXAMPLES = '''
|
||||||
api_token_secret: "{{ token_secret | default(omit) }}"
|
api_token_secret: "{{ token_secret | default(omit) }}"
|
||||||
domain: pve
|
domain: pve
|
||||||
register: proxmox_domain_pve
|
register: proxmox_domain_pve
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
proxmox_domains:
|
proxmox_domains:
|
||||||
description: List of authentication domains.
|
description: List of authentication domains.
|
||||||
returned: always, but can be empty
|
returned: always, but can be empty
|
||||||
|
@ -79,7 +78,7 @@ proxmox_domains:
|
||||||
description: Realm hash.
|
description: Realm hash.
|
||||||
returned: on success, can be absent
|
returned: on success, can be absent
|
||||||
type: str
|
type: str
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
|
@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_group_info
|
module: proxmox_group_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE groups
|
short_description: Retrieve information about one or more Proxmox VE groups
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
description:
|
description:
|
||||||
- Retrieve information about one or more Proxmox VE groups
|
- Retrieve information about one or more Proxmox VE groups.
|
||||||
attributes:
|
attributes:
|
||||||
action_group:
|
action_group:
|
||||||
version_added: 9.0.0
|
version_added: 9.0.0
|
||||||
|
@ -31,10 +30,10 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List existing groups
|
- name: List existing groups
|
||||||
community.general.proxmox_group_info:
|
community.general.proxmox_group_info:
|
||||||
api_host: helldorado
|
api_host: helldorado
|
||||||
|
@ -53,10 +52,10 @@ EXAMPLES = '''
|
||||||
api_token_secret: "{{ token_secret | default(omit) }}"
|
api_token_secret: "{{ token_secret | default(omit) }}"
|
||||||
group: admin
|
group: admin
|
||||||
register: proxmox_group_admin
|
register: proxmox_group_admin
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
proxmox_groups:
|
proxmox_groups:
|
||||||
description: List of groups.
|
description: List of groups.
|
||||||
returned: always, but can be empty
|
returned: always, but can be empty
|
||||||
|
@ -76,7 +75,7 @@ proxmox_groups:
|
||||||
returned: on success
|
returned: on success
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_kvm
|
module: proxmox_kvm
|
||||||
short_description: Management of Qemu(KVM) Virtual Machines in Proxmox VE cluster
|
short_description: Management of Qemu(KVM) Virtual Machines in Proxmox VE cluster
|
||||||
description:
|
description:
|
||||||
|
@ -66,21 +65,21 @@ options:
|
||||||
type: str
|
type: str
|
||||||
bootdisk:
|
bootdisk:
|
||||||
description:
|
description:
|
||||||
- 'Enable booting from specified disk. Format V((ide|sata|scsi|virtio\)\\d+).'
|
- Enable booting from specified disk. Format V((ide|sata|scsi|virtio\)\\d+).
|
||||||
type: str
|
type: str
|
||||||
cicustom:
|
cicustom:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: Specify custom files to replace the automatically generated ones at start.'
|
- 'Cloud-init: Specify custom files to replace the automatically generated ones at start.'
|
||||||
type: str
|
type: str
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
cipassword:
|
cipassword:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: password of default user to create.'
|
- 'Cloud-init: password of default user to create.'
|
||||||
type: str
|
type: str
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
citype:
|
citype:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: Specifies the cloud-init configuration format.'
|
- 'Cloud-init: Specifies the cloud-init configuration format.'
|
||||||
- The default depends on the configured operating system type (V(ostype)).
|
- The default depends on the configured operating system type (V(ostype)).
|
||||||
- We use the V(nocloud) format for Linux, and V(configdrive2) for Windows.
|
- We use the V(nocloud) format for Linux, and V(configdrive2) for Windows.
|
||||||
type: str
|
type: str
|
||||||
|
@ -88,12 +87,12 @@ options:
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
ciupgrade:
|
ciupgrade:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: do an automatic package upgrade after the first boot.'
|
- 'Cloud-init: do an automatic package upgrade after the first boot.'
|
||||||
type: bool
|
type: bool
|
||||||
version_added: 10.0.0
|
version_added: 10.0.0
|
||||||
ciuser:
|
ciuser:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: username of default user to create.'
|
- 'Cloud-init: username of default user to create.'
|
||||||
type: str
|
type: str
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
clone:
|
clone:
|
||||||
|
@ -110,13 +109,13 @@ options:
|
||||||
type: str
|
type: str
|
||||||
cpulimit:
|
cpulimit:
|
||||||
description:
|
description:
|
||||||
- Specify if CPU usage will be limited. Value 0 indicates no CPU limit.
|
- Specify if CPU usage will be limited. Value V(0) indicates no CPU limit.
|
||||||
- If the computer has 2 CPUs, it has total of '2' CPU time
|
- If the computer has 2 CPUs, it has total of '2' CPU time.
|
||||||
type: int
|
type: int
|
||||||
cpuunits:
|
cpuunits:
|
||||||
description:
|
description:
|
||||||
- Specify CPU weight for a VM.
|
- Specify CPU weight for a VM.
|
||||||
- You can disable fair-scheduler configuration by setting this to 0
|
- You can disable fair-scheduler configuration by setting this to V(0).
|
||||||
type: int
|
type: int
|
||||||
delete:
|
delete:
|
||||||
description:
|
description:
|
||||||
|
@ -144,24 +143,22 @@ options:
|
||||||
type: str
|
type: str
|
||||||
format:
|
format:
|
||||||
description:
|
description:
|
||||||
- V(format) is the drive's backing file's data format. Please refer to the Proxmox VE Administrator Guide,
|
- V(format) is the drive's backing file's data format. Please refer to the Proxmox VE Administrator Guide, section Proxmox VE Storage
|
||||||
section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest
|
(see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format supported by
|
||||||
version, tables 3 to 14) to find out format supported by the provided storage backend.
|
the provided storage backend.
|
||||||
type: str
|
type: str
|
||||||
efitype:
|
efitype:
|
||||||
description:
|
description:
|
||||||
- V(efitype) indicates the size of the EFI disk.
|
- V(efitype) indicates the size of the EFI disk.
|
||||||
- V(2m) will allow for a 2MB EFI disk, which will be enough to persist boot order and new boot entries.
|
- V(2m) will allow for a 2MB EFI disk, which will be enough to persist boot order and new boot entries.
|
||||||
- V(4m) will allow for a 4MB EFI disk, which will additionally allow to store EFI keys in order to enable
|
- V(4m) will allow for a 4MB EFI disk, which will additionally allow to store EFI keys in order to enable Secure Boot.
|
||||||
Secure Boot
|
|
||||||
type: str
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- 2m
|
- 2m
|
||||||
- 4m
|
- 4m
|
||||||
pre_enrolled_keys:
|
pre_enrolled_keys:
|
||||||
description:
|
description:
|
||||||
- V(pre_enrolled_keys) indicates whether EFI keys for Secure Boot should be enrolled V(1) in the VM firmware
|
- V(pre_enrolled_keys) indicates whether EFI keys for Secure Boot should be enrolled V(1) in the VM firmware upon creation or not (0).
|
||||||
upon creation or not (0).
|
|
||||||
- If set to V(1), Secure Boot will also be enabled by default when the VM is created.
|
- If set to V(1), Secure Boot will also be enabled by default when the VM is created.
|
||||||
type: bool
|
type: bool
|
||||||
version_added: 4.5.0
|
version_added: 4.5.0
|
||||||
|
@ -174,11 +171,10 @@ options:
|
||||||
format:
|
format:
|
||||||
description:
|
description:
|
||||||
- Target drive's backing file's data format.
|
- Target drive's backing file's data format.
|
||||||
- Used only with clone
|
- Used only with clone.
|
||||||
- Use O(format=unspecified) and O(full=false) for a linked clone.
|
- Use O(format=unspecified) and O(full=false) for a linked clone.
|
||||||
- Please refer to the Proxmox VE Administrator Guide, section Proxmox VE Storage (see
|
- Please refer to the Proxmox VE Administrator Guide, section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html)
|
||||||
U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format
|
for the latest version, tables 3 to 14) to find out format supported by the provided storage backend.
|
||||||
supported by the provided storage backend.
|
|
||||||
- Not specifying this option is equivalent to setting it to V(unspecified).
|
- Not specifying this option is equivalent to setting it to V(unspecified).
|
||||||
type: str
|
type: str
|
||||||
choices: ["cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified"]
|
choices: ["cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified"]
|
||||||
|
@ -190,7 +186,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- Create a full copy of all disk. This is always done when you clone a normal VM.
|
- Create a full copy of all disk. This is always done when you clone a normal VM.
|
||||||
- For VM templates, we try to create a linked clone by default.
|
- For VM templates, we try to create a linked clone by default.
|
||||||
- Used only with clone
|
- Used only with clone.
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
default: true
|
||||||
hookscript:
|
hookscript:
|
||||||
|
@ -202,11 +198,11 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specify a hash/dictionary of map host pci devices into guest. O(hostpci='{"key":"value", "key":"value"}').
|
- Specify a hash/dictionary of map host pci devices into guest. O(hostpci='{"key":"value", "key":"value"}').
|
||||||
- Keys allowed are - C(hostpci[n]) where 0 ≤ n ≤ N.
|
- Keys allowed are - C(hostpci[n]) where 0 ≤ n ≤ N.
|
||||||
- Values allowed are - C("host="HOSTPCIID[;HOSTPCIID2...]",pcie="1|0",rombar="1|0",x-vga="1|0"").
|
- Values allowed are - V("host="HOSTPCIID[;HOSTPCIID2...]",pcie="1|0",rombar="1|0",x-vga="1|0"").
|
||||||
- The C(host) parameter is Host PCI device pass through. HOSTPCIID syntax is C(bus:dev.func) (hexadecimal numbers).
|
- The C(host) parameter is Host PCI device pass through. HOSTPCIID syntax is V(bus:dev.func) (hexadecimal numbers).
|
||||||
- C(pcie=boolean) C(default=0) Choose the PCI-express bus (needs the q35 machine model).
|
- V(pcie=boolean) V(default=0) Choose the PCI-express bus (needs the q35 machine model).
|
||||||
- C(rombar=boolean) C(default=1) Specify whether or not the device's ROM will be visible in the guest's memory map.
|
- V(rombar=boolean) V(default=1) Specify whether or not the device's ROM will be visible in the guest's memory map.
|
||||||
- C(x-vga=boolean) C(default=0) Enable vfio-vga device support.
|
- V(x-vga=boolean) V(default=0) Enable vfio-vga device support.
|
||||||
- /!\ This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care.
|
- /!\ This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care.
|
||||||
type: dict
|
type: dict
|
||||||
hotplug:
|
hotplug:
|
||||||
|
@ -223,21 +219,21 @@ options:
|
||||||
ide:
|
ide:
|
||||||
description:
|
description:
|
||||||
- A hash/dictionary of volume used as IDE hard disk or CD-ROM. O(ide='{"key":"value", "key":"value"}').
|
- A hash/dictionary of volume used as IDE hard disk or CD-ROM. O(ide='{"key":"value", "key":"value"}').
|
||||||
- Keys allowed are - C(ide[n]) where 0 ≤ n ≤ 3.
|
- Keys allowed are - V(ide[n]) where 0 ≤ n ≤ 3.
|
||||||
- Values allowed are - C("storage:size,format=value").
|
- Values allowed are - V("storage:size,format=value").
|
||||||
- C(storage) is the storage identifier where to create the disk.
|
- V(storage) is the storage identifier where to create the disk.
|
||||||
- C(size) is the size of the disk in GB.
|
- V(size) is the size of the disk in GB.
|
||||||
- C(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE
|
- V(format) is the drive's backing file's data format. V(qcow2|raw|subvol). Please refer to the Proxmox VE Administrator Guide, section
|
||||||
Administrator Guide, section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for
|
Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format
|
||||||
the latest version, tables 3 to 14) to find out format supported by the provided storage backend.
|
supported by the provided storage backend.
|
||||||
type: dict
|
type: dict
|
||||||
ipconfig:
|
ipconfig:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: Set the IP configuration.'
|
- 'Cloud-init: Set the IP configuration.'
|
||||||
- A hash/dictionary of network ip configurations. O(ipconfig='{"key":"value", "key":"value"}').
|
- A hash/dictionary of network ip configurations. O(ipconfig='{"key":"value", "key":"value"}').
|
||||||
- Keys allowed are - C(ipconfig[n]) where 0 ≤ n ≤ network interfaces.
|
- Keys allowed are - V(ipconfig[n]) where 0 ≤ n ≤ network interfaces.
|
||||||
- Values allowed are - C("[gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>]").
|
- Values allowed are - V("[gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>]").
|
||||||
- 'cloud-init: Specify IP addresses and gateways for the corresponding interface.'
|
- 'Cloud-init: Specify IP addresses and gateways for the corresponding interface.'
|
||||||
- IP addresses use CIDR notation, gateways are optional but they should be in the same subnet of specified IP address.
|
- IP addresses use CIDR notation, gateways are optional but they should be in the same subnet of specified IP address.
|
||||||
- The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit gateway should be provided.
|
- The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit gateway should be provided.
|
||||||
- For IPv6 the special string 'auto' can be used to use stateless autoconfiguration.
|
- For IPv6 the special string 'auto' can be used to use stateless autoconfiguration.
|
||||||
|
@ -265,7 +261,7 @@ options:
|
||||||
machine:
|
machine:
|
||||||
description:
|
description:
|
||||||
- Specifies the Qemu machine type.
|
- Specifies the Qemu machine type.
|
||||||
- 'Type => V((pc|pc(-i440fx\)?-\\d+\\.\\d+(\\.pxe\)?|q35|pc-q35-\\d+\\.\\d+(\\.pxe\)?\)).'
|
- Type => V((pc|pc(-i440fx\)?-\\d+\\.\\d+(\\.pxe\)?|q35|pc-q35-\\d+\\.\\d+(\\.pxe\)?\)).
|
||||||
type: str
|
type: str
|
||||||
memory:
|
memory:
|
||||||
description:
|
description:
|
||||||
|
@ -294,7 +290,7 @@ options:
|
||||||
type: str
|
type: str
|
||||||
nameservers:
|
nameservers:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: DNS server IP address(es).'
|
- 'Cloud-init: DNS server IP address(es).'
|
||||||
- If unset, PVE host settings are used.
|
- If unset, PVE host settings are used.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
|
@ -307,7 +303,8 @@ options:
|
||||||
- Model is one of C(e1000 e1000-82540em e1000-82544gc e1000-82545em i82551 i82557b i82559er ne2k_isa ne2k_pci pcnet rtl8139 virtio vmxnet3).
|
- Model is one of C(e1000 e1000-82540em e1000-82544gc e1000-82545em i82551 i82557b i82559er ne2k_isa ne2k_pci pcnet rtl8139 virtio vmxnet3).
|
||||||
- C(XX:XX:XX:XX:XX:XX) should be an unique MAC address. This is automatically generated if not specified.
|
- C(XX:XX:XX:XX:XX:XX) should be an unique MAC address. This is automatically generated if not specified.
|
||||||
- The C(bridge) parameter can be used to automatically add the interface to a bridge device. The Proxmox VE standard bridge is called 'vmbr0'.
|
- The C(bridge) parameter can be used to automatically add the interface to a bridge device. The Proxmox VE standard bridge is called 'vmbr0'.
|
||||||
- Option C(rate) is used to limit traffic bandwidth from and to this interface. It is specified as floating point number, unit is 'Megabytes per second'.
|
- Option C(rate) is used to limit traffic bandwidth from and to this interface. It is specified as floating point number, unit is 'Megabytes
|
||||||
|
per second'.
|
||||||
- If you specify no bridge, we create a kvm 'user' (NATed) network device, which provides DHCP and DNS services.
|
- If you specify no bridge, we create a kvm 'user' (NATed) network device, which provides DHCP and DNS services.
|
||||||
type: dict
|
type: dict
|
||||||
newid:
|
newid:
|
||||||
|
@ -364,9 +361,9 @@ options:
|
||||||
- Values allowed are - C("storage:size,format=value").
|
- Values allowed are - C("storage:size,format=value").
|
||||||
- C(storage) is the storage identifier where to create the disk.
|
- C(storage) is the storage identifier where to create the disk.
|
||||||
- C(size) is the size of the disk in GB.
|
- C(size) is the size of the disk in GB.
|
||||||
- C(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE
|
- C(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE Administrator Guide, section
|
||||||
Administrator Guide, section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for
|
Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format
|
||||||
the latest version, tables 3 to 14) to find out format supported by the provided storage backend.
|
supported by the provided storage backend.
|
||||||
type: dict
|
type: dict
|
||||||
scsi:
|
scsi:
|
||||||
description:
|
description:
|
||||||
|
@ -375,9 +372,9 @@ options:
|
||||||
- Values allowed are - C("storage:size,format=value").
|
- Values allowed are - C("storage:size,format=value").
|
||||||
- C(storage) is the storage identifier where to create the disk.
|
- C(storage) is the storage identifier where to create the disk.
|
||||||
- C(size) is the size of the disk in GB.
|
- C(size) is the size of the disk in GB.
|
||||||
- C(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE
|
- C(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE Administrator Guide, section
|
||||||
Administrator Guide, section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for
|
Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format
|
||||||
the latest version, tables 3 to 14) to find out format supported by the provided storage backend.
|
supported by the provided storage backend.
|
||||||
type: dict
|
type: dict
|
||||||
scsihw:
|
scsihw:
|
||||||
description:
|
description:
|
||||||
|
@ -386,7 +383,7 @@ options:
|
||||||
choices: ['lsi', 'lsi53c810', 'virtio-scsi-pci', 'virtio-scsi-single', 'megasas', 'pvscsi']
|
choices: ['lsi', 'lsi53c810', 'virtio-scsi-pci', 'virtio-scsi-single', 'megasas', 'pvscsi']
|
||||||
searchdomains:
|
searchdomains:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: Sets DNS search domain(s).'
|
- 'Cloud-init: Sets DNS search domain(s).'
|
||||||
- If unset, PVE host settings are used.
|
- If unset, PVE host settings are used.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
|
@ -407,20 +404,20 @@ options:
|
||||||
type: int
|
type: int
|
||||||
skiplock:
|
skiplock:
|
||||||
description:
|
description:
|
||||||
- Ignore locks
|
- Ignore locks.
|
||||||
- Only root is allowed to use this option.
|
- Only root is allowed to use this option.
|
||||||
type: bool
|
type: bool
|
||||||
smbios:
|
smbios:
|
||||||
description:
|
description:
|
||||||
- Specifies SMBIOS type 1 fields.
|
- Specifies SMBIOS type 1 fields.
|
||||||
- "Comma separated, Base64 encoded (optional) SMBIOS properties:"
|
- Comma separated, Base64 encoded (optional) SMBIOS properties:.
|
||||||
- V([base64=<1|0>] [,family=<Base64 encoded string>])
|
- V([base64=<1|0>] [,family=<Base64 encoded string>]).
|
||||||
- V([,manufacturer=<Base64 encoded string>])
|
- V([,manufacturer=<Base64 encoded string>]).
|
||||||
- V([,product=<Base64 encoded string>])
|
- V([,product=<Base64 encoded string>]).
|
||||||
- V([,serial=<Base64 encoded string>])
|
- V([,serial=<Base64 encoded string>]).
|
||||||
- V([,sku=<Base64 encoded string>])
|
- V([,sku=<Base64 encoded string>]).
|
||||||
- V([,uuid=<UUID>])
|
- V([,uuid=<UUID>]).
|
||||||
- V([,version=<Base64 encoded string>])
|
- V([,version=<Base64 encoded string>]).
|
||||||
type: str
|
type: str
|
||||||
snapname:
|
snapname:
|
||||||
description:
|
description:
|
||||||
|
@ -432,7 +429,7 @@ options:
|
||||||
type: int
|
type: int
|
||||||
sshkeys:
|
sshkeys:
|
||||||
description:
|
description:
|
||||||
- 'cloud-init: SSH key to assign to the default user. NOT TESTED with multiple keys but a multi-line value should work.'
|
- 'Cloud-init: SSH key to assign to the default user. NOT TESTED with multiple keys but a multi-line value should work.'
|
||||||
type: str
|
type: str
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
startdate:
|
startdate:
|
||||||
|
@ -449,7 +446,7 @@ options:
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Indicates desired state of the instance.
|
- Indicates desired state of the instance.
|
||||||
- If V(current), the current state of the VM will be fetched. You can access it with C(results.status)
|
- If V(current), the current state of the VM will be fetched. You can access it with C(results.status).
|
||||||
- V(template) was added in community.general 8.1.0.
|
- V(template) was added in community.general 8.1.0.
|
||||||
type: str
|
type: str
|
||||||
choices: ['present', 'started', 'absent', 'stopped', 'restarted', 'current', 'template']
|
choices: ['present', 'started', 'absent', 'stopped', 'restarted', 'current', 'template']
|
||||||
|
@ -473,7 +470,7 @@ options:
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- Target node. Only allowed if the original VM is on shared storage.
|
- Target node. Only allowed if the original VM is on shared storage.
|
||||||
- Used only with clone
|
- Used only with clone.
|
||||||
type: str
|
type: str
|
||||||
tdf:
|
tdf:
|
||||||
description:
|
description:
|
||||||
|
@ -512,7 +509,7 @@ options:
|
||||||
- A hash/dictionary of USB devices for the VM. O(usb='{"key":"value", "key":"value"}').
|
- A hash/dictionary of USB devices for the VM. O(usb='{"key":"value", "key":"value"}').
|
||||||
- Keys allowed are - C(usb[n]) where 0 ≤ n ≤ N.
|
- Keys allowed are - C(usb[n]) where 0 ≤ n ≤ N.
|
||||||
- Values allowed are - C(host="value|spice",mapping="value",usb3="1|0").
|
- Values allowed are - C(host="value|spice",mapping="value",usb3="1|0").
|
||||||
- host is either C(spice) or the USB id/port.
|
- Host is either C(spice) or the USB id/port.
|
||||||
- Option C(mapping) is the mapped USB device name.
|
- Option C(mapping) is the mapped USB device name.
|
||||||
- Option C(usb3) enables USB 3 support.
|
- Option C(usb3) enables USB 3 support.
|
||||||
type: dict
|
type: dict
|
||||||
|
@ -520,16 +517,16 @@ options:
|
||||||
update:
|
update:
|
||||||
description:
|
description:
|
||||||
- If V(true), the VM will be updated with new value.
|
- If V(true), the VM will be updated with new value.
|
||||||
- Because of the operations of the API and security reasons, I have disabled the update of the following parameters
|
- Because of the operations of the API and security reasons, I have disabled the update of the following parameters O(net), O(virtio), O(ide),
|
||||||
O(net), O(virtio), O(ide), O(sata), O(scsi). Per example updating O(net) update the MAC address and C(virtio) create always new disk...
|
O(sata), O(scsi). Per example updating O(net) update the MAC address and O(virtio) create always new disk... This security feature can
|
||||||
This security feature can be disabled by setting the O(update_unsafe) to V(true).
|
be disabled by setting the O(update_unsafe) to V(true).
|
||||||
- Update of O(pool) is disabled. It needs an additional API endpoint not covered by this module.
|
- Update of O(pool) is disabled. It needs an additional API endpoint not covered by this module.
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
update_unsafe:
|
update_unsafe:
|
||||||
description:
|
description:
|
||||||
- If V(true), do not enforce limitations on parameters O(net), O(virtio), O(ide), O(sata), O(scsi), O(efidisk0), and O(tpmstate0).
|
- If V(true), do not enforce limitations on parameters O(net), O(virtio), O(ide), O(sata), O(scsi), O(efidisk0), and O(tpmstate0). Use this
|
||||||
Use this option with caution because an improper configuration might result in a permanent loss of data (e.g. disk recreated).
|
option with caution because an improper configuration might result in a permanent loss of data (for example disk recreated).
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
version_added: 8.4.0
|
version_added: 8.4.0
|
||||||
|
@ -545,13 +542,13 @@ options:
|
||||||
virtio:
|
virtio:
|
||||||
description:
|
description:
|
||||||
- A hash/dictionary of volume used as VIRTIO hard disk. O(virtio='{"key":"value", "key":"value"}').
|
- A hash/dictionary of volume used as VIRTIO hard disk. O(virtio='{"key":"value", "key":"value"}').
|
||||||
- Keys allowed are - C(virtio[n]) where 0 ≤ n ≤ 15.
|
- Keys allowed are - V(virtio[n]) where 0 ≤ n ≤ 15.
|
||||||
- Values allowed are - C("storage:size,format=value").
|
- Values allowed are - V("storage:size,format=value").
|
||||||
- C(storage) is the storage identifier where to create the disk.
|
- V(storage) is the storage identifier where to create the disk.
|
||||||
- C(size) is the size of the disk in GB.
|
- V(size) is the size of the disk in GB.
|
||||||
- C(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE
|
- V(format) is the drive's backing file's data format. C(qcow2|raw|subvol). Please refer to the Proxmox VE Administrator Guide, section
|
||||||
Administrator Guide, section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html)
|
Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format
|
||||||
for the latest version, tables 3 to 14) to find out format supported by the provided storage backend.
|
supported by the provided storage backend.
|
||||||
type: dict
|
type: dict
|
||||||
watchdog:
|
watchdog:
|
||||||
description:
|
description:
|
||||||
|
@ -564,9 +561,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.proxmox.selection
|
- community.general.proxmox.selection
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create new VM with minimal options
|
- name: Create new VM with minimal options
|
||||||
community.general.proxmox_kvm:
|
community.general.proxmox_kvm:
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
|
@ -886,10 +883,9 @@ EXAMPLES = '''
|
||||||
node: sabrewulf
|
node: sabrewulf
|
||||||
hookscript: local:snippets/hookscript.pl
|
hookscript: local:snippets/hookscript.pl
|
||||||
update: true
|
update: true
|
||||||
|
"""
|
||||||
|
|
||||||
'''
|
RETURN = r"""
|
||||||
|
|
||||||
RETURN = '''
|
|
||||||
vmid:
|
vmid:
|
||||||
description: The VM vmid.
|
description: The VM vmid.
|
||||||
returned: success
|
returned: success
|
||||||
|
@ -901,11 +897,11 @@ status:
|
||||||
type: str
|
type: str
|
||||||
sample: running
|
sample: running
|
||||||
msg:
|
msg:
|
||||||
description: A short message
|
description: A short message.
|
||||||
returned: always
|
returned: always
|
||||||
type: str
|
type: str
|
||||||
sample: "VM kropta with vmid = 110 is running"
|
sample: "VM kropta with vmid = 110 is running"
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_nic
|
module: proxmox_nic
|
||||||
short_description: Management of a NIC of a Qemu(KVM) VM in a Proxmox VE cluster
|
short_description: Management of a NIC of a Qemu(KVM) VM in a Proxmox VE cluster
|
||||||
version_added: 3.1.0
|
version_added: 3.1.0
|
||||||
|
@ -52,8 +51,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- The NIC emulator model.
|
- The NIC emulator model.
|
||||||
type: str
|
type: str
|
||||||
choices: ['e1000', 'e1000-82540em', 'e1000-82544gc', 'e1000-82545em', 'i82551', 'i82557b', 'i82559er', 'ne2k_isa', 'ne2k_pci', 'pcnet',
|
choices: ['e1000', 'e1000-82540em', 'e1000-82544gc', 'e1000-82545em', 'i82551', 'i82557b', 'i82559er', 'ne2k_isa', 'ne2k_pci', 'pcnet', 'rtl8139',
|
||||||
'rtl8139', 'virtio', 'vmxnet3']
|
'virtio', 'vmxnet3']
|
||||||
default: virtio
|
default: virtio
|
||||||
mtu:
|
mtu:
|
||||||
description:
|
description:
|
||||||
|
@ -99,9 +98,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.actiongroup_proxmox
|
- community.general.proxmox.actiongroup_proxmox
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create NIC net0 targeting the vm by name
|
- name: Create NIC net0 targeting the vm by name
|
||||||
community.general.proxmox_nic:
|
community.general.proxmox_nic:
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
|
@ -131,20 +130,20 @@ EXAMPLES = '''
|
||||||
name: my_vm
|
name: my_vm
|
||||||
interface: net0
|
interface: net0
|
||||||
state: absent
|
state: absent
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
vmid:
|
vmid:
|
||||||
description: The VM vmid.
|
description: The VM vmid.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
sample: 115
|
sample: 115
|
||||||
msg:
|
msg:
|
||||||
description: A short message
|
description: A short message.
|
||||||
returned: always
|
returned: always
|
||||||
type: str
|
type: str
|
||||||
sample: "Nic net0 unchanged on VM with vmid 103"
|
sample: "Nic net0 unchanged on VM with vmid 103"
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible)
|
from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible)
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_node_info
|
module: proxmox_node_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE nodes
|
short_description: Retrieve information about one or more Proxmox VE nodes
|
||||||
version_added: 8.2.0
|
version_added: 8.2.0
|
||||||
|
@ -25,10 +24,10 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List existing nodes
|
- name: List existing nodes
|
||||||
community.general.proxmox_node_info:
|
community.general.proxmox_node_info:
|
||||||
api_host: proxmox1
|
api_host: proxmox1
|
||||||
|
@ -37,10 +36,10 @@ EXAMPLES = '''
|
||||||
api_token_id: "{{ token_id | default(omit) }}"
|
api_token_id: "{{ token_id | default(omit) }}"
|
||||||
api_token_secret: "{{ token_secret | default(omit) }}"
|
api_token_secret: "{{ token_secret | default(omit) }}"
|
||||||
register: proxmox_nodes
|
register: proxmox_nodes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
proxmox_nodes:
|
proxmox_nodes:
|
||||||
description: List of Proxmox VE nodes.
|
description: List of Proxmox VE nodes.
|
||||||
returned: always, but can be empty
|
returned: always, but can be empty
|
||||||
|
@ -99,7 +98,7 @@ proxmox_nodes:
|
||||||
description: Node uptime in seconds.
|
description: Node uptime in seconds.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: int
|
type: int
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
|
@ -8,7 +8,6 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r"""
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_pool
|
module: proxmox_pool
|
||||||
short_description: Pool management for Proxmox VE cluster
|
short_description: Pool management for Proxmox VE cluster
|
||||||
description:
|
description:
|
||||||
|
@ -49,7 +48,7 @@ extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = r"""
|
||||||
- name: Create new Proxmox VE pool
|
- name: Create new Proxmox VE pool
|
||||||
community.general.proxmox_pool:
|
community.general.proxmox_pool:
|
||||||
api_host: node1
|
api_host: node1
|
||||||
|
@ -67,7 +66,7 @@ EXAMPLES = """
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = r"""
|
||||||
poolid:
|
poolid:
|
||||||
description: The pool ID.
|
description: The pool ID.
|
||||||
returned: success
|
returned: success
|
||||||
|
|
|
@ -8,7 +8,6 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r"""
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_pool_member
|
module: proxmox_pool_member
|
||||||
short_description: Add or delete members from Proxmox VE cluster pools
|
short_description: Add or delete members from Proxmox VE cluster pools
|
||||||
description:
|
description:
|
||||||
|
@ -55,7 +54,7 @@ extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = r"""
|
||||||
- name: Add new VM to Proxmox VE pool
|
- name: Add new VM to Proxmox VE pool
|
||||||
community.general.proxmox_pool_member:
|
community.general.proxmox_pool_member:
|
||||||
api_host: node1
|
api_host: node1
|
||||||
|
@ -93,7 +92,7 @@ EXAMPLES = """
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = r"""
|
||||||
poolid:
|
poolid:
|
||||||
description: The pool ID.
|
description: The pool ID.
|
||||||
returned: success
|
returned: success
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_snap
|
module: proxmox_snap
|
||||||
short_description: Snapshot management of instances in Proxmox VE cluster
|
short_description: Snapshot management of instances in Proxmox VE cluster
|
||||||
version_added: 2.0.0
|
version_added: 2.0.0
|
||||||
|
@ -51,7 +50,8 @@ options:
|
||||||
- Allows to snapshot a container even if it has configured mountpoints.
|
- Allows to snapshot a container even if it has configured mountpoints.
|
||||||
- Temporarily disables all configured mountpoints, takes snapshot, and finally restores original configuration.
|
- Temporarily disables all configured mountpoints, takes snapshot, and finally restores original configuration.
|
||||||
- If running, the container will be stopped and restarted to apply config changes.
|
- If running, the container will be stopped and restarted to apply config changes.
|
||||||
- Due to restrictions in the Proxmox API this option can only be used authenticating as V(root@pam) with O(api_password), API tokens do not work either.
|
- Due to restrictions in the Proxmox API this option can only be used authenticating as V(root@pam) with O(api_password), API tokens do
|
||||||
|
not work either.
|
||||||
- See U(https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc/{vmid}/config) (PUT tab) for more details.
|
- See U(https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc/{vmid}/config) (PUT tab) for more details.
|
||||||
default: false
|
default: false
|
||||||
type: bool
|
type: bool
|
||||||
|
@ -80,8 +80,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- Remove old snapshots if there are more than O(retention) snapshots.
|
- Remove old snapshots if there are more than O(retention) snapshots.
|
||||||
- If O(retention) is set to V(0), all snapshots will be kept.
|
- If O(retention) is set to V(0), all snapshots will be kept.
|
||||||
- This is only used when O(state=present) and when an actual snapshot is created.
|
- This is only used when O(state=present) and when an actual snapshot is created. If no snapshot is created, all existing snapshots will
|
||||||
If no snapshot is created, all existing snapshots will be kept.
|
be kept.
|
||||||
default: 0
|
default: 0
|
||||||
type: int
|
type: int
|
||||||
version_added: 7.1.0
|
version_added: 7.1.0
|
||||||
|
@ -94,9 +94,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.actiongroup_proxmox
|
- community.general.proxmox.actiongroup_proxmox
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r"""
|
||||||
- name: Create new container snapshot
|
- name: Create new container snapshot
|
||||||
community.general.proxmox_snap:
|
community.general.proxmox_snap:
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
|
@ -143,9 +143,9 @@ EXAMPLES = r'''
|
||||||
vmid: 100
|
vmid: 100
|
||||||
state: rollback
|
state: rollback
|
||||||
snapname: pre-updates
|
snapname: pre-updates
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = r'''#'''
|
RETURN = r"""#"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = """
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_storage_contents_info
|
module: proxmox_storage_contents_info
|
||||||
short_description: List content from a Proxmox VE storage
|
short_description: List content from a Proxmox VE storage
|
||||||
version_added: 8.2.0
|
version_added: 8.2.0
|
||||||
|
@ -51,7 +50,7 @@ extends_documentation_fragment:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = r"""
|
||||||
- name: List existing storages
|
- name: List existing storages
|
||||||
community.general.proxmox_storage_contents_info:
|
community.general.proxmox_storage_contents_info:
|
||||||
api_host: helldorado
|
api_host: helldorado
|
||||||
|
@ -65,7 +64,7 @@ EXAMPLES = """
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = """
|
RETURN = r"""
|
||||||
proxmox_storage_content:
|
proxmox_storage_content:
|
||||||
description: Content of of storage attached to a node.
|
description: Content of of storage attached to a node.
|
||||||
type: list
|
type: list
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_storage_info
|
module: proxmox_storage_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE storages
|
short_description: Retrieve information about one or more Proxmox VE storages
|
||||||
version_added: 2.2.0
|
version_added: 2.2.0
|
||||||
|
@ -37,10 +36,10 @@ extends_documentation_fragment:
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
notes:
|
notes:
|
||||||
- Storage specific options can be returned by this module, please look at the documentation at U(https://pve.proxmox.com/wiki/Storage).
|
- Storage specific options can be returned by this module, please look at the documentation at U(https://pve.proxmox.com/wiki/Storage).
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List existing storages
|
- name: List existing storages
|
||||||
community.general.proxmox_storage_info:
|
community.general.proxmox_storage_info:
|
||||||
api_host: helldorado
|
api_host: helldorado
|
||||||
|
@ -69,10 +68,10 @@ EXAMPLES = '''
|
||||||
api_token_secret: "{{ token_secret | default(omit) }}"
|
api_token_secret: "{{ token_secret | default(omit) }}"
|
||||||
storage: lvm2
|
storage: lvm2
|
||||||
register: proxmox_storage_lvm
|
register: proxmox_storage_lvm
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
proxmox_storages:
|
proxmox_storages:
|
||||||
description: List of storage pools.
|
description: List of storage pools.
|
||||||
returned: on success
|
returned: on success
|
||||||
|
@ -80,41 +79,41 @@ proxmox_storages:
|
||||||
elements: dict
|
elements: dict
|
||||||
contains:
|
contains:
|
||||||
content:
|
content:
|
||||||
description: Proxmox content types available in this storage
|
description: Proxmox content types available in this storage.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
digest:
|
digest:
|
||||||
description: Storage's digest
|
description: Storage's digest.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: str
|
type: str
|
||||||
nodes:
|
nodes:
|
||||||
description: List of nodes associated to this storage
|
description: List of nodes associated to this storage.
|
||||||
returned: on success, if storage is not local
|
returned: on success, if storage is not local
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
path:
|
path:
|
||||||
description: Physical path to this storage
|
description: Physical path to this storage.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: str
|
type: str
|
||||||
prune-backups:
|
prune-backups:
|
||||||
description: Backup retention options
|
description: Backup retention options.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: dict
|
||||||
shared:
|
shared:
|
||||||
description: Is this storage shared
|
description: Is this storage shared.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: bool
|
type: bool
|
||||||
storage:
|
storage:
|
||||||
description: Storage name
|
description: Storage name.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: str
|
type: str
|
||||||
type:
|
type:
|
||||||
description: Storage type
|
description: Storage type.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: str
|
type: str
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_tasks_info
|
module: proxmox_tasks_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE tasks
|
short_description: Retrieve information about one or more Proxmox VE tasks
|
||||||
version_added: 3.8.0
|
version_added: 3.8.0
|
||||||
|
@ -36,10 +35,10 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List tasks on node01
|
- name: List tasks on node01
|
||||||
community.general.proxmox_tasks_info:
|
community.general.proxmox_tasks_info:
|
||||||
api_host: proxmoxhost
|
api_host: proxmoxhost
|
||||||
|
@ -60,10 +59,10 @@ EXAMPLES = '''
|
||||||
task: 'UPID:node01:00003263:16167ACE:621EE230:srvreload:networking:root@pam:'
|
task: 'UPID:node01:00003263:16167ACE:621EE230:srvreload:networking:root@pam:'
|
||||||
node: node01
|
node: node01
|
||||||
register: proxmox_tasks
|
register: proxmox_tasks
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
proxmox_tasks:
|
proxmox_tasks:
|
||||||
description: List of tasks.
|
description: List of tasks.
|
||||||
returned: on success
|
returned: on success
|
||||||
|
@ -83,7 +82,7 @@ proxmox_tasks:
|
||||||
returned: on success
|
returned: on success
|
||||||
type: int
|
type: int
|
||||||
pstart:
|
pstart:
|
||||||
description: pastart of the task.
|
description: Pastart of the task.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: int
|
type: int
|
||||||
starttime:
|
starttime:
|
||||||
|
@ -119,7 +118,7 @@ msg:
|
||||||
returned: on failure
|
returned: on failure
|
||||||
type: str
|
type: str
|
||||||
sample: 'Task: UPID:xyz:xyz does not exist on node: proxmoxnode'
|
sample: 'Task: UPID:xyz:xyz does not exist on node: proxmoxnode'
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.proxmox import (
|
from ansible_collections.community.general.plugins.module_utils.proxmox import (
|
||||||
|
|
|
@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_template
|
module: proxmox_template
|
||||||
short_description: Management of OS templates in Proxmox VE cluster
|
short_description: Management of OS templates in Proxmox VE cluster
|
||||||
description:
|
description:
|
||||||
- allows you to upload/delete templates in Proxmox VE cluster
|
- Allows you to upload/delete templates in Proxmox VE cluster.
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -34,7 +33,7 @@ options:
|
||||||
type: path
|
type: path
|
||||||
url:
|
url:
|
||||||
description:
|
description:
|
||||||
- URL to file to download
|
- URL to file to download.
|
||||||
- Exactly one of O(src) or O(url) is required for O(state=present).
|
- Exactly one of O(src) or O(url) is required for O(state=present).
|
||||||
type: str
|
type: str
|
||||||
version_added: 10.1.0
|
version_added: 10.1.0
|
||||||
|
@ -80,9 +79,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.actiongroup_proxmox
|
- community.general.proxmox.actiongroup_proxmox
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Upload new openvz template with minimal options
|
- name: Upload new openvz template with minimal options
|
||||||
community.general.proxmox_template:
|
community.general.proxmox_template:
|
||||||
node: uk-mc02
|
node: uk-mc02
|
||||||
|
@ -148,7 +147,7 @@ EXAMPLES = '''
|
||||||
storage: local
|
storage: local
|
||||||
content_type: vztmpl
|
content_type: vztmpl
|
||||||
template: ubuntu-20.04-standard_20.04-1_amd64.tar.gz
|
template: ubuntu-20.04-standard_20.04-1_amd64.tar.gz
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -9,13 +9,12 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_user_info
|
module: proxmox_user_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE users
|
short_description: Retrieve information about one or more Proxmox VE users
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
description:
|
description:
|
||||||
- Retrieve information about one or more Proxmox VE users
|
- Retrieve information about one or more Proxmox VE users.
|
||||||
attributes:
|
attributes:
|
||||||
action_group:
|
action_group:
|
||||||
version_added: 9.0.0
|
version_added: 9.0.0
|
||||||
|
@ -40,9 +39,9 @@ extends_documentation_fragment:
|
||||||
- community.general.proxmox.documentation
|
- community.general.proxmox.documentation
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List existing users
|
- name: List existing users
|
||||||
community.general.proxmox_user_info:
|
community.general.proxmox_user_info:
|
||||||
api_host: helldorado
|
api_host: helldorado
|
||||||
|
@ -82,10 +81,10 @@ EXAMPLES = '''
|
||||||
user: admin
|
user: admin
|
||||||
domain: pve
|
domain: pve
|
||||||
register: proxmox_user_admin
|
register: proxmox_user_admin
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
proxmox_users:
|
proxmox_users:
|
||||||
description: List of users.
|
description: List of users.
|
||||||
returned: always, but can be empty
|
returned: always, but can be empty
|
||||||
|
@ -159,7 +158,7 @@ proxmox_users:
|
||||||
description: Proxmox user ID, represented as user@realm.
|
description: Proxmox user ID, represented as user@realm.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: str
|
type: str
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = """
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: proxmox_vm_info
|
module: proxmox_vm_info
|
||||||
short_description: Retrieve information about one or more Proxmox VE virtual machines
|
short_description: Retrieve information about one or more Proxmox VE virtual machines
|
||||||
version_added: 7.2.0
|
version_added: 7.2.0
|
||||||
|
@ -71,7 +70,7 @@ extends_documentation_fragment:
|
||||||
- community.general.attributes.info_module
|
- community.general.attributes.info_module
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = r"""
|
||||||
- name: List all existing virtual machines on node
|
- name: List all existing virtual machines on node
|
||||||
community.general.proxmox_vm_info:
|
community.general.proxmox_vm_info:
|
||||||
api_host: proxmoxhost
|
api_host: proxmoxhost
|
||||||
|
@ -108,7 +107,7 @@ EXAMPLES = """
|
||||||
config: current
|
config: current
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = r"""
|
||||||
proxmox_vms:
|
proxmox_vms:
|
||||||
description: List of virtual machines.
|
description: List of virtual machines.
|
||||||
returned: on success
|
returned: on success
|
||||||
|
|
|
@ -14,15 +14,12 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: pubnub_blocks
|
module: pubnub_blocks
|
||||||
short_description: PubNub blocks management module
|
short_description: PubNub blocks management module
|
||||||
description:
|
description:
|
||||||
- "This module allows Ansible to interface with the PubNub BLOCKS
|
- 'This module allows Ansible to interface with the PubNub BLOCKS infrastructure by providing the following operations: create / remove, start
|
||||||
infrastructure by providing the following operations: create / remove,
|
/ stop and rename for blocks and create / modify / remove for event handlers.'
|
||||||
start / stop and rename for blocks and create / modify / remove for event
|
|
||||||
handlers."
|
|
||||||
author:
|
author:
|
||||||
- PubNub <support@pubnub.com> (@pubnub)
|
- PubNub <support@pubnub.com> (@pubnub)
|
||||||
- Sergey Mamontov <sergey@pubnub.com> (@parfeon)
|
- Sergey Mamontov <sergey@pubnub.com> (@parfeon)
|
||||||
|
@ -39,38 +36,33 @@ options:
|
||||||
email:
|
email:
|
||||||
description:
|
description:
|
||||||
- Email from account for which new session should be started.
|
- Email from account for which new session should be started.
|
||||||
- "Not required if O(cache) contains result of previous module call (in
|
- Not required if O(cache) contains result of previous module call (in same play).
|
||||||
same play)."
|
|
||||||
required: false
|
required: false
|
||||||
type: str
|
type: str
|
||||||
default: ''
|
default: ''
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password which match to account to which specified O(email) belong.
|
- Password which match to account to which specified O(email) belong.
|
||||||
- "Not required if O(cache) contains result of previous module call (in
|
- Not required if O(cache) contains result of previous module call (in same play).
|
||||||
same play)."
|
|
||||||
required: false
|
required: false
|
||||||
type: str
|
type: str
|
||||||
default: ''
|
default: ''
|
||||||
cache:
|
cache:
|
||||||
description: >
|
description: >-
|
||||||
In case if single play use blocks management module few times it is
|
In case if single play use blocks management module few times it is preferred to enabled 'caching' by making previous module to share gathered
|
||||||
preferred to enabled 'caching' by making previous module to share
|
artifacts and pass them to this parameter.
|
||||||
gathered artifacts and pass them to this parameter.
|
|
||||||
required: false
|
required: false
|
||||||
type: dict
|
type: dict
|
||||||
default: {}
|
default: {}
|
||||||
account:
|
account:
|
||||||
description:
|
description:
|
||||||
- "Name of PubNub account for from which O(application) will be used to
|
- Name of PubNub account for from which O(application) will be used to manage blocks.
|
||||||
manage blocks."
|
- User's account will be used if value not set or empty.
|
||||||
- "User's account will be used if value not set or empty."
|
|
||||||
type: str
|
type: str
|
||||||
default: ''
|
default: ''
|
||||||
application:
|
application:
|
||||||
description:
|
description:
|
||||||
- "Name of target PubNub application for which blocks configuration on
|
- Name of target PubNub application for which blocks configuration on specific O(keyset) will be done.
|
||||||
specific O(keyset) will be done."
|
|
||||||
type: str
|
type: str
|
||||||
required: true
|
required: true
|
||||||
keyset:
|
keyset:
|
||||||
|
@ -80,8 +72,7 @@ options:
|
||||||
required: true
|
required: true
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- "Intended block state after event handlers creation / update process
|
- Intended block state after event handlers creation / update process will be completed.
|
||||||
will be completed."
|
|
||||||
required: false
|
required: false
|
||||||
default: 'present'
|
default: 'present'
|
||||||
choices: ['started', 'stopped', 'present', 'absent']
|
choices: ['started', 'stopped', 'present', 'absent']
|
||||||
|
@ -93,55 +84,45 @@ options:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- Short block description which will be later visible on
|
- Short block description which will be later visible on admin.pubnub.com. Used only if block doesn't exists and won't change description
|
||||||
admin.pubnub.com. Used only if block doesn't exists and won't change
|
for existing block.
|
||||||
description for existing block.
|
|
||||||
required: false
|
required: false
|
||||||
type: str
|
type: str
|
||||||
event_handlers:
|
event_handlers:
|
||||||
description:
|
description:
|
||||||
- "List of event handlers which should be updated for specified block
|
- List of event handlers which should be updated for specified block O(name).
|
||||||
O(name)."
|
- 'Each entry for new event handler should contain: V(name), V(src), V(channels), V(event). V(name) used as event handler name which can
|
||||||
- "Each entry for new event handler should contain: C(name), C(src),
|
be used later to make changes to it.'
|
||||||
C(channels), C(event). C(name) used as event handler name which can be
|
|
||||||
used later to make changes to it."
|
|
||||||
- C(src) is full path to file with event handler code.
|
- C(src) is full path to file with event handler code.
|
||||||
- "C(channels) is name of channel from which event handler is waiting
|
- V(channels) is name of channel from which event handler is waiting for events.
|
||||||
for events."
|
- 'V(event) is type of event which is able to trigger event handler: V(js-before-publish), V(js-after-publish), V(js-after-presence).'
|
||||||
- "C(event) is type of event which is able to trigger event handler:
|
- Each entry for existing handlers should contain C(name) (so target handler can be identified). Rest parameters (C(src), C(channels) and
|
||||||
C(js-before-publish), C(js-after-publish), C(js-after-presence)."
|
C(event)) can be added if changes required for them.
|
||||||
- "Each entry for existing handlers should contain C(name) (so target
|
- It is possible to rename event handler by adding C(changes) key to event handler payload and pass dictionary, which will contain single
|
||||||
handler can be identified). Rest parameters (C(src), C(channels) and
|
key C(name), where new name should be passed.
|
||||||
C(event)) can be added if changes required for them."
|
- To remove particular event handler it is possible to set C(state) for it to C(absent) and it will be removed.
|
||||||
- "It is possible to rename event handler by adding C(changes) key to
|
|
||||||
event handler payload and pass dictionary, which will contain single key
|
|
||||||
C(name), where new name should be passed."
|
|
||||||
- "To remove particular event handler it is possible to set C(state) for
|
|
||||||
it to C(absent) and it will be removed."
|
|
||||||
required: false
|
required: false
|
||||||
default: []
|
default: []
|
||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: dict
|
||||||
changes:
|
changes:
|
||||||
description:
|
description:
|
||||||
- "List of fields which should be changed by block itself (doesn't
|
- List of fields which should be changed by block itself (does not affect any event handlers).
|
||||||
affect any event handlers)."
|
- 'Possible options for change is: O(name).'
|
||||||
- "Possible options for change is: O(name)."
|
|
||||||
required: false
|
required: false
|
||||||
default: {}
|
default: {}
|
||||||
type: dict
|
type: dict
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description:
|
description:
|
||||||
- "This key allow to try skip certificates check when performing REST API
|
- This key allow to try skip certificates check when performing REST API calls. Sometimes host may have issues with certificates on it and
|
||||||
calls. Sometimes host may have issues with certificates on it and this
|
this will cause problems to call PubNub REST API.
|
||||||
will cause problems to call PubNub REST API."
|
|
||||||
- If check should be ignored V(false) should be passed to this parameter.
|
- If check should be ignored V(false) should be passed to this parameter.
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
type: bool
|
type: bool
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
# Event handler create example.
|
# Event handler create example.
|
||||||
- name: Create single event handler
|
- name: Create single event handler
|
||||||
community.general.pubnub_blocks:
|
community.general.pubnub_blocks:
|
||||||
|
@ -151,8 +132,7 @@ EXAMPLES = '''
|
||||||
keyset: '{{ keyset_name }}'
|
keyset: '{{ keyset_name }}'
|
||||||
name: '{{ block_name }}'
|
name: '{{ block_name }}'
|
||||||
event_handlers:
|
event_handlers:
|
||||||
-
|
- src: '{{ path_to_handler_source }}'
|
||||||
src: '{{ path_to_handler_source }}'
|
|
||||||
name: '{{ handler_name }}'
|
name: '{{ handler_name }}'
|
||||||
event: 'js-before-publish'
|
event: 'js-before-publish'
|
||||||
channels: '{{ handler_channel }}'
|
channels: '{{ handler_channel }}'
|
||||||
|
@ -166,8 +146,7 @@ EXAMPLES = '''
|
||||||
keyset: '{{ keyset_name }}'
|
keyset: '{{ keyset_name }}'
|
||||||
name: '{{ block_name }}'
|
name: '{{ block_name }}'
|
||||||
event_handlers:
|
event_handlers:
|
||||||
-
|
- name: '{{ handler_name }}'
|
||||||
name: '{{ handler_name }}'
|
|
||||||
event: 'js-after-publish'
|
event: 'js-after-publish'
|
||||||
|
|
||||||
# Stop block and event handlers.
|
# Stop block and event handlers.
|
||||||
|
@ -199,8 +178,7 @@ EXAMPLES = '''
|
||||||
name: '{{ block_name }}'
|
name: '{{ block_name }}'
|
||||||
state: present
|
state: present
|
||||||
event_handlers:
|
event_handlers:
|
||||||
-
|
- src: '{{ path_to_handler_1_source }}'
|
||||||
src: '{{ path_to_handler_1_source }}'
|
|
||||||
name: '{{ event_handler_1_name }}'
|
name: '{{ event_handler_1_name }}'
|
||||||
channels: '{{ event_handler_1_channel }}'
|
channels: '{{ event_handler_1_channel }}'
|
||||||
event: 'js-before-publish'
|
event: 'js-before-publish'
|
||||||
|
@ -213,8 +191,7 @@ EXAMPLES = '''
|
||||||
name: '{{ block_name }}'
|
name: '{{ block_name }}'
|
||||||
state: present
|
state: present
|
||||||
event_handlers:
|
event_handlers:
|
||||||
-
|
- src: '{{ path_to_handler_2_source }}'
|
||||||
src: '{{ path_to_handler_2_source }}'
|
|
||||||
name: '{{ event_handler_2_name }}'
|
name: '{{ event_handler_2_name }}'
|
||||||
channels: '{{ event_handler_2_channel }}'
|
channels: '{{ event_handler_2_channel }}'
|
||||||
event: 'js-before-publish'
|
event: 'js-before-publish'
|
||||||
|
@ -226,17 +203,16 @@ EXAMPLES = '''
|
||||||
keyset: '{{ keyset_name }}'
|
keyset: '{{ keyset_name }}'
|
||||||
name: '{{ block_name }}'
|
name: '{{ block_name }}'
|
||||||
state: started
|
state: started
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
module_cache:
|
module_cache:
|
||||||
description:
|
description:
|
||||||
- Cached account information. In case if with single play module
|
- Cached account information. In case if with single play module used few times it is better to pass cached data to next module calls to speed
|
||||||
used few times it is better to pass cached data to next module calls to speed
|
|
||||||
up process.
|
up process.
|
||||||
type: dict
|
type: dict
|
||||||
returned: always
|
returned: always
|
||||||
'''
|
"""
|
||||||
import copy
|
import copy
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: pulp_repo
|
module: pulp_repo
|
||||||
author: "Joe Adams (@sysadmind)"
|
author: "Joe Adams (@sysadmind)"
|
||||||
short_description: Add or remove Pulp repos from a remote host
|
short_description: Add or remove Pulp repos from a remote host
|
||||||
|
@ -35,41 +34,33 @@ options:
|
||||||
type: str
|
type: str
|
||||||
force_basic_auth:
|
force_basic_auth:
|
||||||
description:
|
description:
|
||||||
- httplib2, the library used by the M(ansible.builtin.uri) module only sends
|
- C(httplib2), the library used by the M(ansible.builtin.uri) module only sends authentication information when a webservice responds to an
|
||||||
authentication information when a webservice responds to an initial
|
initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail. This option forces the
|
||||||
request with a 401 status. Since some basic auth services do not
|
sending of the Basic authentication header upon initial request.
|
||||||
properly send a 401, logins will fail. This option forces the sending of
|
|
||||||
the Basic authentication header upon initial request.
|
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
generate_sqlite:
|
generate_sqlite:
|
||||||
description:
|
description:
|
||||||
- Boolean flag to indicate whether sqlite files should be generated during
|
- Boolean flag to indicate whether sqlite files should be generated during a repository publish.
|
||||||
a repository publish.
|
|
||||||
required: false
|
required: false
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
feed_ca_cert:
|
feed_ca_cert:
|
||||||
description:
|
description:
|
||||||
- CA certificate string used to validate the feed source SSL certificate.
|
- CA certificate string used to validate the feed source SSL certificate. This can be the file content or the path to the file.
|
||||||
This can be the file content or the path to the file.
|
|
||||||
type: str
|
type: str
|
||||||
aliases: [importer_ssl_ca_cert]
|
aliases: [importer_ssl_ca_cert]
|
||||||
feed_client_cert:
|
feed_client_cert:
|
||||||
description:
|
description:
|
||||||
- Certificate used as the client certificate when synchronizing the
|
- Certificate used as the client certificate when synchronizing the repository. This is used to communicate authentication information to
|
||||||
repository. This is used to communicate authentication information to
|
the feed source. The value to this option must be the full path to the certificate. The specified file may be the certificate itself or
|
||||||
the feed source. The value to this option must be the full path to the
|
a single file containing both the certificate and private key. This can be the file content or the path to the file.
|
||||||
certificate. The specified file may be the certificate itself or a
|
|
||||||
single file containing both the certificate and private key. This can be
|
|
||||||
the file content or the path to the file.
|
|
||||||
type: str
|
type: str
|
||||||
aliases: [importer_ssl_client_cert]
|
aliases: [importer_ssl_client_cert]
|
||||||
feed_client_key:
|
feed_client_key:
|
||||||
description:
|
description:
|
||||||
- Private key to the certificate specified in O(feed_client_cert),
|
- Private key to the certificate specified in O(feed_client_cert), assuming it is not included in the certificate file itself. This can
|
||||||
assuming it is not included in the certificate file itself. This can be
|
be the file content or the path to the file.
|
||||||
the file content or the path to the file.
|
|
||||||
type: str
|
type: str
|
||||||
aliases: [importer_ssl_client_key]
|
aliases: [importer_ssl_client_key]
|
||||||
name:
|
name:
|
||||||
|
@ -80,33 +71,31 @@ options:
|
||||||
aliases: [repo]
|
aliases: [repo]
|
||||||
proxy_host:
|
proxy_host:
|
||||||
description:
|
description:
|
||||||
- Proxy url setting for the pulp repository importer. This is in the
|
- Proxy url setting for the pulp repository importer. This is in the format scheme://host.
|
||||||
format scheme://host.
|
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
type: str
|
type: str
|
||||||
proxy_port:
|
proxy_port:
|
||||||
description:
|
description:
|
||||||
- Proxy port setting for the pulp repository importer.
|
- Proxy port setting for the pulp repository importer.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
type: str
|
type: str
|
||||||
proxy_username:
|
proxy_username:
|
||||||
description:
|
description:
|
||||||
- Proxy username for the pulp repository importer.
|
- Proxy username for the pulp repository importer.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
type: str
|
type: str
|
||||||
proxy_password:
|
proxy_password:
|
||||||
description:
|
description:
|
||||||
- Proxy password for the pulp repository importer.
|
- Proxy password for the pulp repository importer.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
type: str
|
type: str
|
||||||
publish_distributor:
|
publish_distributor:
|
||||||
description:
|
description:
|
||||||
- Distributor to use when O(state=publish). The default is to
|
- Distributor to use when O(state=publish). The default is to publish all distributors.
|
||||||
publish all distributors.
|
|
||||||
type: str
|
type: str
|
||||||
pulp_host:
|
pulp_host:
|
||||||
description:
|
description:
|
||||||
|
@ -124,8 +113,7 @@ options:
|
||||||
type: str
|
type: str
|
||||||
repoview:
|
repoview:
|
||||||
description:
|
description:
|
||||||
- Whether to generate repoview files for a published repository. Setting
|
- Whether to generate repoview files for a published repository. Setting this to V(true) automatically activates O(generate_sqlite).
|
||||||
this to V(true) automatically activates O(generate_sqlite).
|
|
||||||
required: false
|
required: false
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
|
@ -141,24 +129,21 @@ options:
|
||||||
default: true
|
default: true
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- The repo state. A state of V(sync) will queue a sync of the repo.
|
- The repo state. A state of V(sync) will queue a sync of the repo. This is asynchronous but not delayed like a scheduled sync. A state
|
||||||
This is asynchronous but not delayed like a scheduled sync. A state of
|
of V(publish) will use the repository's distributor to publish the content.
|
||||||
V(publish) will use the repository's distributor to publish the content.
|
|
||||||
default: present
|
default: present
|
||||||
choices: ["present", "absent", "sync", "publish"]
|
choices: ["present", "absent", "sync", "publish"]
|
||||||
type: str
|
type: str
|
||||||
url_password:
|
url_password:
|
||||||
description:
|
description:
|
||||||
- The password for use in HTTP basic authentication to the pulp API.
|
- The password for use in HTTP basic authentication to the pulp API. If the O(url_username) parameter is not specified, the O(url_password)
|
||||||
If the O(url_username) parameter is not specified, the O(url_password)
|
|
||||||
parameter will not be used.
|
parameter will not be used.
|
||||||
url_username:
|
url_username:
|
||||||
description:
|
description:
|
||||||
- The username for use in HTTP basic authentication to the pulp API.
|
- The username for use in HTTP basic authentication to the pulp API.
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description:
|
description:
|
||||||
- If V(false), SSL certificates will not be validated. This should only be
|
- If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
|
||||||
used on personally controlled sites using self-signed certificates.
|
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
default: true
|
||||||
wait_for_completion:
|
wait_for_completion:
|
||||||
|
@ -167,14 +152,13 @@ options:
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
notes:
|
notes:
|
||||||
- This module can currently only create distributors and importers on rpm
|
- This module can currently only create distributors and importers on rpm repositories. Contributions to support other repo types are welcome.
|
||||||
repositories. Contributions to support other repo types are welcome.
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- ansible.builtin.url
|
- ansible.builtin.url
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create a new repo with name 'my_repo'
|
- name: Create a new repo with name 'my_repo'
|
||||||
community.general.pulp_repo:
|
community.general.pulp_repo:
|
||||||
name: my_repo
|
name: my_repo
|
||||||
|
@ -197,15 +181,15 @@ EXAMPLES = '''
|
||||||
name: my_old_repo
|
name: my_old_repo
|
||||||
repo_type: rpm
|
repo_type: rpm
|
||||||
state: absent
|
state: absent
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
repo:
|
repo:
|
||||||
description: Name of the repo that the action was performed on.
|
description: Name of the repo that the action was performed on.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: my_repo
|
sample: my_repo
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: puppet
|
module: puppet
|
||||||
short_description: Runs puppet
|
short_description: Runs puppet
|
||||||
description:
|
description:
|
||||||
|
@ -94,7 +93,7 @@ options:
|
||||||
type: str
|
type: str
|
||||||
use_srv_records:
|
use_srv_records:
|
||||||
description:
|
description:
|
||||||
- Toggles use_srv_records flag
|
- Toggles use_srv_records flag.
|
||||||
type: bool
|
type: bool
|
||||||
summarize:
|
summarize:
|
||||||
description:
|
description:
|
||||||
|
@ -119,17 +118,17 @@ options:
|
||||||
default: false
|
default: false
|
||||||
show_diff:
|
show_diff:
|
||||||
description:
|
description:
|
||||||
- Whether to print file changes details
|
- Whether to print file changes details.
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
environment_lang:
|
environment_lang:
|
||||||
description:
|
description:
|
||||||
- The lang environment to use when running the puppet agent.
|
- The lang environment to use when running the puppet agent.
|
||||||
- The default value, V(C), is supported on every system, but can lead to encoding errors if UTF-8 is used in the output
|
- The default value, V(C), is supported on every system, but can lead to encoding errors if UTF-8 is used in the output.
|
||||||
- Use V(C.UTF-8) or V(en_US.UTF-8) or similar UTF-8 supporting locales in case of problems. You need to make sure
|
- Use V(C.UTF-8) or V(en_US.UTF-8) or similar UTF-8 supporting locales in case of problems. You need to make sure the selected locale is
|
||||||
the selected locale is supported on the system the puppet agent runs on.
|
supported on the system the puppet agent runs on.
|
||||||
- Starting with community.general 9.1.0, you can use the value V(auto) and the module will
|
- Starting with community.general 9.1.0, you can use the value V(auto) and the module will try and determine the best parseable locale to
|
||||||
try and determine the best parseable locale to use.
|
use.
|
||||||
type: str
|
type: str
|
||||||
default: C
|
default: C
|
||||||
version_added: 8.6.0
|
version_added: 8.6.0
|
||||||
|
@ -137,9 +136,9 @@ requirements:
|
||||||
- puppet
|
- puppet
|
||||||
author:
|
author:
|
||||||
- Monty Taylor (@emonty)
|
- Monty Taylor (@emonty)
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r"""
|
||||||
- name: Run puppet agent and fail if anything goes wrong
|
- name: Run puppet agent and fail if anything goes wrong
|
||||||
community.general.puppet:
|
community.general.puppet:
|
||||||
|
|
||||||
|
@ -184,7 +183,7 @@ EXAMPLES = r'''
|
||||||
modulepath: /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
|
modulepath: /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
|
||||||
logdest: all
|
logdest: all
|
||||||
manifest: /var/lib/example/puppet_step_config.pp
|
manifest: /var/lib/example/puppet_step_config.pp
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
author: "Willy Barro (@willybarro)"
|
author: "Willy Barro (@willybarro)"
|
||||||
requirements: [pushbullet.py]
|
requirements: [pushbullet.py]
|
||||||
module: pushbullet
|
module: pushbullet
|
||||||
short_description: Sends notifications to Pushbullet
|
short_description: Sends notifications to Pushbullet
|
||||||
description:
|
description:
|
||||||
- This module sends push notifications via Pushbullet to channels or devices.
|
- This module sends push notifications through Pushbullet to channels or devices.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -28,19 +27,16 @@ options:
|
||||||
api_key:
|
api_key:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Push bullet API token
|
- Push bullet API token.
|
||||||
required: true
|
required: true
|
||||||
channel:
|
channel:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The channel TAG you wish to broadcast a push notification,
|
- The channel TAG you wish to broadcast a push notification, as seen on the "My Channels" > "Edit your channel" at Pushbullet page.
|
||||||
as seen on the "My Channels" > "Edit your channel" at
|
|
||||||
Pushbullet page.
|
|
||||||
device:
|
device:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The device NAME you wish to send a push notification,
|
- The device NAME you wish to send a push notification, as seen on the Pushbullet main page.
|
||||||
as seen on the Pushbullet main page.
|
|
||||||
push_type:
|
push_type:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -55,19 +51,17 @@ options:
|
||||||
body:
|
body:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Body of the notification, e.g. Details of the fault you're alerting.
|
- Body of the notification, for example details of the fault you are alerting.
|
||||||
url:
|
url:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- URL field, used when O(push_type=link).
|
- URL field, used when O(push_type=link).
|
||||||
|
|
||||||
notes:
|
notes:
|
||||||
- Requires pushbullet.py Python package on the remote host.
|
- Requires C(pushbullet.py) Python package on the remote host. You can install it through C(pip) with C(pip install pushbullet.py).
|
||||||
You can install it via pip with ($ pip install pushbullet.py).
|
- See U(https://github.com/randomchars/pushbullet.py).
|
||||||
See U(https://github.com/randomchars/pushbullet.py)
|
"""
|
||||||
'''
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Sends a push notification to a device
|
- name: Sends a push notification to a device
|
||||||
community.general.pushbullet:
|
community.general.pushbullet:
|
||||||
api_key: "ABC123abc123ABC123abc123ABC123ab"
|
api_key: "ABC123abc123ABC123abc123ABC123ab"
|
||||||
|
@ -94,7 +88,7 @@ EXAMPLES = '''
|
||||||
channel: my-awesome-channel
|
channel: my-awesome-channel
|
||||||
title: ALERT! Signup service is down
|
title: ALERT! Signup service is down
|
||||||
body: Error rate on signup service is over 90% for more than 2 minutes
|
body: Error rate on signup service is over 90% for more than 2 minutes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
|
@ -9,16 +9,13 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: pushover
|
module: pushover
|
||||||
short_description: Send notifications via U(https://pushover.net)
|
short_description: Send notifications through U(https://pushover.net)
|
||||||
description:
|
description:
|
||||||
- Send notifications via pushover, to subscriber list of devices, and email
|
- Send notifications through pushover to subscriber list of devices and email addresses. Requires pushover app on devices.
|
||||||
addresses. Requires pushover app on devices.
|
|
||||||
notes:
|
notes:
|
||||||
- You will require a pushover.net account to use this module. But no account
|
- You will require a pushover.net account to use this module. But no account is required to receive messages.
|
||||||
is required to receive messages.
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -64,9 +61,9 @@ options:
|
||||||
author:
|
author:
|
||||||
- "Jim Richardson (@weaselkeeper)"
|
- "Jim Richardson (@weaselkeeper)"
|
||||||
- "Bernd Arnold (@wopfel)"
|
- "Bernd Arnold (@wopfel)"
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Send notifications via pushover.net
|
- name: Send notifications via pushover.net
|
||||||
community.general.pushover:
|
community.general.pushover:
|
||||||
msg: '{{ inventory_hostname }} is acting strange ...'
|
msg: '{{ inventory_hostname }} is acting strange ...'
|
||||||
|
@ -90,7 +87,7 @@ EXAMPLES = '''
|
||||||
user_key: baa5fe97f2c5ab3ca8f0bb59
|
user_key: baa5fe97f2c5ab3ca8f0bb59
|
||||||
device: admins-iPhone
|
device: admins-iPhone
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
module: python_requirements_info
|
module: python_requirements_info
|
||||||
short_description: Show python path and assert dependency versions
|
short_description: Show python path and assert dependency versions
|
||||||
description:
|
description:
|
||||||
|
@ -19,18 +19,17 @@ options:
|
||||||
dependencies:
|
dependencies:
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
description: >
|
description:
|
||||||
A list of version-likes or module names to check for installation.
|
- 'A list of version-likes or module names to check for installation. Supported operators: C(<), C(>), C(<=), C(>=), or C(==).'
|
||||||
Supported operators: <, >, <=, >=, or ==. The bare module name like
|
- The bare module name like V(ansible), the module with a specific version like V(boto3==1.6.1),
|
||||||
V(ansible), the module with a specific version like V(boto3==1.6.1), or a
|
or a partial version like V(requests>2) are all valid specifications.
|
||||||
partial version like V(requests>2) are all valid specifications.
|
|
||||||
default: []
|
default: []
|
||||||
author:
|
author:
|
||||||
- Will Thames (@willthames)
|
- Will Thames (@willthames)
|
||||||
- Ryan Scott Brown (@ryansb)
|
- Ryan Scott Brown (@ryansb)
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Show python lib/site paths
|
- name: Show python lib/site paths
|
||||||
community.general.python_requirements_info:
|
community.general.python_requirements_info:
|
||||||
|
|
||||||
|
@ -39,21 +38,21 @@ EXAMPLES = '''
|
||||||
dependencies:
|
dependencies:
|
||||||
- boto3>1.6
|
- boto3>1.6
|
||||||
- botocore<2
|
- botocore<2
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
python:
|
python:
|
||||||
description: path to python version used
|
description: Path to the Python interpreter used.
|
||||||
returned: always
|
returned: always
|
||||||
type: str
|
type: str
|
||||||
sample: /usr/local/opt/python@2/bin/python2.7
|
sample: /usr/local/opt/python@2/bin/python2.7
|
||||||
python_version:
|
python_version:
|
||||||
description: version of python
|
description: Version of Python.
|
||||||
returned: always
|
returned: always
|
||||||
type: str
|
type: str
|
||||||
sample: "2.7.15 (default, May 1 2018, 16:44:08)\n[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]"
|
sample: "2.7.15 (default, May 1 2018, 16:44:08)\n[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]"
|
||||||
python_version_info:
|
python_version_info:
|
||||||
description: breakdown version of python
|
description: Breakdown version of Python.
|
||||||
returned: always
|
returned: always
|
||||||
type: dict
|
type: dict
|
||||||
contains:
|
contains:
|
||||||
|
@ -84,25 +83,26 @@ python_version_info:
|
||||||
sample: 0
|
sample: 0
|
||||||
version_added: 4.2.0
|
version_added: 4.2.0
|
||||||
python_system_path:
|
python_system_path:
|
||||||
description: List of paths python is looking for modules in
|
description: List of paths Python is looking for modules in.
|
||||||
returned: always
|
returned: always
|
||||||
type: list
|
type: list
|
||||||
sample:
|
sample:
|
||||||
- /usr/local/opt/python@2/site-packages/
|
- /usr/local/opt/python@2/site-packages/
|
||||||
- /usr/lib/python/site-packages/
|
- /usr/lib/python/site-packages/
|
||||||
valid:
|
valid:
|
||||||
description: A dictionary of dependencies that matched their desired versions. If no version was specified, then RV(ignore:desired) will be null
|
description: A dictionary of dependencies that matched their desired versions. If no version was specified, then RV(ignore:desired) will be
|
||||||
|
null.
|
||||||
returned: always
|
returned: always
|
||||||
type: dict
|
type: dict
|
||||||
sample:
|
sample:
|
||||||
boto3:
|
boto3:
|
||||||
desired: null
|
desired:
|
||||||
installed: 1.7.60
|
installed: 1.7.60
|
||||||
botocore:
|
botocore:
|
||||||
desired: botocore<2
|
desired: botocore<2
|
||||||
installed: 1.10.60
|
installed: 1.10.60
|
||||||
mismatched:
|
mismatched:
|
||||||
description: A dictionary of dependencies that did not satisfy the desired version
|
description: A dictionary of dependencies that did not satisfy the desired version.
|
||||||
returned: always
|
returned: always
|
||||||
type: dict
|
type: dict
|
||||||
sample:
|
sample:
|
||||||
|
@ -110,13 +110,13 @@ mismatched:
|
||||||
desired: botocore>2
|
desired: botocore>2
|
||||||
installed: 1.10.60
|
installed: 1.10.60
|
||||||
not_found:
|
not_found:
|
||||||
description: A list of packages that could not be imported at all, and are not installed
|
description: A list of packages that could not be imported at all, and are not installed.
|
||||||
returned: always
|
returned: always
|
||||||
type: list
|
type: list
|
||||||
sample:
|
sample:
|
||||||
- boto4
|
- boto4
|
||||||
- requests
|
- requests
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
Loading…
Reference in New Issue