diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-10-28 21:50:47 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-10-28 21:50:47 -0700 |
commit | ddf24bcbbfed3852fc3c19f739927072a27c1f00 (patch) | |
tree | 4ca425d02a23d52136f4597942548f9cade89d40 /lib/chef | |
parent | 9ccc77bfdadc398e8bec8eaac723df785399e319 (diff) | |
download | chef-ddf24bcbbfed3852fc3c19f739927072a27c1f00.tar.gz |
Turn on unified_mode for 35 core resources
These are the ones that off of the top of my head it should be perfectly
safe to turn on `unifed_mode` with minimal auditing.
Most of these are so old that they do not use any sub-resources at all.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
35 files changed, 65 insertions, 0 deletions
diff --git a/lib/chef/resource/bash.rb b/lib/chef/resource/bash.rb index 0e11dcb8b1..0399ff715b 100644 --- a/lib/chef/resource/bash.rb +++ b/lib/chef/resource/bash.rb @@ -22,6 +22,8 @@ require_relative "../provider/script" class Chef class Resource class Bash < Chef::Resource::Script + unified_mode true + description "Use the bash resource to execute scripts using the Bash interpreter. This resource may also use any of the actions and properties that are available to the execute resource. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence." def initialize(name, run_context = nil) diff --git a/lib/chef/resource/batch.rb b/lib/chef/resource/batch.rb index fc8c892a3b..f36a70cd0c 100644 --- a/lib/chef/resource/batch.rb +++ b/lib/chef/resource/batch.rb @@ -21,6 +21,8 @@ require_relative "windows_script" class Chef class Resource class Batch < Chef::Resource::WindowsScript + unified_mode true + provides :batch description "Use the batch resource to execute a batch script using the cmd.exe interpreter on Windows. The batch resource creates and executes a temporary file (similar to how the script resource behaves), rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use not_if and only_if to guard this resource for idempotence." diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb index cc7f8d7e84..6584aad882 100644 --- a/lib/chef/resource/breakpoint.rb +++ b/lib/chef/resource/breakpoint.rb @@ -22,6 +22,8 @@ require_relative "../dist" class Chef class Resource class Breakpoint < Chef::Resource + unified_mode true + provides :breakpoint, target_mode: true resource_name :breakpoint diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb index e0bcad1b67..d2c38d92dc 100644 --- a/lib/chef/resource/cookbook_file.rb +++ b/lib/chef/resource/cookbook_file.rb @@ -27,6 +27,7 @@ class Chef class Resource class CookbookFile < Chef::Resource::File include Chef::Mixin::Securable + unified_mode true resource_name :cookbook_file diff --git a/lib/chef/resource/csh.rb b/lib/chef/resource/csh.rb index c3b03e846e..ea8e44c175 100644 --- a/lib/chef/resource/csh.rb +++ b/lib/chef/resource/csh.rb @@ -22,6 +22,8 @@ require_relative "../provider/script" class Chef class Resource class Csh < Chef::Resource::Script + unified_mode true + description "Use the csh resource to execute scripts using the csh interpreter."\ " This resource may also use any of the actions and properties that are"\ " available to the execute resource. Commands that are executed with this"\ diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb index 9443c893d1..b817a3ff08 100644 --- a/lib/chef/resource/directory.rb +++ b/lib/chef/resource/directory.rb @@ -24,6 +24,8 @@ require_relative "../mixin/securable" class Chef class Resource class Directory < Chef::Resource + unified_mode true + resource_name :directory description "Use the directory resource to manage a directory, which is a hierarchy"\ diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index add15e3085..ecb1944742 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -23,6 +23,8 @@ require_relative "../dist" class Chef class Resource class Execute < Chef::Resource + unified_mode true + resource_name :execute provides :execute, target_mode: true diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb index c737780e2d..57dc6c42f9 100644 --- a/lib/chef/resource/file.rb +++ b/lib/chef/resource/file.rb @@ -28,6 +28,7 @@ class Chef class Resource class File < Chef::Resource include Chef::Mixin::Securable + unified_mode true description "Use the file resource to manage files directly on a node." diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb index 4d5f4ac091..a59febbacc 100644 --- a/lib/chef/resource/git.rb +++ b/lib/chef/resource/git.rb @@ -21,6 +21,8 @@ require_relative "scm" class Chef class Resource class Git < Chef::Resource::Scm + unified_mode true + description "Use the git resource to manage source control resources that exist in a git repository. git version 1.6.5 (or higher) is required to use all of the functionality in the git resource." property :additional_remotes, Hash, diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb index c5dd83efc2..9a43c60e31 100644 --- a/lib/chef/resource/group.rb +++ b/lib/chef/resource/group.rb @@ -20,6 +20,8 @@ class Chef class Resource class Group < Chef::Resource + unified_mode true + state_attrs :members description "Use the group resource to manage a local group." diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb index efcb379640..bf03d6b917 100644 --- a/lib/chef/resource/http_request.rb +++ b/lib/chef/resource/http_request.rb @@ -22,6 +22,8 @@ require_relative "../resource" class Chef class Resource class HttpRequest < Chef::Resource + unified_mode true + resource_name :http_request provides :http_request diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb index 8c4947844a..6b64ed0fa1 100644 --- a/lib/chef/resource/ifconfig.rb +++ b/lib/chef/resource/ifconfig.rb @@ -26,6 +26,8 @@ class Chef # device 'eth1' # end class Ifconfig < Chef::Resource + unified_mode true + resource_name :ifconfig description "Use the ifconfig resource to manage interfaces on Unix and Linux systems." diff --git a/lib/chef/resource/ksh.rb b/lib/chef/resource/ksh.rb index a150efe330..0ebcfaaba6 100644 --- a/lib/chef/resource/ksh.rb +++ b/lib/chef/resource/ksh.rb @@ -21,6 +21,8 @@ require_relative "script" class Chef class Resource class Ksh < Chef::Resource::Script + unified_mode true + description "Use the ksh resource to execute scripts using the Korn shell (ksh)"\ " interpreter. This resource may also use any of the actions and properties"\ " that are available to the execute resource. Commands that are executed"\ diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb index 81ca2f5600..b6b2601b6e 100644 --- a/lib/chef/resource/link.rb +++ b/lib/chef/resource/link.rb @@ -24,6 +24,8 @@ class Chef class Resource class Link < Chef::Resource include Chef::Mixin::Securable + unified_mode true + resource_name :link provides :link diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb index 98cf0fb204..969b448b17 100644 --- a/lib/chef/resource/log.rb +++ b/lib/chef/resource/log.rb @@ -29,6 +29,8 @@ class Chef # level :debug # end class Log < Chef::Resource + unified_mode true + resource_name :log provides :log, target_mode: true diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb index 164ef22b04..b0559c84d4 100644 --- a/lib/chef/resource/ohai.rb +++ b/lib/chef/resource/ohai.rb @@ -23,6 +23,8 @@ require_relative "../dist" class Chef class Resource class Ohai < Chef::Resource + unified_mode true + resource_name :ohai provides :ohai diff --git a/lib/chef/resource/perl.rb b/lib/chef/resource/perl.rb index 58e21c4915..42f17a602a 100644 --- a/lib/chef/resource/perl.rb +++ b/lib/chef/resource/perl.rb @@ -22,6 +22,8 @@ require_relative "../provider/script" class Chef class Resource class Perl < Chef::Resource::Script + unified_mode true + def initialize(name, run_context = nil) super @interpreter = "perl" diff --git a/lib/chef/resource/python.rb b/lib/chef/resource/python.rb index b1e059a66f..3cee3d3432 100644 --- a/lib/chef/resource/python.rb +++ b/lib/chef/resource/python.rb @@ -21,6 +21,8 @@ require_relative "../provider/script" class Chef class Resource class Python < Chef::Resource::Script + unified_mode true + def initialize(name, run_context = nil) super @interpreter = "python" diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb index bf3686ba47..21a7246678 100644 --- a/lib/chef/resource/reboot.rb +++ b/lib/chef/resource/reboot.rb @@ -22,6 +22,8 @@ require_relative "../dist" class Chef class Resource class Reboot < Chef::Resource + unified_mode true + resource_name :reboot description "Use the reboot resource to reboot a node, a necessary step with some"\ diff --git a/lib/chef/resource/registry_key.rb b/lib/chef/resource/registry_key.rb index a5c99313bf..688fe016cc 100644 --- a/lib/chef/resource/registry_key.rb +++ b/lib/chef/resource/registry_key.rb @@ -22,6 +22,8 @@ require_relative "../digester" class Chef class Resource class RegistryKey < Chef::Resource + unified_mode true + resource_name :registry_key provides(:registry_key) { true } diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb index 70632b8be8..0d26d169b3 100644 --- a/lib/chef/resource/remote_directory.rb +++ b/lib/chef/resource/remote_directory.rb @@ -25,6 +25,7 @@ class Chef class Resource class RemoteDirectory < Chef::Resource::Directory include Chef::Mixin::Securable + unified_mode true description "Use the remote_directory resource to incrementally transfer a directory from a cookbook to a node. The director that is copied from the cookbook should be located under COOKBOOK_NAME/files/default/REMOTE_DIRECTORY. The remote_directory resource will obey file specificity." diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb index cba3908b0c..04c582d50d 100644 --- a/lib/chef/resource/remote_file.rb +++ b/lib/chef/resource/remote_file.rb @@ -27,6 +27,7 @@ class Chef class Resource class RemoteFile < Chef::Resource::File include Chef::Mixin::Securable + unified_mode true description "Use the remote_file resource to transfer a file from a remote location"\ " using file specificity. This resource is similar to the file resource." diff --git a/lib/chef/resource/ruby.rb b/lib/chef/resource/ruby.rb index 63bdd12630..ab193c659b 100644 --- a/lib/chef/resource/ruby.rb +++ b/lib/chef/resource/ruby.rb @@ -22,6 +22,8 @@ require_relative "../provider/script" class Chef class Resource class Ruby < Chef::Resource::Script + unified_mode true + description "Use the ruby resource to execute scripts using the Ruby interpreter. This"\ " resource may also use any of the actions and properties that are available"\ " to the execute resource. Commands that are executed with this resource are (by"\ diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb index 4f5c7e4b95..5ecf1582d4 100644 --- a/lib/chef/resource/ruby_block.rb +++ b/lib/chef/resource/ruby_block.rb @@ -24,6 +24,8 @@ require_relative "../dist" class Chef class Resource class RubyBlock < Chef::Resource + unified_mode true + provides :ruby_block, target_mode: true description "Use the ruby_block resource to execute Ruby code during a #{Chef::Dist::PRODUCT} run."\ diff --git a/lib/chef/resource/scm.rb b/lib/chef/resource/scm.rb index b62afb459d..40b4f8e77c 100644 --- a/lib/chef/resource/scm.rb +++ b/lib/chef/resource/scm.rb @@ -21,6 +21,8 @@ require_relative "../resource" class Chef class Resource class Scm < Chef::Resource + unified_mode true + default_action :sync allowed_actions :checkout, :export, :sync, :diff, :log diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb index 6d40061f8f..056d2743cc 100644 --- a/lib/chef/resource/script.rb +++ b/lib/chef/resource/script.rb @@ -22,6 +22,8 @@ require_relative "execute" class Chef class Resource class Script < Chef::Resource::Execute + unified_mode true + resource_name :script identity_attr :name diff --git a/lib/chef/resource/subversion.rb b/lib/chef/resource/subversion.rb index e7ded4fa54..26d887331e 100644 --- a/lib/chef/resource/subversion.rb +++ b/lib/chef/resource/subversion.rb @@ -23,6 +23,8 @@ require_relative "../dist" class Chef class Resource class Subversion < Chef::Resource::Scm + unified_mode true + description "Use the subversion resource to manage source control resources that exist in a Subversion repository." allowed_actions :force_export diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 3ff568b1a1..876816cc81 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -34,6 +34,8 @@ class Chef # chef-client. This resource includes actions and properties from the file resource. Template files managed by the # template resource follow the same file specificity rules as the remote_file and file resources. class Template < Chef::Resource::File + unified_mode true + resource_name :template provides :template diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb index 6ade20082f..05129ce97e 100644 --- a/lib/chef/resource/user.rb +++ b/lib/chef/resource/user.rb @@ -21,6 +21,8 @@ require_relative "../resource" class Chef class Resource class User < Chef::Resource + unified_mode true + resource_name :user_resource_abstract_base_class # this prevents magickal class name DSL wiring description "Use the user resource to add users, update existing users, remove users, and to lock/unlock user passwords." diff --git a/lib/chef/resource/user/aix_user.rb b/lib/chef/resource/user/aix_user.rb index 4ae4bf6300..d64dd02f32 100644 --- a/lib/chef/resource/user/aix_user.rb +++ b/lib/chef/resource/user/aix_user.rb @@ -21,6 +21,8 @@ class Chef class Resource class User class AixUser < Chef::Resource::User + unified_mode true + resource_name :aix_user provides :aix_user diff --git a/lib/chef/resource/user/linux_user.rb b/lib/chef/resource/user/linux_user.rb index 72da546cae..9ec6480035 100644 --- a/lib/chef/resource/user/linux_user.rb +++ b/lib/chef/resource/user/linux_user.rb @@ -21,6 +21,8 @@ class Chef class Resource class User class LinuxUser < Chef::Resource::User + unified_mode true + resource_name :linux_user provides :linux_user diff --git a/lib/chef/resource/user/pw_user.rb b/lib/chef/resource/user/pw_user.rb index 5989858ff7..a14fe7fd8b 100644 --- a/lib/chef/resource/user/pw_user.rb +++ b/lib/chef/resource/user/pw_user.rb @@ -21,6 +21,8 @@ class Chef class Resource class User class PwUser < Chef::Resource::User + unified_mode true + resource_name :pw_user provides :pw_user diff --git a/lib/chef/resource/user/solaris_user.rb b/lib/chef/resource/user/solaris_user.rb index db0052817e..7a50da5ab1 100644 --- a/lib/chef/resource/user/solaris_user.rb +++ b/lib/chef/resource/user/solaris_user.rb @@ -21,6 +21,8 @@ class Chef class Resource class User class SolarisUser < Chef::Resource::User + unified_mode true + resource_name :solaris_user provides :solaris_user diff --git a/lib/chef/resource/user/windows_user.rb b/lib/chef/resource/user/windows_user.rb index 2993887890..23b7b985f3 100644 --- a/lib/chef/resource/user/windows_user.rb +++ b/lib/chef/resource/user/windows_user.rb @@ -21,6 +21,8 @@ class Chef class Resource class User class WindowsUser < Chef::Resource::User + unified_mode true + resource_name :windows_user provides :windows_user diff --git a/lib/chef/resource/whyrun_safe_ruby_block.rb b/lib/chef/resource/whyrun_safe_ruby_block.rb index db11ba34d2..7d66147149 100644 --- a/lib/chef/resource/whyrun_safe_ruby_block.rb +++ b/lib/chef/resource/whyrun_safe_ruby_block.rb @@ -19,6 +19,7 @@ class Chef class Resource class WhyrunSafeRubyBlock < Chef::Resource::RubyBlock + unified_mode true end end end |