From 63656e5ef76368bff267fb1c733f7fd219a306ec Mon Sep 17 00:00:00 2001 From: Will Thames Date: Mon, 1 Sep 2014 10:11:52 +1000 Subject: [PATCH] Fixed tagging --- lib/ansible/modules/cloud/amazon/rds.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/rds.py b/lib/ansible/modules/cloud/amazon/rds.py index 0095aed7ba8..96e4848e056 100644 --- a/lib/ansible/modules/cloud/amazon/rds.py +++ b/lib/ansible/modules/cloud/amazon/rds.py @@ -236,7 +236,7 @@ options: version_added: 1.8 tags: description: - - tags to apply to a resource. Used with command=create, command=replicate, command=restore. Requires boto >= 2.26.0 + - tags dict to apply to a resource. Used with command=create, command=replicate, command=restore. Requires boto >= 2.26.0 required: false default: null aliases: [] @@ -257,6 +257,9 @@ EXAMPLES = ''' instance_type: db.m1.small username: mysql_admin password: 1nsecure + tags: + Environment: testing + Application: cms # Create a read-only replica and wait for it to become available - rds: @@ -933,6 +936,10 @@ def validate_parameters(required_vars, valid_vars, module): for x in module.params.get('vpc_security_groups'): groups_list.append(boto.rds.VPCSecurityGroupMembership(vpc_group=x)) params["vpc_security_groups"] = groups_list + + # Convert tags dict to list of tuples that rds2 expects + if 'tags' in params: + params['tags'] = module.params['tags'].items() return params @@ -968,7 +975,7 @@ def main(): snapshot = dict(required=False), apply_immediately = dict(type='bool', default=False), new_instance_name = dict(required=False), - tags = dict(type='list', required=False), + tags = dict(type='dict', required=False), publicly_accessible = dict(required=False), character_set_name = dict(required=False), )