Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F9940073
D3641.id9414.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
888 B
Referenced Files
None
Subscribers
None
D3641.id9414.diff
View Options
diff --git a/_modules/node.py b/_modules/node.py
--- a/_modules/node.py
+++ b/_modules/node.py
@@ -250,9 +250,9 @@
def get_ipv6_list():
"""
- A function to get a list of IPv6, enclosed by [].
+ A function to get a list of public IPv6.
- Returns a string depending on the IPv6 currently assigned.
+ Returns a list depending on the IPv6 currently assigned.
CLI Example:
@@ -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, 14:07 (15 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2740960
Default Alt Text
D3641.id9414.diff (888 B)
Attached To
Mode
D3641: Get public IPV6 from servers
Attached
Detach File
Event Timeline
Log In to Comment