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

Revert "spotinst_aws_elastigroup - fixed elements for many lists (#2355) (#2363)"

This reverts commit ea42b75378.

(Will be re-reverted after the 3.0.1 release.)
This commit is contained in:
Felix Fontein 2021-05-03 07:48:12 +02:00
parent a6379e45ce
commit 5b15e4089a
2 changed files with 75 additions and 92 deletions

View file

@ -1,2 +0,0 @@
minor_changes:
- spotinst_aws_elastigroup - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/2355).

View file

@ -23,26 +23,26 @@ options:
credentials_path: credentials_path:
description: description:
- Optional parameter that allows to set a non-default credentials path. - (Path) Optional parameter that allows to set a non-default credentials path.
default: ~/.spotinst/credentials default: ~/.spotinst/credentials
type: path type: path
account_id: account_id:
description: description:
- Optional parameter that allows to set an account-id inside the module configuration. - (String) Optional parameter that allows to set an account-id inside the module configuration
By default this is retrieved from the credentials path. By default this is retrieved from the credentials path
type: str type: str
availability_vs_cost: availability_vs_cost:
description: description:
- The strategy orientation. - (String) The strategy orientation.
- "The choices available are: C(availabilityOriented), C(costOriented), C(balanced)." - "The choices available are: C(availabilityOriented), C(costOriented), C(balanced)."
required: true required: true
type: str type: str
availability_zones: availability_zones:
description: description:
- A list of hash/dictionaries of Availability Zones that are configured in the elastigroup; - (List of Objects) a list of hash/dictionaries of Availability Zones that are configured in the elastigroup;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are keys allowed are
name (String), name (String),
@ -50,11 +50,10 @@ options:
placement_group_name (String), placement_group_name (String),
required: true required: true
type: list type: list
elements: dict
block_device_mappings: block_device_mappings:
description: description:
- A list of hash/dictionaries of Block Device Mappings for elastigroup instances; - (List of Objects) a list of hash/dictionaries of Block Device Mappings for elastigroup instances;
You can specify virtual devices and EBS volumes.; You can specify virtual devices and EBS volumes.;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are keys allowed are
@ -69,11 +68,10 @@ options:
volume_type(String), volume_type(String),
volume_size(Integer)) volume_size(Integer))
type: list type: list
elements: dict
chef: chef:
description: description:
- The Chef integration configuration.; - (Object) The Chef integration configuration.;
Expects the following keys - chef_server (String), Expects the following keys - chef_server (String),
organization (String), organization (String),
user (String), user (String),
@ -83,94 +81,92 @@ options:
draining_timeout: draining_timeout:
description: description:
- Time for instance to be drained from incoming requests and deregistered from ELB before termination. - (Integer) Time for instance to be drained from incoming requests and deregistered from ELB before termination.
type: int type: int
ebs_optimized: ebs_optimized:
description: description:
- Enable EBS optimization for supported instances which are not enabled by default.; - (Boolean) Enable EBS optimization for supported instances which are not enabled by default.;
Note - additional charges will be applied. Note - additional charges will be applied.
type: bool type: bool
ebs_volume_pool: ebs_volume_pool:
description: description:
- A list of hash/dictionaries of EBS devices to reattach to the elastigroup when available; - (List of Objects) a list of hash/dictionaries of EBS devices to reattach to the elastigroup when available;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are - keys allowed are -
volume_ids (List of Strings), volume_ids (List of Strings),
device_name (String) device_name (String)
type: list type: list
elements: dict
ecs: ecs:
description: description:
- The ECS integration configuration.; - (Object) The ECS integration configuration.;
Expects the following key - Expects the following key -
cluster_name (String) cluster_name (String)
type: dict type: dict
elastic_ips: elastic_ips:
description: description:
- List of ElasticIps Allocation Ids (Example C(eipalloc-9d4e16f8)) to associate to the group instances - (List of Strings) List of ElasticIps Allocation Ids (Example C(eipalloc-9d4e16f8)) to associate to the group instances
type: list type: list
elements: str
fallback_to_od: fallback_to_od:
description: description:
- In case of no spots available, Elastigroup will launch an On-demand instance instead - (Boolean) In case of no spots available, Elastigroup will launch an On-demand instance instead
type: bool type: bool
health_check_grace_period: health_check_grace_period:
description: description:
- The amount of time, in seconds, after the instance has launched to start and check its health. - (Integer) The amount of time, in seconds, after the instance has launched to start and check its health.
- If not specified, it defaults to C(300). - If not specified, it defaults to C(300).
type: int type: int
health_check_unhealthy_duration_before_replacement: health_check_unhealthy_duration_before_replacement:
description: description:
- Minimal mount of time instance should be unhealthy for us to consider it unhealthy. - (Integer) Minimal mount of time instance should be unhealthy for us to consider it unhealthy.
type: int type: int
health_check_type: health_check_type:
description: description:
- The service to use for the health check. - (String) The service to use for the health check.
- "The choices available are: C(ELB), C(HCS), C(TARGET_GROUP), C(MLB), C(EC2)." - "The choices available are: C(ELB), C(HCS), C(TARGET_GROUP), C(MLB), C(EC2)."
type: str type: str
iam_role_name: iam_role_name:
description: description:
- The instance profile iamRole name - (String) The instance profile iamRole name
- Only use iam_role_arn, or iam_role_name - Only use iam_role_arn, or iam_role_name
type: str type: str
iam_role_arn: iam_role_arn:
description: description:
- The instance profile iamRole arn - (String) The instance profile iamRole arn
- Only use iam_role_arn, or iam_role_name - Only use iam_role_arn, or iam_role_name
type: str type: str
id: id:
description: description:
- The group id if it already exists and you want to update, or delete it. - (String) The group id if it already exists and you want to update, or delete it.
This will not work unless the uniqueness_by field is set to id. This will not work unless the uniqueness_by field is set to id.
When this is set, and the uniqueness_by field is set, the group will either be updated or deleted, but not created. When this is set, and the uniqueness_by field is set, the group will either be updated or deleted, but not created.
type: str type: str
image_id: image_id:
description: description:
- The image Id used to launch the instance.; - (String) The image Id used to launch the instance.;
In case of conflict between Instance type and image type, an error will be returned In case of conflict between Instance type and image type, an error will be returned
required: true required: true
type: str type: str
key_pair: key_pair:
description: description:
- Specify a Key Pair to attach to the instances - (String) Specify a Key Pair to attach to the instances
type: str type: str
kubernetes: kubernetes:
description: description:
- The Kubernetes integration configuration. - (Object) The Kubernetes integration configuration.
Expects the following keys - Expects the following keys -
api_server (String), api_server (String),
token (String) token (String)
@ -178,48 +174,47 @@ options:
lifetime_period: lifetime_period:
description: description:
- Lifetime period - (Integer) lifetime period
type: int type: int
load_balancers: load_balancers:
description: description:
- List of classic ELB names - (List of Strings) List of classic ELB names
type: list type: list
elements: str
max_size: max_size:
description: description:
- The upper limit number of instances that you can scale up to - (Integer) The upper limit number of instances that you can scale up to
required: true required: true
type: int type: int
mesosphere: mesosphere:
description: description:
- The Mesosphere integration configuration. - (Object) The Mesosphere integration configuration.
Expects the following key - Expects the following key -
api_server (String) api_server (String)
type: dict type: dict
min_size: min_size:
description: description:
- The lower limit number of instances that you can scale down to - (Integer) The lower limit number of instances that you can scale down to
required: true required: true
type: int type: int
monitoring: monitoring:
description: description:
- Describes whether instance Enhanced Monitoring is enabled - (String) Describes whether instance Enhanced Monitoring is enabled
type: str type: str
name: name:
description: description:
- Unique name for elastigroup to be created, updated or deleted - (String) Unique name for elastigroup to be created, updated or deleted
required: true required: true
type: str type: str
network_interfaces: network_interfaces:
description: description:
- A list of hash/dictionaries of network interfaces to add to the elastigroup; - (List of Objects) a list of hash/dictionaries of network interfaces to add to the elastigroup;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are - keys allowed are -
description (String), description (String),
@ -234,30 +229,29 @@ options:
associate_ipv6_address (Boolean), associate_ipv6_address (Boolean),
private_ip_addresses (List of Objects, Keys are privateIpAddress (String, required) and primary (Boolean)) private_ip_addresses (List of Objects, Keys are privateIpAddress (String, required) and primary (Boolean))
type: list type: list
elements: dict
on_demand_count: on_demand_count:
description: description:
- Required if risk is not set - (Integer) Required if risk is not set
- Number of on demand instances to launch. All other instances will be spot instances.; - Number of on demand instances to launch. All other instances will be spot instances.;
Either set this parameter or the risk parameter Either set this parameter or the risk parameter
type: int type: int
on_demand_instance_type: on_demand_instance_type:
description: description:
- On-demand instance type that will be provisioned - (String) On-demand instance type that will be provisioned
type: str type: str
opsworks: opsworks:
description: description:
- The elastigroup OpsWorks integration configration.; - (Object) The elastigroup OpsWorks integration configration.;
Expects the following key - Expects the following key -
layer_id (String) layer_id (String)
type: dict type: dict
persistence: persistence:
description: description:
- The Stateful elastigroup configration.; - (Object) The Stateful elastigroup configration.;
Accepts the following keys - Accepts the following keys -
should_persist_root_device (Boolean), should_persist_root_device (Boolean),
should_persist_block_devices (Boolean), should_persist_block_devices (Boolean),
@ -266,14 +260,14 @@ options:
product: product:
description: description:
- Operation system type. - (String) Operation system type.
- "Available choices are: C(Linux/UNIX), C(SUSE Linux), C(Windows), C(Linux/UNIX (Amazon VPC)), C(SUSE Linux (Amazon VPC))." - "Available choices are: C(Linux/UNIX), C(SUSE Linux), C(Windows), C(Linux/UNIX (Amazon VPC)), C(SUSE Linux (Amazon VPC))."
required: true required: true
type: str type: str
rancher: rancher:
description: description:
- The Rancher integration configuration.; - (Object) The Rancher integration configuration.;
Expects the following keys - Expects the following keys -
version (String), version (String),
access_key (String), access_key (String),
@ -283,7 +277,7 @@ options:
right_scale: right_scale:
description: description:
- The Rightscale integration configuration.; - (Object) The Rightscale integration configuration.;
Expects the following keys - Expects the following keys -
account_id (String), account_id (String),
refresh_token (String) refresh_token (String)
@ -291,12 +285,12 @@ options:
risk: risk:
description: description:
- Required if on demand is not set. The percentage of Spot instances to launch (0 - 100). - (Integer) required if on demand is not set. The percentage of Spot instances to launch (0 - 100).
type: int type: int
roll_config: roll_config:
description: description:
- Roll configuration.; - (Object) Roll configuration.;
If you would like the group to roll after updating, please use this feature. If you would like the group to roll after updating, please use this feature.
Accepts the following keys - Accepts the following keys -
batch_size_percentage(Integer, Required), batch_size_percentage(Integer, Required),
@ -306,7 +300,7 @@ options:
scheduled_tasks: scheduled_tasks:
description: description:
- A list of hash/dictionaries of scheduled tasks to configure in the elastigroup; - (List of Objects) a list of hash/dictionaries of scheduled tasks to configure in the elastigroup;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are - keys allowed are -
adjustment (Integer), adjustment (Integer),
@ -321,90 +315,84 @@ options:
task_type (String, required), task_type (String, required),
is_enabled (Boolean) is_enabled (Boolean)
type: list type: list
elements: dict
security_group_ids: security_group_ids:
description: description:
- One or more security group IDs. ; - (List of Strings) One or more security group IDs. ;
In case of update it will override the existing Security Group with the new given array In case of update it will override the existing Security Group with the new given array
required: true required: true
type: list type: list
elements: str
shutdown_script: shutdown_script:
description: description:
- The Base64-encoded shutdown script that executes prior to instance termination. - (String) The Base64-encoded shutdown script that executes prior to instance termination.
Encode before setting. Encode before setting.
type: str type: str
signals: signals:
description: description:
- A list of hash/dictionaries of signals to configure in the elastigroup; - (List of Objects) a list of hash/dictionaries of signals to configure in the elastigroup;
keys allowed are - keys allowed are -
name (String, required), name (String, required),
timeout (Integer) timeout (Integer)
type: list type: list
elements: dict
spin_up_time: spin_up_time:
description: description:
- Spin up time, in seconds, for the instance - (Integer) spin up time, in seconds, for the instance
type: int type: int
spot_instance_types: spot_instance_types:
description: description:
- Spot instance type that will be provisioned. - (List of Strings) Spot instance type that will be provisioned.
required: true required: true
type: list type: list
elements: str
state: state:
choices: choices:
- present - present
- absent - absent
description: description:
- Create or delete the elastigroup - (String) create or delete the elastigroup
default: present default: present
type: str type: str
tags: tags:
description: description:
- A list of tags to configure in the elastigroup. Please specify list of keys and values (key colon value); - (List of tagKey:tagValue pairs) a list of tags to configure in the elastigroup. Please specify list of keys and values (key colon value);
type: list type: list
elements: dict
target: target:
description: description:
- The number of instances to launch - (Integer) The number of instances to launch
required: true required: true
type: int type: int
target_group_arns: target_group_arns:
description: description:
- List of target group arns instances should be registered to - (List of Strings) List of target group arns instances should be registered to
type: list type: list
elements: str
tenancy: tenancy:
description: description:
- Dedicated vs shared tenancy. - (String) dedicated vs shared tenancy.
- "The available choices are: C(default), C(dedicated)." - "The available choices are: C(default), C(dedicated)."
type: str type: str
terminate_at_end_of_billing_hour: terminate_at_end_of_billing_hour:
description: description:
- Terminate at the end of billing hour - (Boolean) terminate at the end of billing hour
type: bool type: bool
unit: unit:
description: description:
- The capacity unit to launch instances by. - (String) The capacity unit to launch instances by.
- "The available choices are: C(instance), C(weight)." - "The available choices are: C(instance), C(weight)."
type: str type: str
up_scaling_policies: up_scaling_policies:
description: description:
- A list of hash/dictionaries of scaling policies to configure in the elastigroup; - (List of Objects) a list of hash/dictionaries of scaling policies to configure in the elastigroup;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are - keys allowed are -
policy_name (String, required), policy_name (String, required),
@ -425,11 +413,10 @@ options:
maximum (String), maximum (String),
minimum (String) minimum (String)
type: list type: list
elements: dict
down_scaling_policies: down_scaling_policies:
description: description:
- A list of hash/dictionaries of scaling policies to configure in the elastigroup; - (List of Objects) a list of hash/dictionaries of scaling policies to configure in the elastigroup;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are - keys allowed are -
policy_name (String, required), policy_name (String, required),
@ -450,11 +437,10 @@ options:
maximum (String), maximum (String),
minimum (String) minimum (String)
type: list type: list
elements: dict
target_tracking_policies: target_tracking_policies:
description: description:
- A list of hash/dictionaries of target tracking policies to configure in the elastigroup; - (List of Objects) a list of hash/dictionaries of target tracking policies to configure in the elastigroup;
'[{"key":"value", "key":"value"}]'; '[{"key":"value", "key":"value"}]';
keys allowed are - keys allowed are -
policy_name (String, required), policy_name (String, required),
@ -466,38 +452,37 @@ options:
cooldown (String, required), cooldown (String, required),
target (String, required) target (String, required)
type: list type: list
elements: dict
uniqueness_by: uniqueness_by:
choices: choices:
- id - id
- name - name
description: description:
- If your group names are not unique, you may use this feature to update or delete a specific group. - (String) If your group names are not unique, you may use this feature to update or delete a specific group.
Whenever this property is set, you must set a group_id in order to update or delete a group, otherwise a group will be created. Whenever this property is set, you must set a group_id in order to update or delete a group, otherwise a group will be created.
default: name default: name
type: str type: str
user_data: user_data:
description: description:
- Base64-encoded MIME user data. Encode before setting the value. - (String) Base64-encoded MIME user data. Encode before setting the value.
type: str type: str
utilize_reserved_instances: utilize_reserved_instances:
description: description:
- In case of any available Reserved Instances, - (Boolean) In case of any available Reserved Instances,
Elastigroup will utilize your reservations before purchasing Spot instances. Elastigroup will utilize your reservations before purchasing Spot instances.
type: bool type: bool
wait_for_instances: wait_for_instances:
description: description:
- Whether or not the elastigroup creation / update actions should wait for the instances to spin - (Boolean) Whether or not the elastigroup creation / update actions should wait for the instances to spin
type: bool type: bool
default: false default: false
wait_timeout: wait_timeout:
description: description:
- How long the module should wait for instances before failing the action.; - (Integer) How long the module should wait for instances before failing the action.;
Only works if wait_for_instances is True. Only works if wait_for_instances is True.
type: int type: int
@ -1443,18 +1428,18 @@ def main():
fields = dict( fields = dict(
account_id=dict(type='str'), account_id=dict(type='str'),
availability_vs_cost=dict(type='str', required=True), availability_vs_cost=dict(type='str', required=True),
availability_zones=dict(type='list', elements='dict', required=True), availability_zones=dict(type='list', required=True),
block_device_mappings=dict(type='list', elements='dict'), block_device_mappings=dict(type='list'),
chef=dict(type='dict'), chef=dict(type='dict'),
credentials_path=dict(type='path', default="~/.spotinst/credentials"), credentials_path=dict(type='path', default="~/.spotinst/credentials"),
do_not_update=dict(default=[], type='list'), do_not_update=dict(default=[], type='list'),
down_scaling_policies=dict(type='list', elements='dict'), down_scaling_policies=dict(type='list'),
draining_timeout=dict(type='int'), draining_timeout=dict(type='int'),
ebs_optimized=dict(type='bool'), ebs_optimized=dict(type='bool'),
ebs_volume_pool=dict(type='list', elements='dict'), ebs_volume_pool=dict(type='list'),
ecs=dict(type='dict'), ecs=dict(type='dict'),
elastic_beanstalk=dict(type='dict'), elastic_beanstalk=dict(type='dict'),
elastic_ips=dict(type='list', elements='str'), elastic_ips=dict(type='list'),
fallback_to_od=dict(type='bool'), fallback_to_od=dict(type='bool'),
id=dict(type='str'), id=dict(type='str'),
health_check_grace_period=dict(type='int'), health_check_grace_period=dict(type='int'),
@ -1466,7 +1451,7 @@ def main():
key_pair=dict(type='str', no_log=False), key_pair=dict(type='str', no_log=False),
kubernetes=dict(type='dict'), kubernetes=dict(type='dict'),
lifetime_period=dict(type='int'), lifetime_period=dict(type='int'),
load_balancers=dict(type='list', elements='str'), load_balancers=dict(type='list'),
max_size=dict(type='int', required=True), max_size=dict(type='int', required=True),
mesosphere=dict(type='dict'), mesosphere=dict(type='dict'),
min_size=dict(type='int', required=True), min_size=dict(type='int', required=True),
@ -1474,7 +1459,7 @@ def main():
multai_load_balancers=dict(type='list'), multai_load_balancers=dict(type='list'),
multai_token=dict(type='str', no_log=True), multai_token=dict(type='str', no_log=True),
name=dict(type='str', required=True), name=dict(type='str', required=True),
network_interfaces=dict(type='list', elements='dict'), network_interfaces=dict(type='list'),
on_demand_count=dict(type='int'), on_demand_count=dict(type='int'),
on_demand_instance_type=dict(type='str'), on_demand_instance_type=dict(type='str'),
opsworks=dict(type='dict'), opsworks=dict(type='dict'),
@ -1484,16 +1469,16 @@ def main():
right_scale=dict(type='dict'), right_scale=dict(type='dict'),
risk=dict(type='int'), risk=dict(type='int'),
roll_config=dict(type='dict'), roll_config=dict(type='dict'),
scheduled_tasks=dict(type='list', elements='dict'), scheduled_tasks=dict(type='list'),
security_group_ids=dict(type='list', elements='str', required=True), security_group_ids=dict(type='list', required=True),
shutdown_script=dict(type='str'), shutdown_script=dict(type='str'),
signals=dict(type='list', elements='dict'), signals=dict(type='list'),
spin_up_time=dict(type='int'), spin_up_time=dict(type='int'),
spot_instance_types=dict(type='list', elements='str', required=True), spot_instance_types=dict(type='list', required=True),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
tags=dict(type='list', elements='dict'), tags=dict(type='list'),
target=dict(type='int', required=True), target=dict(type='int', required=True),
target_group_arns=dict(type='list', elements='str'), target_group_arns=dict(type='list'),
tenancy=dict(type='str'), tenancy=dict(type='str'),
terminate_at_end_of_billing_hour=dict(type='bool'), terminate_at_end_of_billing_hour=dict(type='bool'),
token=dict(type='str', no_log=True), token=dict(type='str', no_log=True),
@ -1501,8 +1486,8 @@ def main():
user_data=dict(type='str'), user_data=dict(type='str'),
utilize_reserved_instances=dict(type='bool'), utilize_reserved_instances=dict(type='bool'),
uniqueness_by=dict(default='name', choices=['name', 'id']), uniqueness_by=dict(default='name', choices=['name', 'id']),
up_scaling_policies=dict(type='list', elements='dict'), up_scaling_policies=dict(type='list'),
target_tracking_policies=dict(type='list', elements='dict'), target_tracking_policies=dict(type='list'),
wait_for_instances=dict(type='bool', default=False), wait_for_instances=dict(type='bool', default=False),
wait_timeout=dict(type='int') wait_timeout=dict(type='int')
) )