mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 15:21:25 -07:00
Extend module_defaults
by adding default groups for cloud modules (#44127)
Extends `module_defaults` by adding a prefix to defaults `group/` which denotes a builtin list of modules. Initial groups are: `group/aws`, `group/azure`, and `group/gcp`
This commit is contained in:
parent
fdcb883ac0
commit
4c8808ec9d
7 changed files with 675 additions and 13 deletions
|
@ -53,6 +53,7 @@ except ImportError:
|
|||
pass # will be detected by imported HAS_BOTO3
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.module_utils.ec2 import (boto3_conn, ec2_argument_spec, HAS_BOTO3, camel_dict_to_snake_dict,
|
||||
get_aws_connection_info)
|
||||
|
||||
|
@ -67,7 +68,7 @@ def get_bucket_list(module, connection):
|
|||
try:
|
||||
buckets = camel_dict_to_snake_dict(connection.list_buckets())['buckets']
|
||||
except botocore.exceptions.ClientError as e:
|
||||
module.fail_json(msg=e.message, exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
|
||||
module.fail_json(msg=to_native(e), exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
|
||||
|
||||
return buckets
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue