summaryrefslogtreecommitdiff
path: root/spec/support/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-06-03 12:48:01 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-06-04 09:34:08 -0700
commite4c52e53a4b9caebebf09fb8ff944f7a2397fe33 (patch)
treecc0d295be849ff2abbbaa6d63c856c823eb7f9a0 /spec/support/lib
parent0c5556b8d1aceee30a25855a965a7ec13d8fa13b (diff)
downloadchef-e4c52e53a4b9caebebf09fb8ff944f7a2397fe33.tar.gz
allow include_recipe from LWRP provider code
allows include_recipe "build-essential" to work from provider code.
Diffstat (limited to 'spec/support/lib')
-rw-r--r--spec/support/lib/chef/provider/openldap_includer.rb29
-rw-r--r--spec/support/lib/chef/resource/openldap_includer.rb28
2 files changed, 57 insertions, 0 deletions
diff --git a/spec/support/lib/chef/provider/openldap_includer.rb b/spec/support/lib/chef/provider/openldap_includer.rb
new file mode 100644
index 0000000000..afb0c7cf01
--- /dev/null
+++ b/spec/support/lib/chef/provider/openldap_includer.rb
@@ -0,0 +1,29 @@
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Copyright:: Copyright (c) 2008 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class Chef
+ class Provider
+ class OpenldapIncluder < Chef::Provider::LWRPBase
+ provides :openldap_includer
+
+ def action_run
+ include_recipe "openldap::default"
+ end
+ end
+ end
+end
diff --git a/spec/support/lib/chef/resource/openldap_includer.rb b/spec/support/lib/chef/resource/openldap_includer.rb
new file mode 100644
index 0000000000..421c95532d
--- /dev/null
+++ b/spec/support/lib/chef/resource/openldap_includer.rb
@@ -0,0 +1,28 @@
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Copyright:: Copyright (c) 2008, 2010 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+class Chef
+ class Resource
+ class OpenldapIncluder < Chef::Resource::LWRPBase
+ use_automatic_resource_name
+ allowed_actions :run
+ default_action :run
+ end
+ end
+end