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

Fix container param typing #249

Closed
wants to merge 1 commit into from

Conversation

cThrice
Copy link

@cThrice cThrice commented Oct 1, 2020

SUMMARY

The container param was incorrectly set as a STR. Updated to correct type of DICT.
Additionally added some additional text to docs to assist in finding potential container options

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ecs_taskdefinition

ADDITIONAL INFORMATION
- name: Deploy taskdef
  hosts: localhost
  tasks:
    - name: Create task definition
      run_once: true
      ecs_taskdefinition:
        force_create: true
        family: nginx
        state: present
        launch_type: FARGATE
        cpu: 2048
        memory: 4096
        network_mode: awsvpc
        containers:
          - name: nginx
            essential: true
            image: "nginx"
fatal: [localhost]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDERR:

Traceback (most recent call last):
  File "<stdin>", line 102, in <module>
  File "<stdin>", line 94, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  File "/Users/user/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/Users/user/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/Users/user/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/var/folders/ky/_q58mhx922v_6h35pl4p57bc0000gn/T/ansible_ecs_taskdefinition_payload_7kb3qm_a/ansible_ecs_taskdefinition_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_taskdefinition.py", line 517, in <module>
  File "/var/folders/ky/_q58mhx922v_6h35pl4p57bc0000gn/T/ansible_ecs_taskdefinition_payload_7kb3qm_a/ansible_ecs_taskdefinition_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_taskdefinition.py", line 353, in main
AttributeError: 'str' object has no attribute 'get'

After applying fix, error resolved and taskdef was corrected successfully

The container param was incorrectly set as a STR.  Updated to correct type of DICT.
Additionally added some additional text to docs to assist in finding potential container options
Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for taking the time to submit this PR.

A couple of things:

It looks like the reason this one slipped through is that the tests are currently disabled

@@ -44,10 +44,10 @@
type: bool
containers:
description:
- A list of containers definitions.
- A list of containers definitions. You can find the full list of options in the boto3 docs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- A list of containers definitions. You can find the full list of options in the boto3 docs.
- A list of containers definitions.
- 'A full list of options can be found in the boto3 docs in the containerDefinitions argument to register_task_definition :
U(https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.register_task_definition)'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update docs in #238

@Surgo
Copy link
Contributor

Surgo commented Nov 4, 2020

@cThrice Would it be okay to fix in #238?

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) python3 small_patch Hopefully easy to review stale_ci CI is older than 7 days, rerun before merging traceback labels Nov 16, 2020
@goneri
Copy link
Member

goneri commented Feb 19, 2021

This issue should be fixed by #284. @cThrice can you check it works for you (main branch or 1.3.0 or greater)?

@goneri goneri closed this Feb 19, 2021
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
)

ec2_metadata_facts: fixing generated doc render

SUMMARY

Fixing the rendering of generated docs for ec2_metadata_facts as items within < > tags are being parsed out.
Fixes ansible-collections#249

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_metadata_facts

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 bug This issue/PR relates to a bug module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) python3 small_patch Hopefully easy to review stale_ci CI is older than 7 days, rerun before merging traceback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants