summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-11-14 16:42:16 -0800
committerGitHub <noreply@github.com>2022-11-14 16:42:16 -0800
commit736f65b83822abf31b344f27a489021b41c5e27f (patch)
tree5919a20e9e1f2661e73c873d435fed12c6a38f6f
parent046fd1e4cd609f0e976dbdedf06945f5a13f1f96 (diff)
parent2f172c45785e09625d6b79425fe3ea227b1992d6 (diff)
downloadchef-736f65b83822abf31b344f27a489021b41c5e27f.tar.gz
Merge pull request #13166 from gene1wood/fix_package_allowed_actions
-rw-r--r--lib/chef/resource/apt_package.rb2
-rw-r--r--lib/chef/resource/dmg_package.rb2
-rw-r--r--lib/chef/resource/freebsd_package.rb2
-rw-r--r--lib/chef/resource/gem_package.rb2
-rw-r--r--lib/chef/resource/homebrew_package.rb2
-rw-r--r--lib/chef/resource/macports_package.rb2
-rw-r--r--lib/chef/resource/openbsd_package.rb2
-rw-r--r--lib/chef/resource/pacman_package.rb2
-rw-r--r--lib/chef/resource/portage_package.rb2
-rw-r--r--lib/chef/resource/rpm_package.rb2
-rw-r--r--lib/chef/resource/smartos_package.rb2
-rw-r--r--lib/chef/resource/snap_package.rb2
-rw-r--r--lib/chef/resource/solaris_package.rb2
-rw-r--r--lib/chef/resource/yum_package.rb2
-rw-r--r--lib/chef/resource/zypper_package.rb2
15 files changed, 30 insertions, 0 deletions
diff --git a/lib/chef/resource/apt_package.rb b/lib/chef/resource/apt_package.rb
index af485d85ec..85c2ad4faf 100644
--- a/lib/chef/resource/apt_package.rb
+++ b/lib/chef/resource/apt_package.rb
@@ -56,6 +56,8 @@ class Chef
description "Use the **apt_package** resource to manage packages on Debian, Ubuntu, and other platforms that use the APT package system."
+ allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock
+
property :default_release, String,
description: "The default release. For example: `stable`.",
desired_state: false
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index c3bdbf81cd..168388d6f6 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -57,6 +57,8 @@ class Chef
```
DOC
+ allowed_actions :install
+
property :app, String,
description: "The name of the application as it appears in the `/Volumes` directory if it differs from the resource block's name.",
name_property: true
diff --git a/lib/chef/resource/freebsd_package.rb b/lib/chef/resource/freebsd_package.rb
index 713aa26e0c..210f2b7233 100644
--- a/lib/chef/resource/freebsd_package.rb
+++ b/lib/chef/resource/freebsd_package.rb
@@ -30,6 +30,8 @@ class Chef
description "Use the **freebsd_package** resource to manage packages for the FreeBSD platform."
+ allowed_actions :install, :remove
+
# make sure we assign the appropriate underlying providers based on what
# package managers exist on this FreeBSD system or the source of the package
#
diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb
index ab11a873e2..cac751a25c 100644
--- a/lib/chef/resource/gem_package.rb
+++ b/lib/chef/resource/gem_package.rb
@@ -59,6 +59,8 @@ class Chef
```
EXAMPLES
+ allowed_actions :install, :upgrade, :remove, :purge
+
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
identity: true
diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb
index 2d8efdb82b..6251fb3c75 100644
--- a/lib/chef/resource/homebrew_package.rb
+++ b/lib/chef/resource/homebrew_package.rb
@@ -60,6 +60,8 @@ class Chef
```
DOC
+ allowed_actions :install, :upgrade, :remove, :purge
+
property :homebrew_user, [ String, Integer ],
description: "The name or uid of the Homebrew owner to be used by #{ChefUtils::Dist::Infra::PRODUCT} when executing a command.\n\n#{ChefUtils::Dist::Infra::PRODUCT}, by default, will attempt to execute a Homebrew command as the owner of the `/usr/local/bin/brew` executable. If that executable does not exist, #{ChefUtils::Dist::Infra::PRODUCT} will attempt to find the user by executing `which brew`. If that executable cannot be found, #{ChefUtils::Dist::Infra::PRODUCT} will print an error message: `Could not find the 'brew' executable in /usr/local/bin or anywhere on the path.`.\n\nSet this property to specify the Homebrew owner for situations where Chef Infra Client cannot automatically detect the correct owner.'"
diff --git a/lib/chef/resource/macports_package.rb b/lib/chef/resource/macports_package.rb
index 702ff0038d..858980f338 100644
--- a/lib/chef/resource/macports_package.rb
+++ b/lib/chef/resource/macports_package.rb
@@ -25,6 +25,8 @@ class Chef
description "Use the **macports_package** resource to manage packages for the macOS platform using the MacPorts package management system."
+ allowed_actions :install, :upgrade, :remove, :purge
+
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
identity: true
diff --git a/lib/chef/resource/openbsd_package.rb b/lib/chef/resource/openbsd_package.rb
index f60c4a0c40..eff4ae28e8 100644
--- a/lib/chef/resource/openbsd_package.rb
+++ b/lib/chef/resource/openbsd_package.rb
@@ -48,6 +48,8 @@ class Chef
```
DOC
+ allowed_actions :install, :remove
+
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
identity: true
diff --git a/lib/chef/resource/pacman_package.rb b/lib/chef/resource/pacman_package.rb
index 99c2fec1d5..dd7bc0ff1a 100644
--- a/lib/chef/resource/pacman_package.rb
+++ b/lib/chef/resource/pacman_package.rb
@@ -24,6 +24,8 @@ class Chef
provides :pacman_package
+ allowed_actions :install, :upgrade, :remove, :purge
+
description "Use the **pacman_package** resource to manage packages (using pacman) on the Arch Linux platform."
end
end
diff --git a/lib/chef/resource/portage_package.rb b/lib/chef/resource/portage_package.rb
index b659cea948..6c263b6619 100644
--- a/lib/chef/resource/portage_package.rb
+++ b/lib/chef/resource/portage_package.rb
@@ -26,6 +26,8 @@ class Chef
description "Use the **portage_package** resource to manage packages for the Gentoo platform."
+ allowed_actions :install, :upgrade, :remove, :purge
+
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
identity: true
diff --git a/lib/chef/resource/rpm_package.rb b/lib/chef/resource/rpm_package.rb
index 31cd279ba8..34b48e3bec 100644
--- a/lib/chef/resource/rpm_package.rb
+++ b/lib/chef/resource/rpm_package.rb
@@ -24,6 +24,8 @@ class Chef
provides :rpm_package
+ allowed_actions :install, :upgrade, :remove
+
description "Use the **rpm_package** resource to manage packages using the RPM Package Manager."
property :allow_downgrade, [ TrueClass, FalseClass ],
diff --git a/lib/chef/resource/smartos_package.rb b/lib/chef/resource/smartos_package.rb
index 2dabccc4b4..429891e53d 100644
--- a/lib/chef/resource/smartos_package.rb
+++ b/lib/chef/resource/smartos_package.rb
@@ -27,6 +27,8 @@ class Chef
description "Use the **smartos_package** resource to manage packages for the SmartOS platform."
+ allowed_actions :install, :upgrade, :remove
+
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
identity: true
diff --git a/lib/chef/resource/snap_package.rb b/lib/chef/resource/snap_package.rb
index 4979e996e0..cb8de2d1f5 100644
--- a/lib/chef/resource/snap_package.rb
+++ b/lib/chef/resource/snap_package.rb
@@ -27,6 +27,8 @@ class Chef
description "Use the **snap_package** resource to manage snap packages on Debian and Ubuntu platforms."
introduced "15.0"
+ allowed_actions :install, :upgrade, :remove, :purge
+
property :channel, String,
description: "The default channel. For example: stable.",
default: "stable",
diff --git a/lib/chef/resource/solaris_package.rb b/lib/chef/resource/solaris_package.rb
index c3d023db35..b2ffb2372b 100644
--- a/lib/chef/resource/solaris_package.rb
+++ b/lib/chef/resource/solaris_package.rb
@@ -27,6 +27,8 @@ class Chef
description "Use the **solaris_package** resource to manage packages on the Solaris platform."
+ allowed_actions :install, :upgrade, :remove
+
property :package_name, String,
description: "An optional property to set the package name if it differs from the resource block's name.",
identity: true
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index 83b2508ac5..ebdcb867ab 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -109,6 +109,8 @@ class Chef
```
DOC
+ allowed_actions :install, :upgrade, :remove, :purge, :lock, :unlock
+
# XXX: the coercions here are due to the provider promiscuously updating the properties on the
# new_resource which causes immutable modification exceptions when passed an immutable node array.
#
diff --git a/lib/chef/resource/zypper_package.rb b/lib/chef/resource/zypper_package.rb
index a32c79c607..85c55205a5 100644
--- a/lib/chef/resource/zypper_package.rb
+++ b/lib/chef/resource/zypper_package.rb
@@ -53,6 +53,8 @@ class Chef
```
DOC
+ allowed_actions :install, :upgrade, :remove, :purge, :lock, :unlock
+
property :gpg_check, [ TrueClass, FalseClass ],
description: "Verify the package's GPG signature. Can also be controlled site-wide using the `zypper_check_gpg` config option.",
default: lazy { Chef::Config[:zypper_check_gpg] }, default_description: "true"