Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3783227
D1146.id2930.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
470 B
Referenced Files
None
Subscribers
None
D1146.id2930.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D1146: Allow to determine if a node has a role
Attached
Detach File
Event Timeline
Log In to Comment