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 assign_public ip for ecs_service #41685

Merged

Conversation

Deepakkothandan
Copy link
Contributor

SUMMARY

ecs_service.py: "network_configuration" for "awsvpc" is missing "assign_public_ip" #41291

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/cloud/amazon/ecs_service.py

ANSIBLE VERSION
ansible 2.7.0.dev0 (fix/EcsServiceAutoAssignPublicIP 4f159fe36a) last updated 2018/06/19 13:21:17 (GMT +200)
  config file = None
  configured module search path = [u'/Users/deepak/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/deepak/devel/python/ansible/lib/ansible
  executable location = /Users/deepak/devel/python/ansible/bin/ansible
  python version = 2.7.10 (default, Oct  6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]

@ansibot
Copy link
Contributor

ansibot commented Jun 19, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 aws bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. 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. test This PR relates to tests. labels Jun 19, 2018
@@ -324,6 +327,10 @@ def format_network_configuration(self, network_config):
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
self.module.fail_json_aws(e, msg="Couldn't look up security groups")
result['securityGroups'] = groups
if 'assign_public_ip' in network_config and botocore_version >= distutils.version.StrictVersion('1.8.4'):
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be replaced with module.botocore_at_least('1.8.4') and the distutils call on line 316 can be removed. AnsibleAWSModule now has convenience functions for checking the boto3/botocore versions here

@ryansb ryansb removed the needs_triage Needs a first human triage before being processed. label Jun 19, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jun 19, 2018
@ryansb ryansb requested a review from s-hertel June 19, 2018 12:33
@s-hertel s-hertel merged commit 5a72eef into ansible:devel Jun 19, 2018
@s-hertel
Copy link
Contributor

Thanks @Deepakkothandan!

@Deepakkothandan
Copy link
Contributor Author

Deepakkothandan commented Jun 19, 2018

@s-hertel you are welcome, but I just noticed a small issue with the PR, missed it during commit. The line 329 should be result['assign_public_ip'] = network_config['assign_public_ip'] and not result['assign_public_ip'] ='assign_public_ip'. Could you please change this or I can make another PR. sorry for the inconvenience.

@s-hertel
Copy link
Contributor

Opening a fix @Deepakkothandan, thanks for catching that

jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
…#41685)

* fix assign_public ip for ecs_service

* used module.botocore_at_least instead of distutils
@ansible ansible locked and limited conversation to collaborators Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants