|
|
|
|
@ -325,9 +325,7 @@ try:
|
|
|
|
|
except ImportError:
|
|
|
|
|
HAS_BOTO3 = False
|
|
|
|
|
|
|
|
|
|
import ansible.module_utils.ec2
|
|
|
|
|
# import a class, otherwise we'll use a fully qualified path
|
|
|
|
|
from ansible.module_utils.ec2 import AWSRetry, boto_exception
|
|
|
|
|
from ansible.module_utils.ec2 import ansible_dict_to_boto3_tag_list, AWSRetry, boto3_conn, boto_exception, ec2_argument_spec, get_aws_connection_info
|
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
|
from ansible.module_utils._text import to_bytes, to_native
|
|
|
|
|
|
|
|
|
|
@ -621,7 +619,7 @@ def get_stack_facts(cfn, stack_name):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
argument_spec = ansible.module_utils.ec2.ec2_argument_spec()
|
|
|
|
|
argument_spec = ec2_argument_spec()
|
|
|
|
|
argument_spec.update(dict(
|
|
|
|
|
stack_name=dict(required=True),
|
|
|
|
|
template_parameters=dict(required=False, type='dict', default={}),
|
|
|
|
|
@ -713,7 +711,7 @@ def main():
|
|
|
|
|
stack_params['Parameters'].append({'ParameterKey': k, 'ParameterValue': str(v)})
|
|
|
|
|
|
|
|
|
|
if isinstance(module.params.get('tags'), dict):
|
|
|
|
|
stack_params['Tags'] = ansible.module_utils.ec2.ansible_dict_to_boto3_tag_list(module.params['tags'])
|
|
|
|
|
stack_params['Tags'] = ansible_dict_to_boto3_tag_list(module.params['tags'])
|
|
|
|
|
|
|
|
|
|
if module.params.get('role_arn'):
|
|
|
|
|
stack_params['RoleARN'] = module.params['role_arn']
|
|
|
|
|
@ -721,8 +719,8 @@ def main():
|
|
|
|
|
result = {}
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
region, ec2_url, aws_connect_kwargs = ansible.module_utils.ec2.get_aws_connection_info(module, boto3=True)
|
|
|
|
|
cfn = ansible.module_utils.ec2.boto3_conn(module, conn_type='client', resource='cloudformation', region=region, endpoint=ec2_url, **aws_connect_kwargs)
|
|
|
|
|
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True)
|
|
|
|
|
cfn = boto3_conn(module, conn_type='client', resource='cloudformation', region=region, endpoint=ec2_url, **aws_connect_kwargs)
|
|
|
|
|
except botocore.exceptions.NoCredentialsError as e:
|
|
|
|
|
module.fail_json(msg=boto_exception(e))
|
|
|
|
|
|
|
|
|
|
|