summaryrefslogtreecommitdiff
path: root/lib/chef/resource/dnf_package.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-11-30 14:54:43 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-13 13:31:50 -0800
commit626213cb2d6f1e4de18c6f29573e3aa34ed76cef (patch)
tree54a4eb2513feb465bac14ffeb93884a6095db264 /lib/chef/resource/dnf_package.rb
parent673f733fe5d469ba025393b06544fbcabeca0cc9 (diff)
downloadchef-626213cb2d6f1e4de18c6f29573e3aa34ed76cef.tar.gz
squashing dnf work
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource/dnf_package.rb')
-rw-r--r--lib/chef/resource/dnf_package.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb
new file mode 100644
index 0000000000..eb901d7f6a
--- /dev/null
+++ b/lib/chef/resource/dnf_package.rb
@@ -0,0 +1,43 @@
+#
+# Author:: AJ Christensen (<aj@chef.io>)
+# 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"
+
+class Chef
+ class Resource
+ class DnfPackage < Chef::Resource::Package
+ extend Chef::Mixin::Which
+
+ resource_name :dnf_package
+
+ allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock, :flush_cache
+
+ provides :package, os: "linux", platform_family: %w{rhel fedora} do
+ which("dnf")
+ end
+
+ provides :dnf_package
+
+ # Install a specific arch
+ property :arch, [ String, Array ]
+
+ # FIXME: dnf install should downgrade, so this should warn that users do not need to use it any more?
+ property :allow_downgrade, [ true, false ], default: false
+ end
+ end
+end