mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Tidy up validate-modules:no-default-for-required-parameter and other cases (#1423)
* Fixed validate-modules:mutually_exclusive-unknown for plugins/modules/packaging/os/redhat_subscription.py * fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py * fixed validation-modules for plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py * fixed validation-modules for plugins/modules/cloud/opennebula/one_host.py * fixed validation-modules for plugins/modules/cloud/opennebula/one_image_info.py * fixed validation-modules for plugins/modules/cloud/opennebula/one_image.py * fixed validation-modules for plugins/modules/cloud/opennebula/one_service.py * fixed validation-modules for plugins/modules/cloud/opennebula/one_vm.py * fixed validation-modules for plugins/modules/net_tools/cloudflare_dns.py * fixed validation-modules for plugins/modules/net_tools/ip_netns.py * fixed validation-modules for plugins/modules/net_tools/ipinfoio_facts.py * fixed validation-modules for plugins/modules/net_tools/netcup_dns.py * fixed validation-modules for plugins/modules/remote_management/wakeonlan.py * added types to plugins/modules/remote_management/stacki/stacki_host.py but still cannot remove ignore line * added a couple of FIXME comments * fixed validation-modules for plugins/modules/remote_management/manageiq/manageiq_provider.py * fixed validation-modules for plugins/modules/notification/rocketchat.py * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py * fixed validation-modules for plugins/modules/identity/keycloak/keycloak_clienttemplate.py * fixed validation-modules for plugins/modules/cloud/univention/udm_user.py * fixed validation-modules for plugins/modules/cloud/univention/udm_group.py * fixed validation-modules for plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py * fixed validation-modules for plugins/modules/cloud/smartos/imgadm.py * fixed validation-modules for plugins/modules/cloud/profitbricks/profitbricks_nic.py * fixed validation-modules for plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py * Tidy up validate-modules ignores no-default-for-required-parameter + couple of other cases * Added changelog frag * fixed validation-modules for plugins/modules/cloud/centurylink/clc_alert_policy.py * fixed validation-modules for plugins/modules/cloud/centurylink/clc_firewall_policy.py * fixed validation-modules for plugins/modules/cloud/lxd/lxd_profile.py * Typos and small fixes * fixed validation-modules for plugins/modules/net_tools/ldap/ldap_passwd.py * Typos and small fixes, part 2 * Fixes from PR comments * Update plugins/modules/cloud/profitbricks/profitbricks_nic.py Co-authored-by: Felix Fontein <felix@fontein.de> * Rolled back the mutually-exclusive-unknown in redhat_subscription * Update changelogs/fragments/1423-valmod_multiple_cases.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
b8794c35e8
commit
ae0d3cb090
34 changed files with 411 additions and 279 deletions
|
@ -23,19 +23,22 @@ options:
|
|||
|
||||
credentials_path:
|
||||
description:
|
||||
- (String) Optional parameter that allows to set a non-default credentials path.
|
||||
Default is ~/.spotinst/credentials
|
||||
- (Path) Optional parameter that allows to set a non-default credentials path.
|
||||
default: ~/.spotinst/credentials
|
||||
type: path
|
||||
|
||||
account_id:
|
||||
description:
|
||||
- (String) Optional parameter that allows to set an account-id inside the module configuration
|
||||
By default this is retrieved from the credentials path
|
||||
type: str
|
||||
|
||||
availability_vs_cost:
|
||||
description:
|
||||
- (String) The strategy orientation.
|
||||
- "The choices available are: C(availabilityOriented), C(costOriented), C(balanced)."
|
||||
required: true
|
||||
type: str
|
||||
|
||||
availability_zones:
|
||||
description:
|
||||
|
@ -46,6 +49,7 @@ options:
|
|||
subnet_id (String),
|
||||
placement_group_name (String),
|
||||
required: true
|
||||
type: list
|
||||
|
||||
block_device_mappings:
|
||||
description:
|
||||
|
@ -63,6 +67,7 @@ options:
|
|||
snapshot_id(Integer),
|
||||
volume_type(String),
|
||||
volume_size(Integer))
|
||||
type: list
|
||||
|
||||
chef:
|
||||
description:
|
||||
|
@ -72,10 +77,12 @@ options:
|
|||
user (String),
|
||||
pem_key (String),
|
||||
chef_version (String)
|
||||
type: dict
|
||||
|
||||
draining_timeout:
|
||||
description:
|
||||
- (Integer) Time for instance to be drained from incoming requests and deregistered from ELB before termination.
|
||||
type: int
|
||||
|
||||
ebs_optimized:
|
||||
description:
|
||||
|
@ -90,61 +97,72 @@ options:
|
|||
keys allowed are -
|
||||
volume_ids (List of Strings),
|
||||
device_name (String)
|
||||
type: list
|
||||
|
||||
ecs:
|
||||
description:
|
||||
- (Object) The ECS integration configuration.;
|
||||
Expects the following key -
|
||||
cluster_name (String)
|
||||
|
||||
type: dict
|
||||
|
||||
elastic_ips:
|
||||
description:
|
||||
- (List of Strings) List of ElasticIps Allocation Ids (Example C(eipalloc-9d4e16f8)) to associate to the group instances
|
||||
type: list
|
||||
|
||||
fallback_to_od:
|
||||
description:
|
||||
- (Boolean) In case of no spots available, Elastigroup will launch an On-demand instance instead
|
||||
type: bool
|
||||
|
||||
health_check_grace_period:
|
||||
description:
|
||||
- (Integer) The amount of time, in seconds, after the instance has launched to start and check its health.
|
||||
default: 300
|
||||
- If not specified, it defaults to C(300).
|
||||
type: int
|
||||
|
||||
health_check_unhealthy_duration_before_replacement:
|
||||
description:
|
||||
- (Integer) Minimal mount of time instance should be unhealthy for us to consider it unhealthy.
|
||||
type: int
|
||||
|
||||
health_check_type:
|
||||
description:
|
||||
- (String) The service to use for the health check.
|
||||
- "The choices available are: C(ELB), C(HCS), C(TARGET_GROUP), C(MLB), C(EC2)."
|
||||
type: str
|
||||
|
||||
iam_role_name:
|
||||
description:
|
||||
- (String) The instance profile iamRole name
|
||||
- Only use iam_role_arn, or iam_role_name
|
||||
type: str
|
||||
|
||||
iam_role_arn:
|
||||
description:
|
||||
- (String) The instance profile iamRole arn
|
||||
- Only use iam_role_arn, or iam_role_name
|
||||
type: str
|
||||
|
||||
id:
|
||||
description:
|
||||
- (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.
|
||||
When this is set, and the uniqueness_by field is set, the group will either be updated or deleted, but not created.
|
||||
type: str
|
||||
|
||||
image_id:
|
||||
description:
|
||||
- (String) The image Id used to launch the instance.;
|
||||
In case of conflict between Instance type and image type, an error will be returned
|
||||
required: true
|
||||
type: str
|
||||
|
||||
key_pair:
|
||||
description:
|
||||
- (String) Specify a Key Pair to attach to the instances
|
||||
type: str
|
||||
|
||||
kubernetes:
|
||||
description:
|
||||
|
@ -152,39 +170,47 @@ options:
|
|||
Expects the following keys -
|
||||
api_server (String),
|
||||
token (String)
|
||||
type: dict
|
||||
|
||||
lifetime_period:
|
||||
description:
|
||||
- (String) lifetime period
|
||||
- (Integer) lifetime period
|
||||
type: int
|
||||
|
||||
load_balancers:
|
||||
description:
|
||||
- (List of Strings) List of classic ELB names
|
||||
type: list
|
||||
|
||||
max_size:
|
||||
description:
|
||||
- (Integer) The upper limit number of instances that you can scale up to
|
||||
required: true
|
||||
type: int
|
||||
|
||||
mesosphere:
|
||||
description:
|
||||
- (Object) The Mesosphere integration configuration.
|
||||
Expects the following key -
|
||||
api_server (String)
|
||||
type: dict
|
||||
|
||||
min_size:
|
||||
description:
|
||||
- (Integer) The lower limit number of instances that you can scale down to
|
||||
required: true
|
||||
type: int
|
||||
|
||||
monitoring:
|
||||
description:
|
||||
- (Boolean) Describes whether instance Enhanced Monitoring is enabled
|
||||
- (String) Describes whether instance Enhanced Monitoring is enabled
|
||||
type: str
|
||||
|
||||
name:
|
||||
description:
|
||||
- (String) Unique name for elastigroup to be created, updated or deleted
|
||||
required: true
|
||||
type: str
|
||||
|
||||
network_interfaces:
|
||||
description:
|
||||
|
@ -202,22 +228,26 @@ options:
|
|||
subnet_id (String),
|
||||
associate_ipv6_address (Boolean),
|
||||
private_ip_addresses (List of Objects, Keys are privateIpAddress (String, required) and primary (Boolean))
|
||||
type: list
|
||||
|
||||
on_demand_count:
|
||||
description:
|
||||
- (Integer) Required if risk is not set
|
||||
- Number of on demand instances to launch. All other instances will be spot instances.;
|
||||
Either set this parameter or the risk parameter
|
||||
type: int
|
||||
|
||||
on_demand_instance_type:
|
||||
description:
|
||||
- (String) On-demand instance type that will be provisioned
|
||||
type: str
|
||||
|
||||
opsworks:
|
||||
description:
|
||||
- (Object) The elastigroup OpsWorks integration configration.;
|
||||
Expects the following key -
|
||||
layer_id (String)
|
||||
type: dict
|
||||
|
||||
persistence:
|
||||
description:
|
||||
|
@ -226,12 +256,14 @@ options:
|
|||
should_persist_root_device (Boolean),
|
||||
should_persist_block_devices (Boolean),
|
||||
should_persist_private_ip (Boolean)
|
||||
type: dict
|
||||
|
||||
product:
|
||||
description:
|
||||
- (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))."
|
||||
required: true
|
||||
type: str
|
||||
|
||||
rancher:
|
||||
description:
|
||||
|
@ -241,6 +273,7 @@ options:
|
|||
access_key (String),
|
||||
secret_key (String),
|
||||
master_host (String)
|
||||
type: dict
|
||||
|
||||
right_scale:
|
||||
description:
|
||||
|
@ -248,10 +281,12 @@ options:
|
|||
Expects the following keys -
|
||||
account_id (String),
|
||||
refresh_token (String)
|
||||
type: dict
|
||||
|
||||
risk:
|
||||
description:
|
||||
- (Integer) required if on demand is not set. The percentage of Spot instances to launch (0 - 100).
|
||||
type: int
|
||||
|
||||
roll_config:
|
||||
description:
|
||||
|
@ -261,6 +296,7 @@ options:
|
|||
batch_size_percentage(Integer, Required),
|
||||
grace_period - (Integer, Required),
|
||||
health_check_type(String, Optional)
|
||||
type: dict
|
||||
|
||||
scheduled_tasks:
|
||||
description:
|
||||
|
@ -278,17 +314,20 @@ options:
|
|||
grace_period (Integer),
|
||||
task_type (String, required),
|
||||
is_enabled (Boolean)
|
||||
type: list
|
||||
|
||||
security_group_ids:
|
||||
description:
|
||||
- (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
|
||||
required: true
|
||||
type: list
|
||||
|
||||
shutdown_script:
|
||||
description:
|
||||
- (String) The Base64-encoded shutdown script that executes prior to instance termination.
|
||||
Encode before setting.
|
||||
type: str
|
||||
|
||||
signals:
|
||||
description:
|
||||
|
@ -296,15 +335,18 @@ options:
|
|||
keys allowed are -
|
||||
name (String, required),
|
||||
timeout (Integer)
|
||||
type: list
|
||||
|
||||
spin_up_time:
|
||||
description:
|
||||
- (Integer) spin up time, in seconds, for the instance
|
||||
type: int
|
||||
|
||||
spot_instance_types:
|
||||
description:
|
||||
- (List of Strings) Spot instance type that will be provisioned.
|
||||
required: true
|
||||
type: list
|
||||
|
||||
state:
|
||||
choices:
|
||||
|
@ -312,33 +354,41 @@ options:
|
|||
- absent
|
||||
description:
|
||||
- (String) create or delete the elastigroup
|
||||
default: present
|
||||
type: str
|
||||
|
||||
tags:
|
||||
description:
|
||||
- (List of tagKey:tagValue paris) 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
|
||||
|
||||
target:
|
||||
description:
|
||||
- (Integer) The number of instances to launch
|
||||
required: true
|
||||
type: int
|
||||
|
||||
target_group_arns:
|
||||
description:
|
||||
- (List of Strings) List of target group arns instances should be registered to
|
||||
type: list
|
||||
|
||||
tenancy:
|
||||
description:
|
||||
- (String) dedicated vs shared tenancy.
|
||||
- "The available choices are: C(default), C(dedicated)."
|
||||
type: str
|
||||
|
||||
terminate_at_end_of_billing_hour:
|
||||
description:
|
||||
- (Boolean) terminate at the end of billing hour
|
||||
type: bool
|
||||
|
||||
unit:
|
||||
description:
|
||||
- (String) The capacity unit to launch instances by.
|
||||
- "The available choices are: C(instance), C(weight)."
|
||||
type: str
|
||||
|
||||
up_scaling_policies:
|
||||
description:
|
||||
|
@ -362,7 +412,7 @@ options:
|
|||
target (String),
|
||||
maximum (String),
|
||||
minimum (String)
|
||||
|
||||
type: list
|
||||
|
||||
down_scaling_policies:
|
||||
description:
|
||||
|
@ -386,6 +436,7 @@ options:
|
|||
target (String),
|
||||
maximum (String),
|
||||
minimum (String)
|
||||
type: list
|
||||
|
||||
target_tracking_policies:
|
||||
description:
|
||||
|
@ -400,6 +451,7 @@ options:
|
|||
unit (String, required),
|
||||
cooldown (String, required),
|
||||
target (String, required)
|
||||
type: list
|
||||
|
||||
uniqueness_by:
|
||||
choices:
|
||||
|
@ -408,12 +460,13 @@ options:
|
|||
description:
|
||||
- (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.
|
||||
|
||||
default: name
|
||||
type: str
|
||||
|
||||
user_data:
|
||||
description:
|
||||
- (String) Base64-encoded MIME user data. Encode before setting the value.
|
||||
|
||||
type: str
|
||||
|
||||
utilize_reserved_instances:
|
||||
description:
|
||||
|
@ -430,6 +483,7 @@ options:
|
|||
description:
|
||||
- (Integer) How long the module should wait for instances before failing the action.;
|
||||
Only works if wait_for_instances is True.
|
||||
type: int
|
||||
|
||||
'''
|
||||
EXAMPLES = '''
|
||||
|
@ -877,7 +931,6 @@ multai_fields = ('multai_token',)
|
|||
|
||||
def handle_elastigroup(client, module):
|
||||
has_changed = False
|
||||
should_create = False
|
||||
group_id = None
|
||||
message = 'None'
|
||||
|
||||
|
@ -970,7 +1023,7 @@ def retrieve_group_instances(client, module, group_id):
|
|||
healthy_instances = client.get_instance_healthiness(group_id=group_id)
|
||||
|
||||
for healthy_instance in healthy_instances:
|
||||
if(healthy_instance.get('healthStatus') == 'HEALTHY'):
|
||||
if healthy_instance.get('healthStatus') == 'HEALTHY':
|
||||
amount_of_fulfilled_instances += 1
|
||||
instances.append(healthy_instance)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue