Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9922181
D3641.id9413.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
584 B
Referenced Files
None
Subscribers
None
D3641.id9413.diff
View Options
diff --git a/_modules/node.py b/_modules/node.py
--- a/_modules/node.py
+++ b/_modules/node.py
@@ -263,6 +263,21 @@
return " ".join(["[" + ip + "]" for ip in ipv6])
+def get_public_ipv6():
+ """
+ A function to get a list of public IPv6, enclosed by [].
+
+ Returns a string depending on the IPv6 currently assigned.
+
+ CLI Example:
+
+ salt * node.get_public_ipv6
+ """
+ ipv6 = __grains__.get("ipv6")
+
+ return [ip for ip in ipv6 if ip.startswith("2001")]
+
+
def get_all_ips():
"""
A function to get a list of IPv4, not enclosed,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 17, 07:17 (8 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2737227
Default Alt Text
D3641.id9413.diff (584 B)
Attached To
Mode
D3641: Get public IPV6 from servers
Attached
Detach File
Event Timeline
Log In to Comment