summaryrefslogtreecommitdiff
path: root/chef/examples/search_syntax.rb
diff options
context:
space:
mode:
Diffstat (limited to 'chef/examples/search_syntax.rb')
-rw-r--r--chef/examples/search_syntax.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/chef/examples/search_syntax.rb b/chef/examples/search_syntax.rb
new file mode 100644
index 0000000000..4be57b7802
--- /dev/null
+++ b/chef/examples/search_syntax.rb
@@ -0,0 +1,10 @@
+search(:users, "allowed:#{node[:hostname]} or allowed:#{node[:tags]}") do |u|
+ user "#{u['username']}" do
+ uid "#{u['uid']}"
+ gid "#{u['gid']}"
+ username "#{u['username']}"
+ homedir "#{u['homedir']}"
+ action :create
+ end
+end
+