diff options
author | Sean Summers <ssummer3@nd.edu> | 2016-11-08 17:23:26 -0500 |
---|---|---|
committer | Ryan S. Brown <sb@ryansb.com> | 2016-11-09 12:41:53 -0500 |
commit | f31a71c4cfc543894a8731fbbfbc6dab06f6dcf6 (patch) | |
tree | dfe883d4c1f1a2c10127595aa3eb7c9d45282f3f | |
parent | 80b69c4821d8ab61b19a2a89ed743c1cc9c0de5d (diff) | |
download | ansible-modules-core-f31a71c4cfc543894a8731fbbfbc6dab06f6dcf6.tar.gz |
add role_arn to support Service Role
Add `role_arn` to support [AWS CloudFormation Service Role](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-servicerole.html)
-rw-r--r-- | cloud/amazon/cloudformation.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cloud/amazon/cloudformation.py b/cloud/amazon/cloudformation.py index 3ea1017d..e9f14de1 100644 --- a/cloud/amazon/cloudformation.py +++ b/cloud/amazon/cloudformation.py @@ -87,6 +87,12 @@ options: choices: [ json, yaml ] required: false version_added: "2.0" + role_arn: + description: + - The role that AWS CloudFormation assumes to create the stack. [AWS CloudFormation Service Role](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-servicerole.html) + required: false + default: null + version_added: "2.3" author: "James S. Martin (@jsmartin)" extends_documentation_fragment: @@ -147,6 +153,22 @@ EXAMPLES = ''' ClusterSize: 3 tags: Stack: ansible-cloudformation + +# Use a template from a URL, and assume a role to execute +- name: launch ansible cloudformation example with role assumption + cloudformation: + stack_name="ansible-cloudformation" state=present + region=us-east-1 disable_rollback=true + template_url=https://s3.amazonaws.com/my-bucket/cloudformation.template + role_arn: arn:aws:iam::123456789012:role/cloudformation-iam-role + args: + template_parameters: + KeyName: jmartin + DiskType: ephemeral + InstanceType: m1.small + ClusterSize: 3 + tags: + Stack: ansible-cloudformation ''' RETURN = ''' @@ -339,6 +361,7 @@ def main(): disable_rollback=dict(default=False, type='bool'), template_url=dict(default=None, required=False), template_format=dict(default=None, choices=['json', 'yaml'], required=False), + role_arn=dict(default=None, required=False), tags=dict(default=None, type='dict') ) ) @@ -381,6 +404,9 @@ def main(): if module.params.get('template_url'): stack_params['TemplateURL'] = module.params['template_url'] + if module.params.get('role_arn'): + stack_params['RoleARN'] = module.params['role_arn'] + update = False result = {} |