mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
[cloud] Ensure absence of public_dns_name doesn't halt ec2 module (#31476)
This commit is contained in:
committed by
Ryan Brown
parent
75c5d0fedc
commit
2ba5998c94
@@ -1618,7 +1618,8 @@ def warn_if_public_ip_assignment_changed(module, instance):
|
||||
assign_public_ip = module.params.get('assign_public_ip')
|
||||
|
||||
# Check that public ip assignment is the same and warn if not
|
||||
if (assign_public_ip or instance.public_dns_name) and (not instance.public_dns_name or not assign_public_ip):
|
||||
public_dns_name = getattr(instance, 'public_dns_name', None)
|
||||
if (assign_public_ip or public_dns_name) and (not public_dns_name or not assign_public_ip):
|
||||
module.warn("Unable to modify public ip assignment to {0} for instance {1}. "
|
||||
"Whether or not to assign a public IP is determined during instance creation.".format(assign_public_ip, instance.id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user