Page MenuHomeDevCentral

D1146.id2930.diff
No OneTemporary

D1146.id2930.diff

diff --git a/_modules/node.py b/_modules/node.py
--- a/_modules/node.py
+++ b/_modules/node.py
@@ -80,3 +80,16 @@
'''
value = _get_property(key, nodename, False)
return bool(value)
+
+
+def has_role(role, nodename=None):
+ '''
+ A function to determine if a node has the specified role.
+
+ Returns a boolean, False if not found.
+
+ CLI Example:
+
+ salt * node.has_role devserver
+ '''
+ return role in list('roles', nodename)

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 02:36 (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2265688
Default Alt Text
D1146.id2930.diff (470 B)

Event Timeline