-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ec2_launch_template doesn't process arguments correctly #230
Comments
Files identified in the description: If these files are inaccurate, please update the |
I am having related issue with the
However, it fails in 2.10.0 (ansible-base 2.10.0 - 2.10.2) with:
Edit: I am also experiencing the same error on ansible 2.9.13 with community.aws:1.2.0 . |
I am also having an issue with this module.
|
The existing The current implementation of the scrub helper function doesn't recursively apply to lists of dicts. adding another conditional branch to elif isinstance(v, list):
clean_parameters[k] = [scrub_none_parameters(vv) if isinstance(vv, dict) else vv for vv in v] and then switching the cleanup code in |
Have the same issues with params that should be optional or not even allowed in combination. For example Also for volumes not all params should be mandatory, like
block device section defined in play: [...]
block_device_mappings:
- device_name: /dev/sda1
ebs:
volume_type: gp2
volume_size: 20
delete_on_termination: true
encrypted: true
- device_name: /dev/sdb
ebs:
volume_type: gp2
volume_size: 200
delete_on_termination: true
encrypted: true
[...] Using Ansible 2.10.5 |
It would be ideal if params that didn't need to be changed could be left
blank AND a flag was set to inherit or not inherit the previously defined
version template. Any configs provided by the user would overwrite the
default.
…On Mon, Feb 22, 2021 at 12:24 PM Stefan Horning ***@***.***> wrote:
Have the same issues with params that should be optional or not even
allowed in combination.
For example
LaunchTemplateData.InstanceMarketOptions.SpotOptions.BlockDurationMinutes
should be optional as I don't want my instance to stop running when I
define it a spot instance
Also for volumes not all params should be mandatory, like
Invalid type for parameter LaunchTemplateData.BlockDeviceMappings[1].Ebs.Iops, value: None, type: <class 'NoneType'>, valid types: <class 'int'>
Invalid type for parameter LaunchTemplateData.BlockDeviceMappings[1].Ebs.KmsKeyId, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
Invalid type for parameter LaunchTemplateData.BlockDeviceMappings[1].Ebs.SnapshotId, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
Invalid type for parameter LaunchTemplateData.BlockDeviceMappings[1].NoDevice, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
Invalid type for parameter LaunchTemplateData.BlockDeviceMappings[1].VirtualName, value: None, type: <class 'NoneType'>, valid types: <class 'str'>"}
- gp2 volumes have no iops param
- KmsKeyId is not needed when enrypting with default AWS key
- SnapshotId (not sure why needed when just defining a volume)
- not even shure what the last two params do, but they are usually not
needed in other modules or AWS tooling (unless you do s.th exotic
maybe)
block device section defined in play:
[...]
block_device_mappings:
- device_name: /dev/sda1
ebs:
volume_type: gp2
volume_size: 20
delete_on_termination: true
encrypted: true
- device_name: /dev/sdb
ebs:
volume_type: gp2
volume_size: 200
delete_on_termination: true
encrypted: true[...]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#230 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABI2ZYAKWEYB47JAOJS62ILTAKHOFANCNFSM4RPBR5BA>
.
|
Also the fix in #413 didn't work for me. As far I can see the None values are already excluded in https://github.com/ansible-collections/community.aws/blob/main/plugins/modules/ec2_launch_template.py#L441 anyhow. Probably None values need to be cleaned on all levels still. |
This issue should be fixed by #438 which was merged this morning. |
ec2_launch_template doesn't process arguments correctly
SUMMARY
ec2_launch_template module passes unset parameters as "None" to the boto3 calls instead of not setting them at all.
ISSUE TYPE
COMPONENT NAME
ec2_launch_template.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible is launched from
debian:buster-slim
docker imageSTEPS TO REPRODUCE
Run this task
EXPECTED RESULTS
Launch template gets created
ACTUAL RESULTS
Creation fails with the next error:
Additionaly, if I set
Ipv6AddressCount
to 0, it still tells about Invalid type ofIpv6Addresses
parameter, considering that those two are mutually excluding.The text was updated successfully, but these errors were encountered: