mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-28 20:09:08 -07:00
[5.0.0] Bump version to 5.0.0, remove deprecated features (#4516)
* Remove deprecated features. * Fix changelog. * Remove ignore.txt entries. * One more. * Remove state=get tests.
This commit is contained in:
parent
29c49febd9
commit
54b2f0819d
28 changed files with 79 additions and 500 deletions
|
@ -33,25 +33,6 @@ description:
|
|||
- This module was called C(ali_instance_facts) before Ansible 2.9. The usage did not change.
|
||||
|
||||
options:
|
||||
availability_zone:
|
||||
description:
|
||||
- Aliyun availability zone ID in which to launch the instance.
|
||||
- Deprecated parameter, it will be removed in community.general 5.0.0. Please use filter item I(zone_id) instead.
|
||||
aliases: ['alicloud_zone']
|
||||
type: str
|
||||
instance_names:
|
||||
description:
|
||||
- A list of ECS instance names.
|
||||
- Deprecated parameter, it will be removed in community.general 5.0.0. Please use filter item I(instance_name) instead.
|
||||
aliases: ["names"]
|
||||
type: list
|
||||
elements: str
|
||||
instance_ids:
|
||||
description:
|
||||
- A list of ECS instance ids.
|
||||
aliases: ["ids"]
|
||||
type: list
|
||||
elements: str
|
||||
name_prefix:
|
||||
description:
|
||||
- Use a instance name prefix to filter ecs instances.
|
||||
|
@ -67,8 +48,8 @@ options:
|
|||
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. The filter keys can be
|
||||
all of request parameters. See U(https://www.alibabacloud.com/help/doc-detail/25506.htm) for parameter details.
|
||||
Filter keys can be same as request parameter name or be lower case and use underscore ("_") or dash ("-") to
|
||||
connect different words in one parameter. 'InstanceIds' should be a list and it will be appended to
|
||||
I(instance_ids) automatically. 'Tag.n.Key' and 'Tag.n.Value' should be a dict and using I(tags) instead.
|
||||
connect different words in one parameter. 'InstanceIds' should be a list.
|
||||
'Tag.n.Key' and 'Tag.n.Value' should be a dict and using I(tags) instead.
|
||||
type: dict
|
||||
version_added: '0.2.0'
|
||||
author:
|
||||
|
@ -376,11 +357,6 @@ except ImportError:
|
|||
def main():
|
||||
argument_spec = ecs_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
availability_zone=dict(aliases=['alicloud_zone'],
|
||||
removed_in_version="5.0.0", removed_from_collection="community.general"),
|
||||
instance_ids=dict(type='list', elements='str', aliases=['ids'],
|
||||
removed_in_version="5.0.0", removed_from_collection="community.general"),
|
||||
instance_names=dict(type='list', elements='str', aliases=['names']),
|
||||
name_prefix=dict(type='str'),
|
||||
tags=dict(type='dict', aliases=['instance_tags']),
|
||||
filters=dict(type='dict')
|
||||
|
@ -398,21 +374,12 @@ def main():
|
|||
|
||||
instances = []
|
||||
instance_ids = []
|
||||
ids = module.params['instance_ids']
|
||||
ids = []
|
||||
name_prefix = module.params['name_prefix']
|
||||
names = module.params['instance_names']
|
||||
zone_id = module.params['availability_zone']
|
||||
if ids and (not isinstance(ids, list) or len(ids) < 1):
|
||||
module.fail_json(msg='instance_ids should be a list of instances, aborting')
|
||||
|
||||
if names and (not isinstance(names, list) or len(names) < 1):
|
||||
module.fail_json(msg='instance_names should be a list of instances, aborting')
|
||||
|
||||
filters = module.params['filters']
|
||||
if not filters:
|
||||
filters = {}
|
||||
if not ids:
|
||||
ids = []
|
||||
for key, value in list(filters.items()):
|
||||
if key in ["InstanceIds", "instance_ids", "instance-ids"] and isinstance(ids, list):
|
||||
for id in value:
|
||||
|
@ -422,10 +389,6 @@ def main():
|
|||
filters['instance_ids'] = ids
|
||||
if module.params['tags']:
|
||||
filters['tags'] = module.params['tags']
|
||||
if zone_id:
|
||||
filters['zone_id'] = zone_id
|
||||
if names:
|
||||
filters['instance_name'] = names[0]
|
||||
|
||||
for inst in ecs.describe_instances(**filters):
|
||||
if name_prefix:
|
||||
|
|
|
@ -90,11 +90,6 @@ options:
|
|||
description:
|
||||
- Set threshold for average IO ops/sec over 2 hour period.
|
||||
type: int
|
||||
backupsenabled:
|
||||
description:
|
||||
- Deprecated parameter, it will be removed in community.general C(5.0.0).
|
||||
- To enable backups pass values to either I(backupweeklyday) or I(backupwindow).
|
||||
type: int
|
||||
backupweeklyday:
|
||||
description:
|
||||
- Day of the week to take backups.
|
||||
|
@ -594,7 +589,6 @@ def main():
|
|||
alert_cpu_threshold=dict(type='int'),
|
||||
alert_diskio_enabled=dict(type='bool'),
|
||||
alert_diskio_threshold=dict(type='int'),
|
||||
backupsenabled=dict(type='int', removed_in_version='5.0.0', removed_from_collection='community.general'),
|
||||
backupweeklyday=dict(type='int'),
|
||||
backupwindow=dict(type='int'),
|
||||
displaygroup=dict(type='str', default=''),
|
||||
|
|
|
@ -626,7 +626,7 @@ def main():
|
|||
if not vmid and state == 'present':
|
||||
vmid = proxmox.get_nextvmid()
|
||||
elif not vmid and hostname:
|
||||
vmid = proxmox.get_vmid(hostname, choose_first_if_multiple=True)
|
||||
vmid = proxmox.get_vmid(hostname)
|
||||
elif not vmid:
|
||||
module.exit_json(changed=False, msg="Vmid could not be fetched for the following action: %s" % state)
|
||||
|
||||
|
@ -637,9 +637,9 @@ def main():
|
|||
module.exit_json(changed=False, msg="VM with vmid = %s is already exists" % vmid)
|
||||
# If no vmid was passed, there cannot be another VM named 'hostname'
|
||||
if (not module.params['vmid'] and
|
||||
proxmox.get_vmid(hostname, ignore_missing=True, choose_first_if_multiple=True) and
|
||||
proxmox.get_vmid(hostname, ignore_missing=True) and
|
||||
not module.params['force']):
|
||||
vmid = proxmox.get_vmid(hostname, choose_first_if_multiple=True)
|
||||
vmid = proxmox.get_vmid(hostname)
|
||||
module.exit_json(changed=False, msg="VM with hostname %s already exists and has ID number %s" % (hostname, vmid))
|
||||
elif not proxmox.get_node(node):
|
||||
module.fail_json(msg="node '%s' not exists in cluster" % node)
|
||||
|
@ -681,9 +681,9 @@ def main():
|
|||
module.exit_json(changed=False, msg="VM with vmid = %s is already exists" % vmid)
|
||||
# If no vmid was passed, there cannot be another VM named 'hostname'
|
||||
if (not module.params['vmid'] and
|
||||
proxmox.get_vmid(hostname, ignore_missing=True, choose_first_if_multiple=True) and
|
||||
proxmox.get_vmid(hostname, ignore_missing=True) and
|
||||
not module.params['force']):
|
||||
vmid = proxmox.get_vmid(hostname, choose_first_if_multiple=True)
|
||||
vmid = proxmox.get_vmid(hostname)
|
||||
module.exit_json(changed=False, msg="VM with hostname %s already exists and has ID number %s" % (hostname, vmid))
|
||||
if not proxmox.get_vm(clone, ignore_missing=True):
|
||||
module.exit_json(changed=False, msg="Container to be cloned does not exist")
|
||||
|
|
|
@ -1187,7 +1187,7 @@ def main():
|
|||
module.fail_json(msg="Can't get the next vmid for VM {0} automatically. Ensure your cluster state is good".format(name))
|
||||
else:
|
||||
clone_target = clone or name
|
||||
vmid = proxmox.get_vmid(clone_target, ignore_missing=True, choose_first_if_multiple=True)
|
||||
vmid = proxmox.get_vmid(clone_target, ignore_missing=True)
|
||||
|
||||
if clone is not None:
|
||||
# If newid is not defined then retrieve the next free id from ProxmoxAPI
|
||||
|
@ -1205,7 +1205,7 @@ def main():
|
|||
proxmox.get_vm(vmid)
|
||||
|
||||
# Ensure the choosen VM name doesn't already exist when cloning
|
||||
existing_vmid = proxmox.get_vmid(name, ignore_missing=True, choose_first_if_multiple=True)
|
||||
existing_vmid = proxmox.get_vmid(name, ignore_missing=True)
|
||||
if existing_vmid:
|
||||
module.exit_json(changed=False, vmid=existing_vmid, msg="VM with name <%s> already exists" % name)
|
||||
|
||||
|
@ -1231,8 +1231,8 @@ def main():
|
|||
try:
|
||||
if proxmox.get_vm(vmid, ignore_missing=True) and not (update or clone):
|
||||
module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid)
|
||||
elif proxmox.get_vmid(name, ignore_missing=True, choose_first_if_multiple=True) and not (update or clone):
|
||||
module.exit_json(changed=False, vmid=proxmox.get_vmid(name, choose_first_if_multiple=True), msg="VM with name <%s> already exists" % name)
|
||||
elif proxmox.get_vmid(name, ignore_missing=True) and not (update or clone):
|
||||
module.exit_json(changed=False, vmid=proxmox.get_vmid(name), msg="VM with name <%s> already exists" % name)
|
||||
elif not (node, name):
|
||||
module.fail_json(msg='node, name is mandatory for creating/updating vm')
|
||||
elif not proxmox.get_node(node):
|
||||
|
|
|
@ -197,7 +197,7 @@ def main():
|
|||
|
||||
# If hostname is set get the VM id from ProxmoxAPI
|
||||
if not vmid and hostname:
|
||||
vmid = proxmox.get_vmid(hostname, choose_first_if_multiple=True)
|
||||
vmid = proxmox.get_vmid(hostname)
|
||||
elif not vmid:
|
||||
module.exit_json(changed=False, msg="Vmid could not be fetched for the following action: %s" % state)
|
||||
|
||||
|
|
|
@ -34,14 +34,6 @@ options:
|
|||
- The name of the serverless framework project stage to deploy to.
|
||||
- This uses the serverless framework default "dev".
|
||||
type: str
|
||||
functions:
|
||||
description:
|
||||
- A list of specific functions to deploy.
|
||||
- If this is not provided, all functions in the service will be deployed.
|
||||
- Deprecated parameter, it will be removed in community.general 5.0.0.
|
||||
type: list
|
||||
elements: str
|
||||
default: []
|
||||
region:
|
||||
description:
|
||||
- AWS region to deploy the service to.
|
||||
|
@ -159,8 +151,6 @@ def main():
|
|||
argument_spec=dict(
|
||||
service_path=dict(type='path', required=True),
|
||||
state=dict(type='str', default='present', choices=['absent', 'present']),
|
||||
functions=dict(type='list', elements='str',
|
||||
removed_in_version="5.0.0", removed_from_collection="community.general"),
|
||||
region=dict(type='str', default=''),
|
||||
stage=dict(type='str', default=''),
|
||||
deploy=dict(type='bool', default=True),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue