Skip to content
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_ami_facts should take nonstrings as filter arguments #43570

Closed
tedder opened this issue Aug 1, 2018 · 5 comments
Closed

ec2_ami_facts should take nonstrings as filter arguments #43570

tedder opened this issue Aug 1, 2018 · 5 comments
Labels
affects_2.6 This issue/PR affects Ansible v2.6 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.

Comments

@tedder
Copy link
Contributor

tedder commented Aug 1, 2018

SUMMARY

Booleans or numbers passed to most AWS APIs need to be cast to strings or they die. (this might be better fixed in ansible_dict_to_boto3_filter_list than in _facts)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ec2_ami_facts

ANSIBLE VERSION
2.6.0
CONFIGURATION

not relevant

OS / ENVIRONMENT

not relevant

STEPS TO REPRODUCE
- name: find
  ec2_ami_facts:
    region: "{{region}}"
    filters:
      architecture: x86_64
      is-public: true
      name: "amzn-ami-2018.03.c-amazon-ecs-optimized"
      owner-id: 591542846629 # amazon's id

The second and fourth lines are 'bad'- one is a number, one is a bool, both fail.

EXPECTED RESULTS

results to be returned.
I expected it to work.

ACTUAL RESULTS

It died.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Invalid type for parameter Filters[2].Values, value: True, type: <class 'bool'>, valid types: <class 'list'>, <class 'tuple'>
fatal: [localhost]: FAILED! => {"changed": false, "msg": "error describing images: Parameter validation failed:\nInvalid type for parameter Filters[1].Values, value: 591542846629, type: <class 'int'>, valid types: <class 'list'>, <class 'tuple'>\nInvalid type for parameter Filters[2].Values, value: True, type: <class 'bool'>, valid types: <class 'list'>, <class 'tuple'>"}

(after fixing the bool)

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Invalid type for parameter Filters[6].Values, value: 591542846629, type: <class 'int'>, valid types: <class 'list'>, <class 'tuple'>
fatal: [localhost]: FAILED! => {"changed": false, "msg": "error describing images: Parameter validation failed:\nInvalid type for parameter Filters[6].Values, value: 591542846629, type: <class 'int'>, valid types: <class 'list'>, <class 'tuple'>"}

@ansibot
Copy link
Contributor

ansibot commented Aug 1, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Aug 1, 2018

@ansibot
Copy link
Contributor

ansibot commented Aug 1, 2018

Hi @tedder,

Thank you for the issue, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback. labels Aug 1, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Aug 2, 2018
@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Sep 19, 2018
@ansibot ansibot added needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 5, 2018
@ansibot ansibot removed the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Nov 9, 2018
@san7ket
Copy link
Contributor

san7ket commented Nov 14, 2018

@tedder Can you verify if the fix works for you?

@tedder
Copy link
Contributor Author

tedder commented Nov 14, 2018

yep, that fixes it for me!

@tedder tedder closed this as completed Nov 14, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants