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

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

* fixed elements for many lists

* added changelog fragment

* Removed verbose types in description - still missing formatting and properly documenting dicts

(cherry picked from commit 48ef05def3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-04-27 11:46:17 +00:00 committed by GitHub
parent 0330f4b52c
commit ea42b75378
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 92 additions and 75 deletions

View file

@ -0,0 +1,2 @@
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:
- (Path) Optional parameter that allows to set a non-default credentials 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:
- (String) Optional parameter that allows to set an account-id inside the module configuration - 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:
- (String) The strategy orientation. - 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:
- (List of Objects) a list of hash/dictionaries of Availability Zones that are configured in the elastigroup; - 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,10 +50,11 @@ 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:
- (List of Objects) a list of hash/dictionaries of Block Device Mappings for elastigroup instances; - 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
@ -68,10 +69,11 @@ options:
volume_type(String), volume_type(String),
volume_size(Integer)) volume_size(Integer))
type: list type: list
elements: dict
chef: chef:
description: description:
- (Object) The Chef integration configuration.; - 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),
@ -81,92 +83,94 @@ options:
draining_timeout: draining_timeout:
description: description:
- (Integer) Time for instance to be drained from incoming requests and deregistered from ELB before termination. - 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:
- (Boolean) Enable EBS optimization for supported instances which are not enabled by default.; - 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:
- (List of Objects) a list of hash/dictionaries of EBS devices to reattach to the elastigroup when available; - 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:
- (Object) The ECS integration configuration.; - 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 Strings) List of ElasticIps Allocation Ids (Example C(eipalloc-9d4e16f8)) to associate to the group instances - 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:
- (Boolean) In case of no spots available, Elastigroup will launch an On-demand instance instead - 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:
- (Integer) The amount of time, in seconds, after the instance has launched to start and check its health. - 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:
- (Integer) Minimal mount of time instance should be unhealthy for us to consider it unhealthy. - 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:
- (String) The service to use for the health check. - 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:
- (String) The instance profile iamRole name - 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:
- (String) The instance profile iamRole arn - 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:
- (String) The group id if it already exists and you want to update, or delete it. - 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:
- (String) The image Id used to launch the instance.; - 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:
- (String) Specify a Key Pair to attach to the instances - Specify a Key Pair to attach to the instances
type: str type: str
kubernetes: kubernetes:
description: description:
- (Object) The Kubernetes integration configuration. - The Kubernetes integration configuration.
Expects the following keys - Expects the following keys -
api_server (String), api_server (String),
token (String) token (String)
@ -174,47 +178,48 @@ options:
lifetime_period: lifetime_period:
description: description:
- (Integer) lifetime period - Lifetime period
type: int type: int
load_balancers: load_balancers:
description: description:
- (List of Strings) List of classic ELB names - List of classic ELB names
type: list type: list
elements: str
max_size: max_size:
description: description:
- (Integer) The upper limit number of instances that you can scale up to - The upper limit number of instances that you can scale up to
required: true required: true
type: int type: int
mesosphere: mesosphere:
description: description:
- (Object) The Mesosphere integration configuration. - 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:
- (Integer) The lower limit number of instances that you can scale down to - The lower limit number of instances that you can scale down to
required: true required: true
type: int type: int
monitoring: monitoring:
description: description:
- (String) Describes whether instance Enhanced Monitoring is enabled - Describes whether instance Enhanced Monitoring is enabled
type: str type: str
name: name:
description: description:
- (String) Unique name for elastigroup to be created, updated or deleted - Unique name for elastigroup to be created, updated or deleted
required: true required: true
type: str type: str
network_interfaces: network_interfaces:
description: description:
- (List of Objects) a list of hash/dictionaries of network interfaces to add to the elastigroup; - 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),
@ -229,29 +234,30 @@ 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:
- (Integer) Required if risk is not set - 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:
- (String) On-demand instance type that will be provisioned - On-demand instance type that will be provisioned
type: str type: str
opsworks: opsworks:
description: description:
- (Object) The elastigroup OpsWorks integration configration.; - 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:
- (Object) The Stateful elastigroup configration.; - 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),
@ -260,14 +266,14 @@ options:
product: product:
description: description:
- (String) Operation system type. - 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:
- (Object) The Rancher integration configuration.; - The Rancher integration configuration.;
Expects the following keys - Expects the following keys -
version (String), version (String),
access_key (String), access_key (String),
@ -277,7 +283,7 @@ options:
right_scale: right_scale:
description: description:
- (Object) The Rightscale integration configuration.; - The Rightscale integration configuration.;
Expects the following keys - Expects the following keys -
account_id (String), account_id (String),
refresh_token (String) refresh_token (String)
@ -285,12 +291,12 @@ options:
risk: risk:
description: description:
- (Integer) required if on demand is not set. The percentage of Spot instances to launch (0 - 100). - 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:
- (Object) Roll configuration.; - 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),
@ -300,7 +306,7 @@ options:
scheduled_tasks: scheduled_tasks:
description: description:
- (List of Objects) a list of hash/dictionaries of scheduled tasks to configure in the elastigroup; - 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),
@ -315,84 +321,90 @@ 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:
- (List of Strings) One or more security group IDs. ; - 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:
- (String) The Base64-encoded shutdown script that executes prior to instance termination. - 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:
- (List of Objects) a list of hash/dictionaries of signals to configure in the elastigroup; - 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:
- (Integer) spin up time, in seconds, for the instance - Spin up time, in seconds, for the instance
type: int type: int
spot_instance_types: spot_instance_types:
description: description:
- (List of Strings) Spot instance type that will be provisioned. - 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:
- (String) create or delete the elastigroup - Create or delete the elastigroup
default: present default: present
type: str type: str
tags: tags:
description: description:
- (List of tagKey:tagValue pairs) a list of tags to configure in the elastigroup. Please specify list of keys and values (key colon value); - 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:
- (Integer) The number of instances to launch - The number of instances to launch
required: true required: true
type: int type: int
target_group_arns: target_group_arns:
description: description:
- (List of Strings) List of target group arns instances should be registered to - List of target group arns instances should be registered to
type: list type: list
elements: str
tenancy: tenancy:
description: description:
- (String) dedicated vs shared tenancy. - 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:
- (Boolean) terminate at the end of billing hour - Terminate at the end of billing hour
type: bool type: bool
unit: unit:
description: description:
- (String) The capacity unit to launch instances by. - 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:
- (List of Objects) a list of hash/dictionaries of scaling policies to configure in the elastigroup; - 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),
@ -413,10 +425,11 @@ options:
maximum (String), maximum (String),
minimum (String) minimum (String)
type: list type: list
elements: dict
down_scaling_policies: down_scaling_policies:
description: description:
- (List of Objects) a list of hash/dictionaries of scaling policies to configure in the elastigroup; - 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),
@ -437,10 +450,11 @@ options:
maximum (String), maximum (String),
minimum (String) minimum (String)
type: list type: list
elements: dict
target_tracking_policies: target_tracking_policies:
description: description:
- (List of Objects) a list of hash/dictionaries of target tracking policies to configure in the elastigroup; - 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),
@ -452,37 +466,38 @@ 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:
- (String) If your group names are not unique, you may use this feature to update or delete a specific group. - 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:
- (String) Base64-encoded MIME user data. Encode before setting the value. - Base64-encoded MIME user data. Encode before setting the value.
type: str type: str
utilize_reserved_instances: utilize_reserved_instances:
description: description:
- (Boolean) In case of any available Reserved Instances, - 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:
- (Boolean) Whether or not the elastigroup creation / update actions should wait for the instances to spin - 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:
- (Integer) How long the module should wait for instances before failing the action.; - 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
@ -1428,18 +1443,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', required=True), availability_zones=dict(type='list', elements='dict', required=True),
block_device_mappings=dict(type='list'), block_device_mappings=dict(type='list', elements='dict'),
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'), down_scaling_policies=dict(type='list', elements='dict'),
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'), ebs_volume_pool=dict(type='list', elements='dict'),
ecs=dict(type='dict'), ecs=dict(type='dict'),
elastic_beanstalk=dict(type='dict'), elastic_beanstalk=dict(type='dict'),
elastic_ips=dict(type='list'), elastic_ips=dict(type='list', elements='str'),
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'),
@ -1451,7 +1466,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'), load_balancers=dict(type='list', elements='str'),
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),
@ -1459,7 +1474,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'), network_interfaces=dict(type='list', elements='dict'),
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'),
@ -1469,16 +1484,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'), scheduled_tasks=dict(type='list', elements='dict'),
security_group_ids=dict(type='list', required=True), security_group_ids=dict(type='list', elements='str', required=True),
shutdown_script=dict(type='str'), shutdown_script=dict(type='str'),
signals=dict(type='list'), signals=dict(type='list', elements='dict'),
spin_up_time=dict(type='int'), spin_up_time=dict(type='int'),
spot_instance_types=dict(type='list', required=True), spot_instance_types=dict(type='list', elements='str', required=True),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
tags=dict(type='list'), tags=dict(type='list', elements='dict'),
target=dict(type='int', required=True), target=dict(type='int', required=True),
target_group_arns=dict(type='list'), target_group_arns=dict(type='list', elements='str'),
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),
@ -1486,8 +1501,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'), up_scaling_policies=dict(type='list', elements='dict'),
target_tracking_policies=dict(type='list'), target_tracking_policies=dict(type='list', elements='dict'),
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')
) )