return an IP that ansible can use to SSH to the instance
diff --git a/xos/core/models/instance.py b/xos/core/models/instance.py
index 6240c34..357e6b3 100644
--- a/xos/core/models/instance.py
+++ b/xos/core/models/instance.py
@@ -158,6 +158,13 @@
return ns.ip
return None
+ # return an address that the synchronizer can use to SSH to the instance
+ def get_ssh_ip(self):
+ for ns in self.ports.all():
+ if "nat" in ns.network.name.lower():
+ return ns.ip
+ return None
+
@staticmethod
def select_by_user(user):
if user.is_admin: