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

Remove deprecated options, aliases and defaults (#3461)

* Remove deprecated options, aliases and defaults.

* Add changelog fragment.

* Small fixes.

* Apply suggestions from code review

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Lint.

* Update plugins/modules/system/xfconf.py

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Bump galaxy version to 4.0.0.

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2021-10-12 13:56:15 +02:00 committed by GitHub
parent 7038812465
commit 9546bbb55e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 68 additions and 194 deletions

View file

@ -0,0 +1,9 @@
removed_features:
- "ModuleHelper module utils - remove fallback when value could not be determined for a parameter (https://github.com/ansible-collections/community.general/pull/3461)."
- "proxmox - default value of ``proxmox_default_behavior`` changed to ``no_defaults`` (https://github.com/ansible-collections/community.general/pull/3461)."
- "proxmox_kvm - default value of ``proxmox_default_behavior`` changed to ``no_defaults`` (https://github.com/ansible-collections/community.general/pull/3461)."
- "grove - removed the deprecated alias ``message`` of the ``message_content`` option (https://github.com/ansible-collections/community.general/pull/3461)."
- "telegram - removed the deprecated ``msg``, ``msg_format`` and ``chat_id`` options (https://github.com/ansible-collections/community.general/pull/3461)."
- "cpanm - removed the deprecated ``system_lib`` option. Use Ansible's privilege escalation mechanism instead; the option basically used ``sudo`` (https://github.com/ansible-collections/community.general/pull/3461)."
- "runit - removed the deprecated ``dist`` option which was not used by the module (https://github.com/ansible-collections/community.general/pull/3461)."
- "xfconf - the default value of ``disable_facts`` changed to ``true``, and the value ``false`` is no longer allowed. Register the module results instead (https://github.com/ansible-collections/community.general/pull/3461)."

View file

@ -1,6 +1,6 @@
namespace: community namespace: community
name: general name: general
version: 3.7.0 version: 4.0.0
readme: README.md readme: README.md
authors: authors:
- Ansible (https://github.com/ansible) - Ansible (https://github.com/ansible)

View file

@ -141,11 +141,7 @@ class CmdMixin(object):
fmt = find_format(param) fmt = find_format(param)
value = extra_params[param] value = extra_params[param]
else: else:
self.module.deprecate("Cannot determine value for parameter: {0}. " raise self.ModuleHelperException('Cannot determine value for parameter: {0}'.format(param))
"From version 4.0.0 onwards this will generate an exception".format(param),
version="4.0.0", collection_name="community.general")
continue
else: else:
raise self.ModuleHelperException("run_command parameter must be either a str or a dict: {0}".format(param)) raise self.ModuleHelperException("run_command parameter must be either a str or a dict: {0}".format(param))
cmd_args = add_arg_formatted_param(cmd_args, fmt, value) cmd_args = add_arg_formatted_param(cmd_args, fmt, value)

View file

@ -13,7 +13,7 @@ short_description: management of instances in Proxmox VE cluster
description: description:
- allows you to create/delete/stop instances in Proxmox VE cluster - allows you to create/delete/stop instances in Proxmox VE cluster
- Starting in Ansible 2.1, it automatically detects containerization type (lxc for PVE 4, openvz for older) - Starting in Ansible 2.1, it automatically detects containerization type (lxc for PVE 4, openvz for older)
- From community.general 4.0.0 on, there will be no default values, see I(proxmox_default_behavior). - Since community.general 4.0.0 on, there are no more default values, see I(proxmox_default_behavior).
options: options:
password: password:
description: description:
@ -40,37 +40,27 @@ options:
comma-delimited list C([volume=]<volume> [,acl=<1|0>] [,mountoptions=<opt[;opt...]>] [,quota=<1|0>] 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>])." [,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.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(3).
option has a default of C(3). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: str type: str
cores: cores:
description: description:
- Specify number of cores per socket. - Specify number of cores per socket.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(1).
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
cpus: cpus:
description: description:
- numbers of allocated cpus for instance - numbers of allocated cpus for instance
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(1).
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
memory: memory:
description: description:
- memory size in MB for instance - memory size in MB for instance
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(512).
option has a default of C(512). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
swap: swap:
description: description:
- swap memory size in MB for instance - swap memory size in MB for instance
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(0).
option has a default of C(0). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
netif: netif:
description: description:
@ -94,9 +84,7 @@ options:
onboot: onboot:
description: description:
- specifies whether a VM will be started during system bootup - specifies whether a VM will be started during system bootup
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no).
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
storage: storage:
description: description:
@ -106,9 +94,7 @@ options:
cpuunits: cpuunits:
description: description:
- CPU weight for a VM - CPU weight for a VM
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(1000).
option has a default of C(1000). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
nameserver: nameserver:
description: description:
@ -168,16 +154,15 @@ options:
version_added: '0.2.0' version_added: '0.2.0'
proxmox_default_behavior: proxmox_default_behavior:
description: description:
- Various module options used to have default values. This cause problems when - As of community.general 4.0.0, various options no longer have default values.
user expects different behavior from proxmox by default or fill options which cause These default values caused problems when users expected different behavior from Proxmox
problems when they have been set. by default or filled options which caused problems when set.
- The default value is C(compatibility), which will ensure that the default values - The value C(compatibility) (default before community.general 4.0.0) will ensure that the default values
are used when the values are not explicitly specified by the user. are used when the values are not explicitly specified by the user. The new default is C(no_defaults),
- From community.general 4.0.0 on, the default value will switch to C(no_defaults). To avoid which makes sure these options have no defaults.
deprecation warnings, please set I(proxmox_default_behavior) to an explicit
value.
- This affects the I(disk), I(cores), I(cpus), I(memory), I(onboot), I(swap), I(cpuunits) options. - This affects the I(disk), I(cores), I(cpus), I(memory), I(onboot), I(swap), I(cpuunits) options.
type: str type: str
default: no_defaults
choices: choices:
- compatibility - compatibility
- no_defaults - no_defaults
@ -529,7 +514,7 @@ def main():
unprivileged=dict(type='bool', default=False), unprivileged=dict(type='bool', default=False),
description=dict(type='str'), description=dict(type='str'),
hookscript=dict(type='str'), hookscript=dict(type='str'),
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']), proxmox_default_behavior=dict(type='str', default='no_defaults', choices=['compatibility', 'no_defaults']),
), ),
required_if=[('state', 'present', ['node', 'hostname', 'ostemplate'])], required_if=[('state', 'present', ['node', 'hostname', 'ostemplate'])],
required_together=[('api_token_id', 'api_token_secret')], required_together=[('api_token_id', 'api_token_secret')],
@ -558,13 +543,6 @@ def main():
template_store = module.params['ostemplate'].split(":")[0] template_store = module.params['ostemplate'].split(":")[0]
timeout = module.params['timeout'] timeout = module.params['timeout']
if module.params['proxmox_default_behavior'] is None:
module.params['proxmox_default_behavior'] = 'compatibility'
module.deprecate(
'The proxmox_default_behavior option will change its default value from "compatibility" to '
'"no_defaults" in community.general 4.0.0. To remove this warning, please specify an explicit value for it now',
version='4.0.0', collection_name='community.general'
)
if module.params['proxmox_default_behavior'] == 'compatibility': if module.params['proxmox_default_behavior'] == 'compatibility':
old_default_values = dict( old_default_values = dict(
disk="3", disk="3",

View file

@ -13,15 +13,13 @@ 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:
- Allows you to create/delete/stop Qemu(KVM) Virtual Machines in Proxmox VE cluster. - Allows you to create/delete/stop Qemu(KVM) Virtual Machines in Proxmox VE cluster.
- From community.general 4.0.0 on, there will be no default values, see I(proxmox_default_behavior). - Since community.general 4.0.0 on, there are no more default values, see I(proxmox_default_behavior).
author: "Abdoul Bah (@helldorado) <bahabdoul at gmail.com>" author: "Abdoul Bah (@helldorado) <bahabdoul at gmail.com>"
options: options:
acpi: acpi:
description: description:
- Specify if ACPI should be enabled/disabled. - Specify if ACPI should be enabled/disabled.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(yes).
option has a default of C(yes). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
agent: agent:
description: description:
@ -31,24 +29,19 @@ options:
description: description:
- Pass arbitrary arguments to kvm. - Pass arbitrary arguments to kvm.
- This option is for experts only! - This option is for experts only!
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - If I(proxmox_default_behavior) is set to C(compatiblity), this option has a default of
option has a default of C(-serial unix:/var/run/qemu-server/<vmid>.serial,server,nowait). C(-serial unix:/var/run/qemu-server/<vmid>.serial,server,nowait).
Note that the default value of I(proxmox_default_behavior) changes in community.general 4.0.0.
type: str type: str
autostart: autostart:
description: description:
- Specify if the VM should be automatically restarted after crash (currently ignored in PVE API). - Specify if the VM should be automatically restarted after crash (currently ignored in PVE API).
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no).
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
balloon: balloon:
description: description:
- Specify the amount of RAM for the VM in MB. - Specify the amount of RAM for the VM in MB.
- Using zero disables the balloon driver. - Using zero disables the balloon driver.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(0).
option has a default of C(0). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
bios: bios:
description: description:
@ -59,9 +52,7 @@ options:
description: description:
- Specify the boot order -> boot on floppy C(a), hard disk C(c), CD-ROM C(d), or network C(n). - Specify the boot order -> boot on floppy C(a), hard disk C(c), CD-ROM C(d), or network C(n).
- You can combine to set order. - You can combine to set order.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(cnd).
option has a default of C(cnd). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: str type: str
bootdisk: bootdisk:
description: description:
@ -97,16 +88,12 @@ options:
cores: cores:
description: description:
- Specify number of cores per socket. - Specify number of cores per socket.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(1).
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
cpu: cpu:
description: description:
- Specify emulated CPU type. - Specify emulated CPU type.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(kvm64).
option has a default of C(kvm64). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: str type: str
cpulimit: cpulimit:
description: description:
@ -117,9 +104,7 @@ options:
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 0
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(1000).
option has a default of C(1000). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
delete: delete:
description: description:
@ -139,19 +124,15 @@ options:
description: description:
- Allow to force stop VM. - Allow to force stop VM.
- Can be used with states C(stopped), C(restarted) and C(absent). - Can be used with states C(stopped), C(restarted) and C(absent).
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no).
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
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 I(format=unspecified) and I(full=false) for a linked clone. - Use I(format=unspecified) and I(full=false) for a linked clone.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(qcow2).
option has a default of C(qcow2). If I(proxmox_default_behavior) is set to C(no_defaults), If I(proxmox_default_behavior) is set to C(no_defaults), not specifying this option is equivalent to setting it to C(unspecified).
not specifying this option is equivalent to setting it to C(unspecified).
Note that the default value of I(proxmox_default_behavior) changes in community.general 4.0.0.
type: str type: str
choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified" ] choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified" ]
freeze: freeze:
@ -216,9 +197,7 @@ options:
kvm: kvm:
description: description:
- Enable/disable KVM hardware virtualization. - Enable/disable KVM hardware virtualization.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(yes).
option has a default of C(yes). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
localtime: localtime:
description: description:
@ -238,9 +217,7 @@ options:
memory: memory:
description: description:
- Memory size in MB for instance. - Memory size in MB for instance.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(512).
option has a default of C(512). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
migrate_downtime: migrate_downtime:
description: description:
@ -296,17 +273,13 @@ options:
onboot: onboot:
description: description:
- Specifies whether a VM will be started during system bootup. - Specifies whether a VM will be started during system bootup.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(yes).
option has a default of C(yes). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
ostype: ostype:
description: description:
- Specifies guest operating system. This is used to enable special optimization/features for specific operating systems. - Specifies guest operating system. This is used to enable special optimization/features for specific operating systems.
- The l26 is Linux 2.6/3.X Kernel. - The l26 is Linux 2.6/3.X Kernel.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(l26).
option has a default of C(l26). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: str type: str
choices: ['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'l24', 'l26', 'solaris'] choices: ['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'l24', 'l26', 'solaris']
parallel: parallel:
@ -387,9 +360,7 @@ options:
sockets: sockets:
description: description:
- Sets the number of CPU sockets. (1 - N). - Sets the number of CPU sockets. (1 - N).
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(1).
option has a default of C(1). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: int type: int
sshkeys: sshkeys:
description: description:
@ -421,9 +392,7 @@ options:
tablet: tablet:
description: description:
- Enables/disables the USB tablet device. - Enables/disables the USB tablet device.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no).
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
tags: tags:
description: description:
@ -445,9 +414,7 @@ options:
template: template:
description: description:
- Enables/disables the template. - Enables/disables the template.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no).
option has a default of C(no). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: bool type: bool
timeout: timeout:
description: description:
@ -469,9 +436,7 @@ options:
vga: vga:
description: description:
- Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. - Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'.
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(std).
option has a default of C(std). Note that the default value of I(proxmox_default_behavior)
changes in community.general 4.0.0.
type: str type: str
choices: ['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4'] choices: ['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']
virtio: virtio:
@ -489,18 +454,17 @@ options:
type: str type: str
proxmox_default_behavior: proxmox_default_behavior:
description: description:
- Various module options used to have default values. This cause problems when - As of community.general 4.0.0, various options no longer have default values.
user expects different behavior from proxmox by default or fill options which cause These default values caused problems when users expected different behavior from Proxmox
problems when they have been set. by default or filled options which caused problems when set.
- The default value is C(compatibility), which will ensure that the default values - The value C(compatibility) (default before community.general 4.0.0) will ensure that the default values
are used when the values are not explicitly specified by the user. are used when the values are not explicitly specified by the user. The new default is C(no_defaults),
- From community.general 4.0.0 on, the default value will switch to C(no_defaults). To avoid which makes sure these options have no defaults.
deprecation warnings, please set I(proxmox_default_behavior) to an explicit
value.
- This affects the I(acpi), I(autostart), I(balloon), I(boot), I(cores), I(cpu), - This affects the I(acpi), I(autostart), I(balloon), I(boot), I(cores), I(cpu),
I(cpuunits), I(force), I(format), I(kvm), I(memory), I(onboot), I(ostype), I(sockets), I(cpuunits), I(force), I(format), I(kvm), I(memory), I(onboot), I(ostype), I(sockets),
I(tablet), I(template), I(vga), options. I(tablet), I(template), I(vga), options.
type: str type: str
default: no_defaults
choices: choices:
- compatibility - compatibility
- no_defaults - no_defaults
@ -1091,7 +1055,7 @@ def main():
virtio=dict(type='dict'), virtio=dict(type='dict'),
vmid=dict(type='int'), vmid=dict(type='int'),
watchdog=dict(), watchdog=dict(),
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']), proxmox_default_behavior=dict(type='str', default='no_defaults', choices=['compatibility', 'no_defaults']),
), ),
mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')], mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')],
required_together=[('api_token_id', 'api_token_secret')], required_together=[('api_token_id', 'api_token_secret')],
@ -1122,13 +1086,6 @@ def main():
vmid = module.params['vmid'] vmid = module.params['vmid']
validate_certs = module.params['validate_certs'] validate_certs = module.params['validate_certs']
if module.params['proxmox_default_behavior'] is None:
module.params['proxmox_default_behavior'] = 'compatibility'
module.deprecate(
'The proxmox_default_behavior option will change its default value from "compatibility" to '
'"no_defaults" in community.general 4.0.0. To remove this warning, please specify an explicit value for it now',
version='4.0.0', collection_name='community.general'
)
if module.params['proxmox_default_behavior'] == 'compatibility': if module.params['proxmox_default_behavior'] == 'compatibility':
old_default_values = dict( old_default_values = dict(
acpi=True, acpi=True,

View file

@ -33,8 +33,6 @@ options:
- Message content. - Message content.
- The alias I(message) is deprecated and will be removed in community.general 4.0.0. - The alias I(message) is deprecated and will be removed in community.general 4.0.0.
required: true required: true
aliases:
- message
url: url:
type: str type: str
description: description:
@ -95,9 +93,7 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
channel_token=dict(type='str', required=True, no_log=True), channel_token=dict(type='str', required=True, no_log=True),
message_content=dict(type='str', required=True, aliases=['message'], message_content=dict(type='str', required=True),
deprecated_aliases=[dict(name='message', version='4.0.0',
collection_name='community.general')]),
service=dict(type='str', default='ansible'), service=dict(type='str', default='ansible'),
url=dict(type='str', default=None), url=dict(type='str', default=None),
icon_url=dict(type='str', default=None), icon_url=dict(type='str', default=None),

View file

@ -22,8 +22,6 @@ description:
- Also, the user may try to use any other telegram bot API method, if you specify I(api_method) argument. - Also, the user may try to use any other telegram bot API method, if you specify I(api_method) argument.
notes: notes:
- You will require a telegram account and create telegram bot to use this module. - You will require a telegram account and create telegram bot to use this module.
- The options I(msg), I(msg_format) and I(chat_id) have been deprecated and will be removed in community.general
4.0.0. Use the corresponding variables in I(api_args) instead. See the examples for how that works.
options: options:
token: token:
type: str type: str
@ -43,22 +41,6 @@ options:
- Any parameters for the method. - Any parameters for the method.
- For reference to default method, C(SendMessage), see U(https://core.telegram.org/bots/api#sendmessage). - For reference to default method, C(SendMessage), see U(https://core.telegram.org/bots/api#sendmessage).
version_added: 2.0.0 version_added: 2.0.0
msg:
type: str
description:
- (Deprecated) What message you wish to send.
msg_format:
type: str
description:
- (Deprecated) Message format. Formatting options C(markdown), C(MarkdownV2), and C(html) described in
Telegram API docs (https://core.telegram.org/bots/api#formatting-options).
If option C(plain) set, message will not be formatted.
default: plain
choices: [ "plain", "markdown", "MarkdownV2", "html" ]
chat_id:
type: str
description:
- (Deprecated) Telegram group or user chat_id.
''' '''
@ -83,12 +65,6 @@ EXAMPLES = """
from_chat_id: 111111 from_chat_id: 111111
disable_notification: True disable_notification: True
message_id: '{{ saved_msg_id }}' message_id: '{{ saved_msg_id }}'
- name: Send a message to chat in playbook (deprecated old style)
community.general.telegram:
token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX'
chat_id: 000000
msg: Ansible task finished
""" """
RETURN = """ RETURN = """
@ -119,11 +95,6 @@ def main():
token=dict(type='str', required=True, no_log=True), token=dict(type='str', required=True, no_log=True),
api_args=dict(type='dict'), api_args=dict(type='dict'),
api_method=dict(type="str", default="SendMessage"), api_method=dict(type="str", default="SendMessage"),
chat_id=dict(type='str', no_log=True, removed_in_version='4.0.0',
removed_from_collection='community.general'),
msg=dict(type='str', removed_in_version='4.0.0', removed_from_collection='community.general'),
msg_format=dict(type='str', choices=['plain', 'markdown', 'html', 'MarkdownV2'], default='plain',
removed_in_version='4.0.0', removed_from_collection='community.general'),
), ),
supports_check_mode=True supports_check_mode=True
) )
@ -132,9 +103,9 @@ def main():
api_args = module.params.get('api_args') or {} api_args = module.params.get('api_args') or {}
api_method = module.params.get('api_method') api_method = module.params.get('api_method')
# filling backward compatibility args # filling backward compatibility args
api_args['chat_id'] = api_args.get('chat_id') or module.params.get('chat_id') api_args['chat_id'] = api_args.get('chat_id')
api_args['parse_mode'] = api_args.get('parse_mode') or module.params.get('msg_format') api_args['parse_mode'] = api_args.get('parse_mode')
api_args['text'] = api_args.get('text') or module.params.get('msg') api_args['text'] = api_args.get('text')
if api_args['parse_mode'] == 'plain': if api_args['parse_mode'] == 'plain':
del api_args['parse_mode'] del api_args['parse_mode']

View file

@ -53,16 +53,6 @@ options:
description: description:
- Version specification for the perl module. When I(mode) is C(new), C(cpanm) version operators are accepted. - Version specification for the perl module. When I(mode) is C(new), C(cpanm) version operators are accepted.
type: str type: str
system_lib:
description:
- Use this if you want to install modules to the system perl include path. You must be root or have "passwordless" sudo for this to work.
- This uses the cpanm commandline option C(--sudo), which has nothing to do with ansible privilege escalation.
- >
This option is not recommended for use and it will be deprecated in the future. If you need to escalate privileges
please consider using any of the multiple mechanisms available in Ansible.
type: bool
default: no
aliases: ['use_sudo']
executable: executable:
description: description:
- Override the path to the cpanm executable. - Override the path to the cpanm executable.
@ -160,8 +150,6 @@ class CPANMinus(CmdMixin, ModuleHelper):
mirror=dict(type='str'), mirror=dict(type='str'),
mirror_only=dict(type='bool', default=False), mirror_only=dict(type='bool', default=False),
installdeps=dict(type='bool', default=False), installdeps=dict(type='bool', default=False),
system_lib=dict(type='bool', default=False, aliases=['use_sudo'],
removed_in_version="4.0.0", removed_from_collection="community.general"),
executable=dict(type='path'), executable=dict(type='path'),
mode=dict(type='str', choices=['compatibility', 'new'], default='compatibility'), mode=dict(type='str', choices=['compatibility', 'new'], default='compatibility'),
name_check=dict(type='str') name_check=dict(type='str')
@ -176,7 +164,6 @@ class CPANMinus(CmdMixin, ModuleHelper):
mirror=dict(fmt=('--mirror', '{0}'),), mirror=dict(fmt=('--mirror', '{0}'),),
mirror_only=dict(fmt="--mirror-only", style=ArgFormat.BOOLEAN), mirror_only=dict(fmt="--mirror-only", style=ArgFormat.BOOLEAN),
installdeps=dict(fmt="--installdeps", style=ArgFormat.BOOLEAN), installdeps=dict(fmt="--installdeps", style=ArgFormat.BOOLEAN),
system_lib=dict(fmt="--sudo", style=ArgFormat.BOOLEAN),
) )
check_rc = True check_rc = True
@ -188,8 +175,6 @@ class CPANMinus(CmdMixin, ModuleHelper):
else: else:
if v.name and v.from_path: if v.name and v.from_path:
raise ModuleHelperException("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'") raise ModuleHelperException("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'")
if v.system_lib:
raise ModuleHelperException("Parameter 'system_lib' is invalid when 'mode=new'")
self.command = self.module.get_bin_path(v.executable if v.executable else self.command) self.command = self.module.get_bin_path(v.executable if v.executable else self.command)
self.vars.set("binary", self.command) self.vars.set("binary", self.command)
@ -230,7 +215,7 @@ class CPANMinus(CmdMixin, ModuleHelper):
return return
pkg_spec = v[pkg_param] pkg_spec = v[pkg_param]
self.changed = self.run_command( self.changed = self.run_command(
params=['notest', 'locallib', 'mirror', 'mirror_only', 'installdeps', 'system_lib', {'name': pkg_spec}], params=['notest', 'locallib', 'mirror', 'mirror_only', 'installdeps', {'name': pkg_spec}],
) )
else: else:
installed = self._is_package_installed(v.name_check, v.locallib, v.version) if v.name_check else False installed = self._is_package_installed(v.name_check, v.locallib, v.version) if v.name_check else False

View file

@ -217,7 +217,6 @@ def main():
name=dict(type='str', required=True), name=dict(type='str', required=True),
state=dict(type='str', choices=['killed', 'once', 'reloaded', 'restarted', 'started', 'stopped']), state=dict(type='str', choices=['killed', 'once', 'reloaded', 'restarted', 'started', 'stopped']),
enabled=dict(type='bool'), enabled=dict(type='bool'),
dist=dict(type='str', removed_in_version='4.0.0', removed_from_collection='community.general'),
service_dir=dict(type='str', default='/var/service'), service_dir=dict(type='str', default='/var/service'),
service_src=dict(type='str', default='/etc/sv'), service_src=dict(type='str', default='/etc/sv'),
), ),

View file

@ -60,11 +60,10 @@ options:
version_added: 1.0.0 version_added: 1.0.0
disable_facts: disable_facts:
description: description:
- For backward compatibility, output results are also returned as C(ansible_facts), but this behaviour is deprecated - The value C(false) is no longer allowed since community.general 4.0.0.
and will be removed in community.general 4.0.0. - This option will be deprecated in a future version, and eventually be removed.
- This flag disables the output as facts and also disables the deprecation warning.
type: bool type: bool
default: no default: true
version_added: 2.1.0 version_added: 2.1.0
''' '''
@ -129,7 +128,7 @@ RETURN = '''
''' '''
from ansible_collections.community.general.plugins.module_utils.module_helper import ( from ansible_collections.community.general.plugins.module_utils.module_helper import (
ModuleHelper, CmdMixin, StateMixin, ArgFormat ModuleHelper, CmdMixin, StateMixin, ArgFormat, ModuleHelperException
) )
@ -168,7 +167,7 @@ class XFConfProperty(CmdMixin, StateMixin, ModuleHelper):
elements='str', choices=('int', 'uint', 'bool', 'float', 'double', 'string')), elements='str', choices=('int', 'uint', 'bool', 'float', 'double', 'string')),
value=dict(required=False, type='list', elements='raw'), value=dict(required=False, type='list', elements='raw'),
force_array=dict(default=False, type='bool', aliases=['array']), force_array=dict(default=False, type='bool', aliases=['array']),
disable_facts=dict(type='bool', default=False), disable_facts=dict(type='bool', default=True),
), ),
required_if=[('state', 'present', ['value', 'value_type'])], required_if=[('state', 'present', ['value', 'value_type'])],
required_together=[('value', 'value_type')], required_together=[('value', 'value_type')],
@ -196,15 +195,8 @@ class XFConfProperty(CmdMixin, StateMixin, ModuleHelper):
self.vars.set('type', self.vars.value_type, fact=True) self.vars.set('type', self.vars.value_type, fact=True)
self.vars.meta('value').set(initial_value=self.vars.previous_value) self.vars.meta('value').set(initial_value=self.vars.previous_value)
if not self.module.params['disable_facts']: if self.module.params['disable_facts'] is False:
self.facts_name = "xfconf" raise ModuleHelperException('Returning results as facts has been removed. Stop using disable_facts=false.')
self.module.deprecate(
msg="Returning results as facts is deprecated. "
"Please register the module output to a variable instead."
" You can use the disable_facts option to switch to the "
"new behavior already now and disable this warning",
version="4.0.0", collection_name="community.general"
)
def process_command_output(self, rc, out, err): def process_command_output(self, rc, out, err):
if err.rstrip() == self.does_not: if err.rstrip() == self.does_not:

View file

@ -17,7 +17,6 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
plugins/modules/notification/grove.py validate-modules:invalid-argument-name # invalid alias - removed in 4.0.0
plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
@ -45,7 +44,6 @@ plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/puppet.py use-argspec-type-path plugins/modules/system/puppet.py use-argspec-type-path
plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented
plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc # param removed in 4.0.0
plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0
plugins/modules/system/xfconf.py validate-modules:return-syntax-error plugins/modules/system/xfconf.py validate-modules:return-syntax-error

View file

@ -16,7 +16,6 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
plugins/modules/notification/grove.py validate-modules:invalid-argument-name # invalid alias - removed in 4.0.0
plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
@ -44,7 +43,6 @@ plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/puppet.py use-argspec-type-path plugins/modules/system/puppet.py use-argspec-type-path
plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented
plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc # param removed in 4.0.0
plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0
plugins/modules/system/xfconf.py validate-modules:return-syntax-error plugins/modules/system/xfconf.py validate-modules:return-syntax-error

View file

@ -16,7 +16,6 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
plugins/modules/notification/grove.py validate-modules:invalid-argument-name # invalid alias - removed in 4.0.0
plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
@ -44,7 +43,6 @@ plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/puppet.py use-argspec-type-path plugins/modules/system/puppet.py use-argspec-type-path
plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented
plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc # param removed in 4.0.0
plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0
plugins/modules/system/xfconf.py validate-modules:return-syntax-error plugins/modules/system/xfconf.py validate-modules:return-syntax-error

View file

@ -16,7 +16,6 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
plugins/modules/notification/grove.py validate-modules:invalid-argument-name # invalid alias - removed in 4.0.0
plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0
@ -44,7 +43,6 @@ plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/puppet.py use-argspec-type-path plugins/modules/system/puppet.py use-argspec-type-path
plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented
plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc # param removed in 4.0.0
plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0
plugins/modules/system/xfconf.py validate-modules:return-syntax-error plugins/modules/system/xfconf.py validate-modules:return-syntax-error

View file

@ -64,7 +64,6 @@ plugins/modules/source_control/github/github_deploy_key.py validate-modules:para
plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter
plugins/modules/system/puppet.py use-argspec-type-path plugins/modules/system/puppet.py use-argspec-type-path
plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc # deprecated param - removed in 4.0.0
plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/system/xfconf.py validate-modules:return-syntax-error plugins/modules/system/xfconf.py validate-modules:return-syntax-error
plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path