summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorNimishaS <nimisha.sharad@msystechnologies.com>2016-10-07 09:01:00 +0000
committerNimishaS <nimisha.sharad@msystechnologies.com>2016-11-16 10:04:58 +0000
commit767b66e13f2989693f7adf1b3cebed2e6da6a12d (patch)
tree449b11fe6c5f1c41263c9287f744bbdc67cc9e86 /lib/chef/resource
parentbedcbd5f52448d24fdd7ab26ab79185c011beee3 (diff)
downloadchef-767b66e13f2989693f7adf1b3cebed2e6da6a12d.tar.gz
msu_package resource for Microsoft Update packages
Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com> Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/msu_package.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/chef/resource/msu_package.rb b/lib/chef/resource/msu_package.rb
new file mode 100644
index 0000000000..753992c185
--- /dev/null
+++ b/lib/chef/resource/msu_package.rb
@@ -0,0 +1,47 @@
+#
+# Author:: Nimisha Sharad (<nimisha.sharad@msystechnologies.com>)
+# Copyright:: Copyright 2008-2016, Chef Software, 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.
+#
+
+require "chef/resource/package"
+require "chef/mixin/uris"
+
+class Chef
+ class Resource
+ class MsuPackage < Chef::Resource::Package
+ include Chef::Mixin::Uris
+
+ provides :msu_package, os: "windows"
+
+ allowed_actions :install, :remove
+
+ def initialize(name, run_context = nil)
+ super
+ @resource_name = :msu_package
+ @source = name
+ @action = :install
+ end
+
+ property :source, String,
+ coerce: (proc do |s|
+ unless s.nil?
+ uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false)
+ end
+ end)
+ property :checksum, String, desired_state: false
+ end
+ end
+end