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
Allow default network mode, as required for windows containers. #59597
Conversation
The test
The test
|
@ksagle77, just so you are aware we have a dedicated Working Group for aws. |
This would be really nice to have in the next release |
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html seems to show when not set it'll default to 'bridge' which is what this module also does. Could you provide some information to show when / why this is necessary? |
Hey Mark, The issue is that docker for windows has it's own networking mode (NAT), which requires that no network mode is selected. Choosing bridge causes it to fail. From https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html:
Kevin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor things here.
- Could you add a changelog fragment https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs
- Please add something to the description to explain what 'default' does
@@ -62,7 +62,7 @@ | |||
- C(awsvpc) mode was added in Ansible 2.5 | |||
required: false | |||
default: bridge | |||
choices: [ 'bridge', 'host', 'none', 'awsvpc' ] | |||
choices: [ 'default', 'bridge', 'host', 'none', 'awsvpc' ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see the effect of 'default' documented in the description above.
Hey Mark, I've added the change fragment and a description. Let me know if it should be more detailed. Kevin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tiny tweaks in the wording, but generally looking good to me.
The test
The test
|
Co-Authored-By: Mark Chappell <mchappel@redhat.com>
Co-Authored-By: Mark Chappell <mchappel@redhat.com>
@@ -298,7 +302,7 @@ def main(): | |||
revision=dict(required=False, type='int'), | |||
force_create=dict(required=False, default=False, type='bool'), | |||
containers=dict(required=False, type='list'), | |||
network_mode=dict(required=False, default='bridge', choices=['bridge', 'host', 'none', 'awsvpc'], type='str'), | |||
network_mode=dict(required=False, default='bridge', choices=['default','bridge', 'host', 'none', 'awsvpc'], type='str'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
network_mode=dict(required=False, default='bridge', choices=['default','bridge', 'host', 'none', 'awsvpc'], type='str'), | |
network_mode=dict(required=False, default='bridge', choices=['default', 'bridge', 'host', 'none', 'awsvpc'], type='str'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, didn't realize that. Adding it back, thanks.
Co-Authored-By: Mark Chappell <mchappel@redhat.com>
Co-Authored-By: Mark Chappell <mchappel@redhat.com>
One last change (removing the duplicate text, unfortunately GitHub doesn't let you make suggestions against multiple lines yet) and then I think we're good to go. |
Co-Authored-By: Mark Chappell <mchappel@redhat.com>
Removed. Thanks for the help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tests pass locally, thanks very much for this patch @ksagle77!
LGTM |
bot_status |
Componentschangelogs/fragments/59597-ecs-allow_default_network_mode.yml lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py Metadatawaiting_on: maintainer |
…ble#59597) * Allow default network option for network_mode, required for windows containers. * Add change fragment and param description * Update changelogs/fragments/59597-ecs-allow_default_network_mode.yml Co-Authored-By: Mark Chappell <mchappel@redhat.com> * Update lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py Co-Authored-By: Mark Chappell <mchappel@redhat.com> * Correct descriptions. Remove whitespaces. * Remove empty line. * Add single space after comma * Update lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py Co-Authored-By: Mark Chappell <mchappel@redhat.com> * Update lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py Co-Authored-By: Mark Chappell <mchappel@redhat.com> * Update lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py Co-Authored-By: Mark Chappell <mchappel@redhat.com> Co-authored-by: kevinsagle <44478308+kevinsagle@users.noreply.github.com> Co-authored-by: Mark Chappell <mchappel@redhat.com>
SUMMARY
Windows containers require the network mode. In boto3, this is configured by not passing a network_mode paramter, but this mode is not supported by this module.
ISSUE TYPE
COMPONENT NAME
cloud
ADDITIONAL INFORMATION