Changeset View
Changeset View
Standalone View
Standalone View
_modules/node.py
| Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | CLI Example: | ||||
| salt * node.get_ipv6_list | salt * node.get_ipv6_list | ||||
| """ | """ | ||||
| ipv6 = __grains__.get("ipv6") | ipv6 = __grains__.get("ipv6") | ||||
| return " ".join(["[" + ip + "]" for ip in ipv6]) | return " ".join(["[" + ip + "]" for ip in ipv6]) | ||||
| def get_public_ipv6(): | |||||
| """ | |||||
| A function to get a list of public IPv6. | |||||
| Returns a list 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(): | def get_all_ips(): | ||||
| """ | """ | ||||
| A function to get a list of IPv4, not enclosed, | A function to get a list of IPv4, not enclosed, | ||||
| and IPv6, enclosed by []. | and IPv6, enclosed by []. | ||||
| Returns a string depending on the IPv6 currently assigned. | Returns a string depending on the IPv6 currently assigned. | ||||
| CLI Example: | CLI Example: | ||||
| ▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines | |||||
Nasqueron DevCentral · If it had been much bigger the moon would have had a core of ice. · Powered by Phabricator