-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Add execution_role_arn parameter #41849
Conversation
The test
The test
|
Botocore version checking is becomming more common. Changing the ecs_taskdefinition to use AnsibleAWSmodule allows more easily for this.
@@ -319,6 +326,10 @@ def main(): | |||
if not task_mgr.ecs_api_supports_requirescompatibilities(): | |||
module.fail_json(msg='botocore needs to be version 1.8.4 or higher to use launch_type') | |||
|
|||
if module.params['task_role_arn']: | |||
if not module.botocore_at_least('1.10.44'): |
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.
Thanks for adding this! Do you mind doing the same for launch_type above by replacing if not task_mgr.ecs_api_supports_requirescompatibilities():
with if not module.botocore_at_least('1.8.4'):
?
@@ -225,6 +230,7 @@ def register_task(self, family, task_role_arn, network_mode, container_definitio | |||
params = dict( | |||
family=family, | |||
taskRoleArn=task_role_arn, | |||
executionRoleArn=execution_role_arn, |
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.
executionRoleArn must not be set if it's not required, otherwise anyone relying on this module will need to upgrade to a very recent botocore.
It's worth noting that this fails the existing test suite.
|
Could we have a test for this change? |
- AmazonEC2ContainerServiceRole | ||
<<: *aws_connection_info | ||
|
||
- name: gather facts for the ecsTaskExecutionRole |
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.
Should be able to access this from register
ing the results of the previous task
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 registered the output from iam_role task and reran the tests. The tests passed.
Task was unecessary. The same information could be gathered by registering the iam_role task.
Merged, thanks @mjmayer |
SUMMARY
Fargate support requires containers to have the executionRoleArn defined. This PR adds that parameter.
Fixes #41848
ISSUE TYPE
COMPONENT NAME
ecs_taskdefinition
ANSIBLE VERSION