diff options
author | Sloane Hertel <shertel@redhat.com> | 2018-01-30 16:12:22 -0500 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2018-01-30 16:12:22 -0500 |
commit | fda09a75d3c674d61bd41e9acbc42a573fb6738a (patch) | |
tree | 3ba4150ac198540b744bdc59272d987cf7181988 /lib/ansible/modules/cloud/amazon/elasticache.py | |
parent | c02b1f586f2add344827addc395a49745a66fc58 (diff) | |
download | ansible-fda09a75d3c674d61bd41e9acbc42a573fb6738a.tar.gz |
elasticache: default zone to None - fixes #31779 (#31785)
* elasticache: default zone to None.
* Only add PreferredAvailabilityZone to kwargs if self.zone is not None
Diffstat (limited to 'lib/ansible/modules/cloud/amazon/elasticache.py')
-rw-r--r-- | lib/ansible/modules/cloud/amazon/elasticache.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/modules/cloud/amazon/elasticache.py b/lib/ansible/modules/cloud/amazon/elasticache.py index cbb09cc026..416d5a8c3c 100644 --- a/lib/ansible/modules/cloud/amazon/elasticache.py +++ b/lib/ansible/modules/cloud/amazon/elasticache.py @@ -218,10 +218,11 @@ class ElastiCacheManager(object): CacheSecurityGroupNames=self.cache_security_groups, SecurityGroupIds=self.security_group_ids, CacheParameterGroupName=self.cache_parameter_group, - CacheSubnetGroupName=self.cache_subnet_group, - PreferredAvailabilityZone=self.zone) + CacheSubnetGroupName=self.cache_subnet_group) if self.cache_port is not None: kwargs['Port'] = self.cache_port + if self.zone is not None: + kwargs['PreferredAvailabilityZone'] = self.zone try: self.conn.create_cache_cluster(**kwargs) @@ -497,7 +498,7 @@ def main(): cache_subnet_group=dict(default=""), cache_security_groups=dict(default=[], type='list'), security_group_ids=dict(default=[], type='list'), - zone=dict(default=""), + zone=dict(), wait=dict(default=True, type='bool'), hard_modify=dict(type='bool') )) |