microwave 11.400.3 → 11.400.4
Sign up to get free protection for your applications and to get access to all the features.
- data/distro/README +2 -0
- data/distro/arch/etc/conf.d/chef-client.conf +5 -0
- data/distro/arch/etc/conf.d/chef-expander.conf +8 -0
- data/distro/arch/etc/conf.d/chef-server-webui.conf +10 -0
- data/distro/arch/etc/conf.d/chef-server.conf +10 -0
- data/distro/arch/etc/conf.d/chef-solr.conf +8 -0
- data/distro/arch/etc/rc.d/chef-client +90 -0
- data/distro/arch/etc/rc.d/chef-expander +78 -0
- data/distro/arch/etc/rc.d/chef-server +78 -0
- data/distro/arch/etc/rc.d/chef-server-webui +78 -0
- data/distro/arch/etc/rc.d/chef-solr +78 -0
- data/distro/common/html/chef-client.8.html +145 -0
- data/distro/common/html/chef-expander.8.html +164 -0
- data/distro/common/html/chef-expanderctl.8.html +146 -0
- data/distro/common/html/chef-server-webui.8.html +185 -0
- data/distro/common/html/chef-server.8.html +182 -0
- data/distro/common/html/chef-shell.1.html +286 -0
- data/distro/common/html/chef-solo.8.html +191 -0
- data/distro/common/html/chef-solr.8.html +165 -0
- data/distro/common/html/knife-bootstrap.1.html +241 -0
- data/distro/common/html/knife-client.1.html +219 -0
- data/distro/common/html/knife-configure.1.html +170 -0
- data/distro/common/html/knife-cookbook-site.1.html +241 -0
- data/distro/common/html/knife-cookbook.1.html +384 -0
- data/distro/common/html/knife-data-bag.1.html +238 -0
- data/distro/common/html/knife-environment.1.html +267 -0
- data/distro/common/html/knife-exec.1.html +134 -0
- data/distro/common/html/knife-index.1.html +125 -0
- data/distro/common/html/knife-node.1.html +250 -0
- data/distro/common/html/knife-role.1.html +200 -0
- data/distro/common/html/knife-search.1.html +288 -0
- data/distro/common/html/knife-ssh.1.html +156 -0
- data/distro/common/html/knife-status.1.html +128 -0
- data/distro/common/html/knife-tag.1.html +137 -0
- data/distro/common/html/knife.1.html +315 -0
- data/distro/common/man/man1/chef-shell.1 +220 -0
- data/distro/common/man/man1/knife-bootstrap.1 +201 -0
- data/distro/common/man/man1/knife-client.1 +99 -0
- data/distro/common/man/man1/knife-configure.1 +88 -0
- data/distro/common/man/man1/knife-cookbook-site.1 +145 -0
- data/distro/common/man/man1/knife-cookbook.1 +345 -0
- data/distro/common/man/man1/knife-data-bag.1 +136 -0
- data/distro/common/man/man1/knife-environment.1 +178 -0
- data/distro/common/man/man1/knife-exec.1 +43 -0
- data/distro/common/man/man1/knife-index.1 +29 -0
- data/distro/common/man/man1/knife-node.1 +134 -0
- data/distro/common/man/man1/knife-role.1 +88 -0
- data/distro/common/man/man1/knife-search.1 +280 -0
- data/distro/common/man/man1/knife-ssh.1 +79 -0
- data/distro/common/man/man1/knife-status.1 +29 -0
- data/distro/common/man/man1/knife-tag.1 +43 -0
- data/distro/common/man/man1/knife.1 +285 -0
- data/distro/common/man/man8/chef-client.8 +104 -0
- data/distro/common/man/man8/chef-expander.8 +97 -0
- data/distro/common/man/man8/chef-expanderctl.8 +62 -0
- data/distro/common/man/man8/chef-server-webui.8 +155 -0
- data/distro/common/man/man8/chef-server.8 +147 -0
- data/distro/common/man/man8/chef-solo.8 +158 -0
- data/distro/common/man/man8/chef-solr.8 +122 -0
- data/distro/common/markdown/README +3 -0
- data/distro/common/markdown/man1/chef-shell.mkd +195 -0
- data/distro/common/markdown/man1/knife-bootstrap.mkd +141 -0
- data/distro/common/markdown/man1/knife-client.mkd +103 -0
- data/distro/common/markdown/man1/knife-configure.mkd +70 -0
- data/distro/common/markdown/man1/knife-cookbook-site.mkd +123 -0
- data/distro/common/markdown/man1/knife-cookbook.mkd +263 -0
- data/distro/common/markdown/man1/knife-data-bag.mkd +121 -0
- data/distro/common/markdown/man1/knife-environment.mkd +151 -0
- data/distro/common/markdown/man1/knife-exec.mkd +42 -0
- data/distro/common/markdown/man1/knife-index.mkd +30 -0
- data/distro/common/markdown/man1/knife-node.mkd +130 -0
- data/distro/common/markdown/man1/knife-role.mkd +85 -0
- data/distro/common/markdown/man1/knife-search.mkd +180 -0
- data/distro/common/markdown/man1/knife-ssh.mkd +69 -0
- data/distro/common/markdown/man1/knife-status.mkd +36 -0
- data/distro/common/markdown/man1/knife-tag.mkd +39 -0
- data/distro/common/markdown/man1/knife.mkd +213 -0
- data/distro/common/markdown/man8/chef-client.mkd +74 -0
- data/distro/common/markdown/man8/chef-expander.mkd +82 -0
- data/distro/common/markdown/man8/chef-expanderctl.mkd +58 -0
- data/distro/common/markdown/man8/chef-server-webui.mkd +121 -0
- data/distro/common/markdown/man8/chef-server.mkd +121 -0
- data/distro/common/markdown/man8/chef-solo.mkd +107 -0
- data/distro/common/markdown/man8/chef-solr.mkd +89 -0
- data/distro/debian/etc/default/chef-client +4 -0
- data/distro/debian/etc/default/chef-expander +8 -0
- data/distro/debian/etc/default/chef-server +9 -0
- data/distro/debian/etc/default/chef-server-webui +9 -0
- data/distro/debian/etc/default/chef-solr +8 -0
- data/distro/debian/etc/init.d/chef-client +210 -0
- data/distro/debian/etc/init.d/chef-expander +176 -0
- data/distro/debian/etc/init.d/chef-server +122 -0
- data/distro/debian/etc/init.d/chef-server-webui +123 -0
- data/distro/debian/etc/init.d/chef-solr +176 -0
- data/distro/debian/etc/init/chef-client.conf +17 -0
- data/distro/debian/etc/init/chef-expander.conf +17 -0
- data/distro/debian/etc/init/chef-server-webui.conf +17 -0
- data/distro/debian/etc/init/chef-server.conf +17 -0
- data/distro/debian/etc/init/chef-solr.conf +17 -0
- data/distro/redhat/etc/init.d/chef-client +121 -0
- data/distro/redhat/etc/init.d/chef-expander +104 -0
- data/distro/redhat/etc/init.d/chef-server +112 -0
- data/distro/redhat/etc/init.d/chef-server-webui +112 -0
- data/distro/redhat/etc/init.d/chef-solr +104 -0
- data/distro/redhat/etc/logrotate.d/chef-client +8 -0
- data/distro/redhat/etc/logrotate.d/chef-expander +8 -0
- data/distro/redhat/etc/logrotate.d/chef-server +8 -0
- data/distro/redhat/etc/logrotate.d/chef-server-webui +8 -0
- data/distro/redhat/etc/logrotate.d/chef-solr +8 -0
- data/distro/redhat/etc/sysconfig/chef-client +15 -0
- data/distro/redhat/etc/sysconfig/chef-expander +7 -0
- data/distro/redhat/etc/sysconfig/chef-server +14 -0
- data/distro/redhat/etc/sysconfig/chef-server-webui +14 -0
- data/distro/redhat/etc/sysconfig/chef-solr +8 -0
- data/distro/windows/service_manager.rb +164 -0
- data/lib/chef/api_client.rb +205 -0
- data/lib/chef/api_client/registration.rb +126 -0
- data/lib/chef/application.rb +225 -0
- data/lib/chef/application/agent.rb +18 -0
- data/lib/chef/application/apply.rb +160 -0
- data/lib/chef/application/client.rb +340 -0
- data/lib/chef/application/knife.rb +183 -0
- data/lib/chef/application/solo.rb +263 -0
- data/lib/chef/application/windows_service.rb +230 -0
- data/lib/chef/applications.rb +5 -0
- data/lib/chef/checksum/storage.rb +18 -0
- data/lib/chef/checksum/storage/filesystem.rb +56 -0
- data/lib/chef/chef_fs.rb +11 -0
- data/lib/chef/chef_fs/command_line.rb +232 -0
- data/lib/chef/chef_fs/file_pattern.rb +312 -0
- data/lib/chef/chef_fs/file_system.rb +358 -0
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +47 -0
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +121 -0
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +109 -0
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +31 -0
- data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/cookbook_dir.rb +188 -0
- data/lib/chef/chef_fs/file_system/cookbook_file.rb +78 -0
- data/lib/chef/chef_fs/file_system/cookbook_subdir.rb +54 -0
- data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +68 -0
- data/lib/chef/chef_fs/file_system/data_bag_dir.rb +78 -0
- data/lib/chef/chef_fs/file_system/data_bag_item.rb +59 -0
- data/lib/chef/chef_fs/file_system/data_bags_dir.rb +66 -0
- data/lib/chef/chef_fs/file_system/file_system_entry.rb +90 -0
- data/lib/chef/chef_fs/file_system/file_system_error.rb +31 -0
- data/lib/chef/chef_fs/file_system/file_system_root_dir.rb +31 -0
- data/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +31 -0
- data/lib/chef/chef_fs/file_system/nodes_dir.rb +47 -0
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +40 -0
- data/lib/chef/chef_fs/file_system/not_found_error.rb +31 -0
- data/lib/chef/chef_fs/file_system/rest_list_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/rest_list_entry.rb +123 -0
- data/lib/chef/chef_fs/knife.rb +77 -0
- data/lib/chef/chef_fs/path_utils.rb +64 -0
- data/lib/chef/client.rb +556 -0
- data/lib/chef/config.rb +354 -0
- data/lib/chef/cookbook/chefignore.rb +66 -0
- data/lib/chef/cookbook/cookbook_collection.rb +45 -0
- data/lib/chef/cookbook/cookbook_version_loader.rb +171 -0
- data/lib/chef/cookbook/file_system_file_vendor.rb +56 -0
- data/lib/chef/cookbook/file_vendor.rb +48 -0
- data/lib/chef/cookbook/metadata.rb +627 -0
- data/lib/chef/cookbook/remote_file_vendor.rb +84 -0
- data/lib/chef/cookbook/synchronizer.rb +216 -0
- data/lib/chef/cookbook/syntax_check.rb +183 -0
- data/lib/chef/cookbook_loader.rb +134 -0
- data/lib/chef/cookbook_site_streaming_uploader.rb +244 -0
- data/lib/chef/cookbook_uploader.rb +164 -0
- data/lib/chef/cookbook_version.rb +782 -0
- data/lib/chef/daemon.rb +172 -0
- data/lib/chef/data_bag.rb +145 -0
- data/lib/chef/data_bag_item.rb +214 -0
- data/lib/chef/digester.rb +73 -0
- data/lib/chef/dsl.rb +6 -0
- data/lib/chef/dsl/data_query.rb +71 -0
- data/lib/chef/dsl/include_attribute.rb +63 -0
- data/lib/chef/dsl/include_recipe.rb +45 -0
- data/lib/chef/dsl/platform_introspection.rb +218 -0
- data/lib/chef/dsl/recipe.rb +87 -0
- data/lib/chef/dsl/registry_helper.rb +59 -0
- data/lib/chef/encrypted_data_bag_item.rb +323 -0
- data/lib/chef/environment.rb +287 -0
- data/lib/chef/event_dispatch/base.rb +311 -0
- data/lib/chef/event_dispatch/dispatcher.rb +42 -0
- data/lib/chef/exceptions.rb +275 -0
- data/lib/chef/file_access_control.rb +75 -0
- data/lib/chef/file_access_control/unix.rb +216 -0
- data/lib/chef/file_access_control/windows.rb +310 -0
- data/lib/chef/file_cache.rb +220 -0
- data/lib/chef/formatters/base.rb +250 -0
- data/lib/chef/formatters/doc.rb +236 -0
- data/lib/chef/formatters/error_descriptor.rb +66 -0
- data/lib/chef/formatters/error_inspectors.rb +19 -0
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +111 -0
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +106 -0
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +146 -0
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +80 -0
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +125 -0
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +137 -0
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +117 -0
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +118 -0
- data/lib/chef/formatters/error_mapper.rb +85 -0
- data/lib/chef/formatters/minimal.rb +235 -0
- data/lib/chef/handler.rb +235 -0
- data/lib/chef/handler/error_report.rb +33 -0
- data/lib/chef/handler/json_file.rb +65 -0
- data/lib/chef/json_compat.rb +147 -0
- data/lib/chef/knife.rb +589 -0
- data/lib/chef/knife/bootstrap.rb +233 -0
- data/lib/chef/knife/bootstrap/archlinux-gems.erb +62 -0
- data/lib/chef/knife/bootstrap/centos5-gems.erb +62 -0
- data/lib/chef/knife/bootstrap/chef-full.erb +60 -0
- data/lib/chef/knife/bootstrap/fedora13-gems.erb +44 -0
- data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +53 -0
- data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +48 -0
- data/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +46 -0
- data/lib/chef/knife/client_bulk_delete.rb +65 -0
- data/lib/chef/knife/client_create.rb +80 -0
- data/lib/chef/knife/client_delete.rb +46 -0
- data/lib/chef/knife/client_edit.rb +45 -0
- data/lib/chef/knife/client_list.rb +42 -0
- data/lib/chef/knife/client_reregister.rb +59 -0
- data/lib/chef/knife/client_show.rb +52 -0
- data/lib/chef/knife/configure.rb +170 -0
- data/lib/chef/knife/configure_client.rb +50 -0
- data/lib/chef/knife/cookbook_bulk_delete.rb +72 -0
- data/lib/chef/knife/cookbook_create.rb +447 -0
- data/lib/chef/knife/cookbook_delete.rb +151 -0
- data/lib/chef/knife/cookbook_download.rb +137 -0
- data/lib/chef/knife/cookbook_list.rb +47 -0
- data/lib/chef/knife/cookbook_metadata.rb +108 -0
- data/lib/chef/knife/cookbook_metadata_from_file.rb +44 -0
- data/lib/chef/knife/cookbook_show.rb +102 -0
- data/lib/chef/knife/cookbook_site_download.rb +109 -0
- data/lib/chef/knife/cookbook_site_install.rb +164 -0
- data/lib/chef/knife/cookbook_site_list.rb +62 -0
- data/lib/chef/knife/cookbook_site_search.rb +51 -0
- data/lib/chef/knife/cookbook_site_share.rb +114 -0
- data/lib/chef/knife/cookbook_site_show.rb +60 -0
- data/lib/chef/knife/cookbook_site_unshare.rb +56 -0
- data/lib/chef/knife/cookbook_site_vendor.rb +46 -0
- data/lib/chef/knife/cookbook_test.rb +94 -0
- data/lib/chef/knife/cookbook_upload.rb +295 -0
- data/lib/chef/knife/core/bootstrap_context.rb +106 -0
- data/lib/chef/knife/core/cookbook_scm_repo.rb +160 -0
- data/lib/chef/knife/core/generic_presenter.rb +204 -0
- data/lib/chef/knife/core/node_editor.rb +130 -0
- data/lib/chef/knife/core/node_presenter.rb +137 -0
- data/lib/chef/knife/core/object_loader.rb +112 -0
- data/lib/chef/knife/core/subcommand_loader.rb +112 -0
- data/lib/chef/knife/core/text_formatter.rb +86 -0
- data/lib/chef/knife/core/ui.rb +219 -0
- data/lib/chef/knife/data_bag_create.rb +93 -0
- data/lib/chef/knife/data_bag_delete.rb +51 -0
- data/lib/chef/knife/data_bag_edit.rb +94 -0
- data/lib/chef/knife/data_bag_from_file.rb +136 -0
- data/lib/chef/knife/data_bag_list.rb +46 -0
- data/lib/chef/knife/data_bag_show.rb +81 -0
- data/lib/chef/knife/delete.rb +39 -0
- data/lib/chef/knife/diff.rb +46 -0
- data/lib/chef/knife/download.rb +50 -0
- data/lib/chef/knife/environment_create.rb +53 -0
- data/lib/chef/knife/environment_delete.rb +45 -0
- data/lib/chef/knife/environment_edit.rb +45 -0
- data/lib/chef/knife/environment_from_file.rb +83 -0
- data/lib/chef/knife/environment_list.rb +42 -0
- data/lib/chef/knife/environment_show.rb +53 -0
- data/lib/chef/knife/exec.rb +86 -0
- data/lib/chef/knife/help.rb +103 -0
- data/lib/chef/knife/help_topics.rb +4 -0
- data/lib/chef/knife/index_rebuild.rb +134 -0
- data/lib/chef/knife/list.rb +109 -0
- data/lib/chef/knife/node_bulk_delete.rb +80 -0
- data/lib/chef/knife/node_create.rb +50 -0
- data/lib/chef/knife/node_delete.rb +47 -0
- data/lib/chef/knife/node_edit.rb +72 -0
- data/lib/chef/knife/node_from_file.rb +50 -0
- data/lib/chef/knife/node_list.rb +46 -0
- data/lib/chef/knife/node_run_list_add.rb +75 -0
- data/lib/chef/knife/node_run_list_remove.rb +48 -0
- data/lib/chef/knife/node_show.rb +73 -0
- data/lib/chef/knife/raw.rb +108 -0
- data/lib/chef/knife/recipe_list.rb +32 -0
- data/lib/chef/knife/role_bulk_delete.rb +70 -0
- data/lib/chef/knife/role_create.rb +55 -0
- data/lib/chef/knife/role_delete.rb +47 -0
- data/lib/chef/knife/role_edit.rb +48 -0
- data/lib/chef/knife/role_from_file.rb +56 -0
- data/lib/chef/knife/role_list.rb +43 -0
- data/lib/chef/knife/role_show.rb +54 -0
- data/lib/chef/knife/search.rb +159 -0
- data/lib/chef/knife/show.rb +32 -0
- data/lib/chef/knife/ssh.rb +463 -0
- data/lib/chef/knife/status.rb +119 -0
- data/lib/chef/knife/tag_create.rb +52 -0
- data/lib/chef/knife/tag_delete.rb +60 -0
- data/lib/chef/knife/tag_list.rb +47 -0
- data/lib/chef/knife/upload.rb +50 -0
- data/lib/chef/knife/user_create.rb +93 -0
- data/lib/chef/knife/user_delete.rb +46 -0
- data/lib/chef/knife/user_edit.rb +53 -0
- data/lib/chef/knife/user_list.rb +42 -0
- data/lib/chef/knife/user_reregister.rb +59 -0
- data/lib/chef/knife/user_show.rb +52 -0
- data/lib/chef/log.rb +39 -0
- data/lib/chef/mash.rb +225 -0
- data/lib/chef/mixin/checksum.rb +32 -0
- data/lib/chef/mixin/command.rb +164 -0
- data/lib/chef/mixin/command/unix.rb +220 -0
- data/lib/chef/mixin/command/windows.rb +76 -0
- data/lib/chef/mixin/convert_to_class_name.rb +65 -0
- data/lib/chef/mixin/create_path.rb +57 -0
- data/lib/chef/mixin/deep_merge.rb +168 -0
- data/lib/chef/mixin/deprecation.rb +100 -0
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +39 -0
- data/lib/chef/mixin/file_class.rb +46 -0
- data/lib/chef/mixin/from_file.rb +50 -0
- data/lib/chef/mixin/get_source_from_package.rb +42 -0
- data/lib/chef/mixin/language.rb +48 -0
- data/lib/chef/mixin/language_include_attribute.rb +35 -0
- data/lib/chef/mixin/language_include_recipe.rb +32 -0
- data/lib/chef/mixin/params_validate.rb +225 -0
- data/lib/chef/mixin/path_sanity.rb +67 -0
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +35 -0
- data/lib/chef/mixin/securable.rb +205 -0
- data/lib/chef/mixin/shell_out.rb +69 -0
- data/lib/chef/mixin/template.rb +140 -0
- data/lib/chef/mixin/why_run.rb +332 -0
- data/lib/chef/mixin/xml_escape.rb +140 -0
- data/lib/chef/mixins.rb +14 -0
- data/lib/chef/monkey_patches/dir.rb +36 -0
- data/lib/chef/monkey_patches/fileutils.rb +65 -0
- data/lib/chef/monkey_patches/net_http.rb +22 -0
- data/lib/chef/monkey_patches/numeric.rb +15 -0
- data/lib/chef/monkey_patches/object.rb +9 -0
- data/lib/chef/monkey_patches/regexp.rb +34 -0
- data/lib/chef/monkey_patches/string.rb +49 -0
- data/lib/chef/monkey_patches/tempfile.rb +64 -0
- data/lib/chef/nil_argument.rb +3 -0
- data/lib/chef/node.rb +509 -0
- data/lib/chef/node/attribute.rb +398 -0
- data/lib/chef/node/attribute_collections.rb +206 -0
- data/lib/chef/node/immutable_collections.rb +186 -0
- data/lib/chef/platform.rb +519 -0
- data/lib/chef/provider.rb +176 -0
- data/lib/chef/provider/breakpoint.rb +36 -0
- data/lib/chef/provider/cookbook_file.rb +113 -0
- data/lib/chef/provider/cron.rb +214 -0
- data/lib/chef/provider/cron/solaris.rb +56 -0
- data/lib/chef/provider/deploy.rb +475 -0
- data/lib/chef/provider/deploy/revision.rb +80 -0
- data/lib/chef/provider/deploy/timestamped.rb +32 -0
- data/lib/chef/provider/directory.rb +131 -0
- data/lib/chef/provider/env.rb +152 -0
- data/lib/chef/provider/env/windows.rb +75 -0
- data/lib/chef/provider/erl_call.rb +106 -0
- data/lib/chef/provider/execute.rb +68 -0
- data/lib/chef/provider/file.rb +328 -0
- data/lib/chef/provider/git.rb +260 -0
- data/lib/chef/provider/group.rb +158 -0
- data/lib/chef/provider/group/aix.rb +70 -0
- data/lib/chef/provider/group/dscl.rb +129 -0
- data/lib/chef/provider/group/gpasswd.rb +65 -0
- data/lib/chef/provider/group/groupadd.rb +96 -0
- data/lib/chef/provider/group/groupmod.rb +120 -0
- data/lib/chef/provider/group/pw.rb +93 -0
- data/lib/chef/provider/group/suse.rb +60 -0
- data/lib/chef/provider/group/usermod.rb +68 -0
- data/lib/chef/provider/group/windows.rb +79 -0
- data/lib/chef/provider/http_request.rb +119 -0
- data/lib/chef/provider/ifconfig.rb +214 -0
- data/lib/chef/provider/link.rb +132 -0
- data/lib/chef/provider/log.rb +54 -0
- data/lib/chef/provider/lwrp_base.rb +150 -0
- data/lib/chef/provider/mdadm.rb +92 -0
- data/lib/chef/provider/mount.rb +128 -0
- data/lib/chef/provider/mount/mount.rb +252 -0
- data/lib/chef/provider/mount/windows.rb +81 -0
- data/lib/chef/provider/ohai.rb +47 -0
- data/lib/chef/provider/package.rb +229 -0
- data/lib/chef/provider/package/apt.rb +147 -0
- data/lib/chef/provider/package/dpkg.rb +128 -0
- data/lib/chef/provider/package/easy_install.rb +136 -0
- data/lib/chef/provider/package/freebsd.rb +149 -0
- data/lib/chef/provider/package/ips.rb +101 -0
- data/lib/chef/provider/package/macports.rb +105 -0
- data/lib/chef/provider/package/pacman.rb +111 -0
- data/lib/chef/provider/package/portage.rb +138 -0
- data/lib/chef/provider/package/rpm.rb +121 -0
- data/lib/chef/provider/package/rubygems.rb +548 -0
- data/lib/chef/provider/package/smartos.rb +84 -0
- data/lib/chef/provider/package/solaris.rb +139 -0
- data/lib/chef/provider/package/yum-dump.py +307 -0
- data/lib/chef/provider/package/yum.rb +1255 -0
- data/lib/chef/provider/package/zypper.rb +144 -0
- data/lib/chef/provider/registry_key.rb +156 -0
- data/lib/chef/provider/remote_directory.rb +180 -0
- data/lib/chef/provider/remote_file.rb +141 -0
- data/lib/chef/provider/resource_update.rb +55 -0
- data/lib/chef/provider/route.rb +223 -0
- data/lib/chef/provider/ruby_block.rb +42 -0
- data/lib/chef/provider/script.rb +57 -0
- data/lib/chef/provider/service.rb +173 -0
- data/lib/chef/provider/service/arch.rb +113 -0
- data/lib/chef/provider/service/debian.rb +152 -0
- data/lib/chef/provider/service/freebsd.rb +175 -0
- data/lib/chef/provider/service/gentoo.rb +67 -0
- data/lib/chef/provider/service/init.rb +89 -0
- data/lib/chef/provider/service/insserv.rb +52 -0
- data/lib/chef/provider/service/invokercd.rb +35 -0
- data/lib/chef/provider/service/macosx.rb +144 -0
- data/lib/chef/provider/service/redhat.rb +77 -0
- data/lib/chef/provider/service/simple.rb +172 -0
- data/lib/chef/provider/service/solaris.rb +86 -0
- data/lib/chef/provider/service/systemd.rb +115 -0
- data/lib/chef/provider/service/upstart.rb +232 -0
- data/lib/chef/provider/service/windows.rb +163 -0
- data/lib/chef/provider/subversion.rb +214 -0
- data/lib/chef/provider/template.rb +120 -0
- data/lib/chef/provider/template_finder.rb +61 -0
- data/lib/chef/provider/user.rb +206 -0
- data/lib/chef/provider/user/dscl.rb +288 -0
- data/lib/chef/provider/user/pw.rb +113 -0
- data/lib/chef/provider/user/useradd.rb +144 -0
- data/lib/chef/provider/user/windows.rb +124 -0
- data/lib/chef/providers.rb +103 -0
- data/lib/chef/recipe.rb +135 -0
- data/lib/chef/reserved_names.rb +9 -0
- data/lib/chef/resource.rb +794 -0
- data/lib/chef/resource/apt_package.rb +43 -0
- data/lib/chef/resource/bash.rb +33 -0
- data/lib/chef/resource/breakpoint.rb +35 -0
- data/lib/chef/resource/chef_gem.rb +53 -0
- data/lib/chef/resource/conditional.rb +101 -0
- data/lib/chef/resource/cookbook_file.rb +52 -0
- data/lib/chef/resource/cron.rb +202 -0
- data/lib/chef/resource/csh.rb +33 -0
- data/lib/chef/resource/deploy.rb +403 -0
- data/lib/chef/resource/deploy_revision.rb +40 -0
- data/lib/chef/resource/directory.rb +65 -0
- data/lib/chef/resource/dpkg_package.rb +34 -0
- data/lib/chef/resource/easy_install_package.rb +57 -0
- data/lib/chef/resource/env.rb +63 -0
- data/lib/chef/resource/erl_call.rb +86 -0
- data/lib/chef/resource/execute.rb +132 -0
- data/lib/chef/resource/file.rb +96 -0
- data/lib/chef/resource/freebsd_package.rb +35 -0
- data/lib/chef/resource/gem_package.rb +53 -0
- data/lib/chef/resource/git.rb +46 -0
- data/lib/chef/resource/group.rb +83 -0
- data/lib/chef/resource/http_request.rb +65 -0
- data/lib/chef/resource/ifconfig.rb +149 -0
- data/lib/chef/resource/ips_package.rb +42 -0
- data/lib/chef/resource/link.rb +92 -0
- data/lib/chef/resource/log.rb +74 -0
- data/lib/chef/resource/lwrp_base.rb +127 -0
- data/lib/chef/resource/macports_package.rb +29 -0
- data/lib/chef/resource/mdadm.rb +105 -0
- data/lib/chef/resource/mount.rb +139 -0
- data/lib/chef/resource/ohai.rb +54 -0
- data/lib/chef/resource/package.rb +84 -0
- data/lib/chef/resource/pacman_package.rb +33 -0
- data/lib/chef/resource/perl.rb +33 -0
- data/lib/chef/resource/portage_package.rb +33 -0
- data/lib/chef/resource/python.rb +33 -0
- data/lib/chef/resource/registry_key.rb +86 -0
- data/lib/chef/resource/remote_directory.rb +126 -0
- data/lib/chef/resource/remote_file.rb +81 -0
- data/lib/chef/resource/route.rb +140 -0
- data/lib/chef/resource/rpm_package.rb +34 -0
- data/lib/chef/resource/ruby.rb +33 -0
- data/lib/chef/resource/ruby_block.rb +51 -0
- data/lib/chef/resource/scm.rb +151 -0
- data/lib/chef/resource/script.rb +63 -0
- data/lib/chef/resource/service.rb +178 -0
- data/lib/chef/resource/smartos_package.rb +36 -0
- data/lib/chef/resource/solaris_package.rb +36 -0
- data/lib/chef/resource/subversion.rb +37 -0
- data/lib/chef/resource/template.rb +76 -0
- data/lib/chef/resource/timestamped_deploy.rb +31 -0
- data/lib/chef/resource/user.rb +134 -0
- data/lib/chef/resource/yum_package.rb +63 -0
- data/lib/chef/resource_collection.rb +221 -0
- data/lib/chef/resource_collection/stepable_iterator.rb +124 -0
- data/lib/chef/resource_definition.rb +67 -0
- data/lib/chef/resource_definition_list.rb +38 -0
- data/lib/chef/resource_platform_map.rb +151 -0
- data/lib/chef/resource_reporter.rb +281 -0
- data/lib/chef/resources.rb +69 -0
- data/lib/chef/rest.rb +438 -0
- data/lib/chef/rest/auth_credentials.rb +57 -0
- data/lib/chef/rest/cookie_jar.rb +31 -0
- data/lib/chef/rest/rest_request.rb +229 -0
- data/lib/chef/role.rb +253 -0
- data/lib/chef/run_context.rb +214 -0
- data/lib/chef/run_context/cookbook_compiler.rb +280 -0
- data/lib/chef/run_list.rb +163 -0
- data/lib/chef/run_list/run_list_expansion.rb +191 -0
- data/lib/chef/run_list/run_list_item.rb +99 -0
- data/lib/chef/run_list/versioned_recipe_list.rb +68 -0
- data/lib/chef/run_lock.rb +90 -0
- data/lib/chef/run_status.rb +124 -0
- data/lib/chef/runner.rb +118 -0
- data/lib/chef/sandbox.rb +20 -0
- data/lib/chef/scan_access_control.rb +133 -0
- data/lib/chef/search/query.rb +65 -0
- data/lib/chef/shef/ext.rb +19 -0
- data/lib/chef/shell.rb +329 -0
- data/lib/chef/shell/ext.rb +593 -0
- data/lib/chef/shell/model_wrapper.rb +120 -0
- data/lib/chef/shell/shell_rest.rb +28 -0
- data/lib/chef/shell/shell_session.rb +298 -0
- data/lib/chef/shell_out.rb +13 -0
- data/lib/chef/streaming_cookbook_uploader.rb +201 -0
- data/lib/chef/tasks/chef_repo.rake +334 -0
- data/lib/chef/user.rb +182 -0
- data/lib/chef/util/file_edit.rb +132 -0
- data/lib/chef/util/windows.rb +56 -0
- data/lib/chef/util/windows/net_group.rb +101 -0
- data/lib/chef/util/windows/net_use.rb +121 -0
- data/lib/chef/util/windows/net_user.rb +198 -0
- data/lib/chef/util/windows/volume.rb +59 -0
- data/lib/chef/version.rb +23 -0
- data/lib/chef/version_class.rb +70 -0
- data/lib/chef/version_constraint.rb +116 -0
- data/lib/chef/win32/api.rb +364 -0
- data/lib/chef/win32/api/error.rb +921 -0
- data/lib/chef/win32/api/file.rb +535 -0
- data/lib/chef/win32/api/memory.rb +105 -0
- data/lib/chef/win32/api/process.rb +41 -0
- data/lib/chef/win32/api/psapi.rb +51 -0
- data/lib/chef/win32/api/security.rb +385 -0
- data/lib/chef/win32/api/system.rb +192 -0
- data/lib/chef/win32/api/unicode.rb +178 -0
- data/lib/chef/win32/error.rb +73 -0
- data/lib/chef/win32/file.rb +167 -0
- data/lib/chef/win32/file/info.rb +100 -0
- data/lib/chef/win32/handle.rb +55 -0
- data/lib/chef/win32/memory.rb +101 -0
- data/lib/chef/win32/process.rb +84 -0
- data/lib/chef/win32/registry.rb +382 -0
- data/lib/chef/win32/security.rb +508 -0
- data/lib/chef/win32/security/ace.rb +125 -0
- data/lib/chef/win32/security/acl.rb +101 -0
- data/lib/chef/win32/security/securable_object.rb +109 -0
- data/lib/chef/win32/security/security_descriptor.rb +93 -0
- data/lib/chef/win32/security/sid.rb +199 -0
- data/lib/chef/win32/security/token.rb +64 -0
- data/lib/chef/win32/unicode.rb +43 -0
- data/lib/chef/win32/version.rb +119 -0
- metadata +553 -3
@@ -0,0 +1,57 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Adam Jacob (<adam@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'tempfile'
|
20
|
+
require 'chef/provider/execute'
|
21
|
+
|
22
|
+
class Chef
|
23
|
+
class Provider
|
24
|
+
class Script < Chef::Provider::Execute
|
25
|
+
|
26
|
+
def action_run
|
27
|
+
script_file.puts(@new_resource.code)
|
28
|
+
script_file.close
|
29
|
+
|
30
|
+
set_owner_and_group
|
31
|
+
|
32
|
+
@new_resource.command("\"#{@new_resource.interpreter}\" #{@new_resource.flags} \"#{script_file.path}\"")
|
33
|
+
super
|
34
|
+
converge_by(nil) do
|
35
|
+
# ensure script is unlinked at end of converge!
|
36
|
+
unlink_script_file
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def set_owner_and_group
|
41
|
+
# FileUtils itself implements a no-op if +user+ or +group+ are nil
|
42
|
+
# You can prove this by running FileUtils.chown(nil,nil,'/tmp/file')
|
43
|
+
# as an unprivileged user.
|
44
|
+
FileUtils.chown(@new_resource.user, @new_resource.group, script_file.path)
|
45
|
+
end
|
46
|
+
|
47
|
+
def script_file
|
48
|
+
@script_file ||= Tempfile.open("chef-script")
|
49
|
+
end
|
50
|
+
|
51
|
+
def unlink_script_file
|
52
|
+
@script_file && @script_file.close!
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
#
|
2
|
+
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
3
|
+
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'chef/mixin/command'
|
20
|
+
require 'chef/provider'
|
21
|
+
|
22
|
+
class Chef
|
23
|
+
class Provider
|
24
|
+
class Service < Chef::Provider
|
25
|
+
|
26
|
+
include Chef::Mixin::Command
|
27
|
+
|
28
|
+
def initialize(new_resource, run_context)
|
29
|
+
super
|
30
|
+
@enabled = nil
|
31
|
+
end
|
32
|
+
|
33
|
+
def whyrun_supported?
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
def load_new_resource_state
|
38
|
+
# If the user didn't specify a change in enabled state,
|
39
|
+
# it will be the same as the old resource
|
40
|
+
if ( @new_resource.enabled.nil? )
|
41
|
+
@new_resource.enabled(@current_resource.enabled)
|
42
|
+
end
|
43
|
+
if ( @new_resource.running.nil? )
|
44
|
+
@new_resource.running(@current_resource.running)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def shared_resource_requirements
|
49
|
+
end
|
50
|
+
|
51
|
+
def define_resource_requirements
|
52
|
+
requirements.assert(:reload) do |a|
|
53
|
+
a.assertion { @new_resource.supports[:reload] || @new_resource.reload_command }
|
54
|
+
a.failure_message Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :reload"
|
55
|
+
# if a service is not declared to support reload, that won't
|
56
|
+
# typically change during the course of a run - so no whyrun
|
57
|
+
# alternative here.
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def action_enable
|
62
|
+
if @current_resource.enabled
|
63
|
+
Chef::Log.debug("#{@new_resource} already enabled - nothing to do")
|
64
|
+
else
|
65
|
+
converge_by("enable service #{@new_resource}") do
|
66
|
+
enable_service
|
67
|
+
Chef::Log.info("#{@new_resource} enabled")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
load_new_resource_state
|
71
|
+
@new_resource.enabled(true)
|
72
|
+
end
|
73
|
+
|
74
|
+
def action_disable
|
75
|
+
if @current_resource.enabled
|
76
|
+
converge_by("disable service #{@new_resource}") do
|
77
|
+
disable_service
|
78
|
+
Chef::Log.info("#{@new_resource} disabled")
|
79
|
+
end
|
80
|
+
else
|
81
|
+
Chef::Log.debug("#{@new_resource} already disabled - nothing to do")
|
82
|
+
end
|
83
|
+
load_new_resource_state
|
84
|
+
@new_resource.enabled(false)
|
85
|
+
end
|
86
|
+
|
87
|
+
def action_start
|
88
|
+
unless @current_resource.running
|
89
|
+
converge_by("start service #{@new_resource}") do
|
90
|
+
start_service
|
91
|
+
Chef::Log.info("#{@new_resource} started")
|
92
|
+
end
|
93
|
+
else
|
94
|
+
Chef::Log.debug("#{@new_resource} already running - nothing to do")
|
95
|
+
end
|
96
|
+
load_new_resource_state
|
97
|
+
@new_resource.running(true)
|
98
|
+
end
|
99
|
+
|
100
|
+
def action_stop
|
101
|
+
if @current_resource.running
|
102
|
+
converge_by("stop service #{@new_resource}") do
|
103
|
+
stop_service
|
104
|
+
Chef::Log.info("#{@new_resource} stopped")
|
105
|
+
end
|
106
|
+
else
|
107
|
+
Chef::Log.debug("#{@new_resource} already stopped - nothing to do")
|
108
|
+
end
|
109
|
+
load_new_resource_state
|
110
|
+
@new_resource.running(false)
|
111
|
+
end
|
112
|
+
|
113
|
+
def action_restart
|
114
|
+
converge_by("restart service #{@new_resource}") do
|
115
|
+
restart_service
|
116
|
+
Chef::Log.info("#{@new_resource} restarted")
|
117
|
+
end
|
118
|
+
load_new_resource_state
|
119
|
+
@new_resource.running(true)
|
120
|
+
end
|
121
|
+
|
122
|
+
def action_reload
|
123
|
+
if @current_resource.running
|
124
|
+
converge_by("reload service #{@new_resource}") do
|
125
|
+
reload_service
|
126
|
+
Chef::Log.info("#{@new_resource} reloaded")
|
127
|
+
end
|
128
|
+
end
|
129
|
+
load_new_resource_state
|
130
|
+
end
|
131
|
+
|
132
|
+
def enable_service
|
133
|
+
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :enable"
|
134
|
+
end
|
135
|
+
|
136
|
+
def disable_service
|
137
|
+
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :disable"
|
138
|
+
end
|
139
|
+
|
140
|
+
def start_service
|
141
|
+
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :start"
|
142
|
+
end
|
143
|
+
|
144
|
+
def stop_service
|
145
|
+
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :stop"
|
146
|
+
end
|
147
|
+
|
148
|
+
def restart_service
|
149
|
+
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :restart"
|
150
|
+
end
|
151
|
+
|
152
|
+
def reload_service
|
153
|
+
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :restart"
|
154
|
+
end
|
155
|
+
|
156
|
+
protected
|
157
|
+
|
158
|
+
def default_init_command
|
159
|
+
if @new_resource.init_command
|
160
|
+
@new_resource.init_command
|
161
|
+
elsif self.instance_variable_defined?(:@init_command)
|
162
|
+
@init_command
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def custom_command_for_action?(action)
|
167
|
+
method_name = "#{action}_command".to_sym
|
168
|
+
@new_resource.respond_to?(method_name) &&
|
169
|
+
!!@new_resource.send(method_name)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Jan Zimmek (<jan.zimmek@web.de>)
|
3
|
+
# Copyright:: Copyright (c) 2010 Jan Zimmek
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'chef/provider/service/init'
|
20
|
+
require 'chef/mixin/command'
|
21
|
+
|
22
|
+
class Chef::Provider::Service::Arch < Chef::Provider::Service::Init
|
23
|
+
|
24
|
+
def initialize(new_resource, run_context)
|
25
|
+
super
|
26
|
+
@init_command = "/etc/rc.d/#{@new_resource.service_name}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def load_current_resource
|
30
|
+
raise Chef::Exceptions::Service, "Could not find /etc/rc.conf" unless ::File.exists?("/etc/rc.conf")
|
31
|
+
raise Chef::Exceptions::Service, "No DAEMONS found in /etc/rc.conf" unless ::File.read("/etc/rc.conf").match(/DAEMONS=\((.*)\)/m)
|
32
|
+
super
|
33
|
+
|
34
|
+
@current_resource.enabled(daemons.include?(@current_resource.service_name))
|
35
|
+
@current_resource
|
36
|
+
end
|
37
|
+
|
38
|
+
# Get list of all daemons from the file '/etc/rc.conf'.
|
39
|
+
# Mutiple lines and background form are supported. Example:
|
40
|
+
# DAEMONS=(\
|
41
|
+
# foobar \
|
42
|
+
# @example \
|
43
|
+
# !net \
|
44
|
+
# )
|
45
|
+
def daemons
|
46
|
+
entries = []
|
47
|
+
if ::File.read("/etc/rc.conf").match(/DAEMONS=\((.*)\)/m)
|
48
|
+
entries += $1.gsub(/\\?[\r\n]/, ' ').gsub(/# *[^ ]+/,' ').split(' ') if $1.length > 0
|
49
|
+
end
|
50
|
+
|
51
|
+
yield(entries) if block_given?
|
52
|
+
|
53
|
+
entries
|
54
|
+
end
|
55
|
+
|
56
|
+
# FIXME: Multiple entries of DAEMONS will cause very bad results :)
|
57
|
+
def update_daemons(entries)
|
58
|
+
content = ::File.read("/etc/rc.conf").gsub(/DAEMONS=\((.*)\)/m, "DAEMONS=(#{entries.join(' ')})")
|
59
|
+
::File.open("/etc/rc.conf", "w") do |f|
|
60
|
+
f.write(content)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def enable_service()
|
65
|
+
new_daemons = []
|
66
|
+
entries = daemons
|
67
|
+
|
68
|
+
if entries.include?(new_resource.service_name) or entries.include?("@#{new_resource.service_name}")
|
69
|
+
# exists and already enabled (or already enabled as a background service)
|
70
|
+
# new_daemons += entries
|
71
|
+
else
|
72
|
+
if entries.include?("!#{new_resource.service_name}")
|
73
|
+
# exists but disabled
|
74
|
+
entries.each do |daemon|
|
75
|
+
if daemon == "!#{new_resource.service_name}"
|
76
|
+
new_daemons << new_resource.service_name
|
77
|
+
else
|
78
|
+
new_daemons << daemon
|
79
|
+
end
|
80
|
+
end
|
81
|
+
else
|
82
|
+
# does not exist
|
83
|
+
new_daemons += entries
|
84
|
+
new_daemons << new_resource.service_name
|
85
|
+
end
|
86
|
+
update_daemons(new_daemons)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def disable_service()
|
91
|
+
new_daemons = []
|
92
|
+
entries = daemons
|
93
|
+
|
94
|
+
if entries.include?("!#{new_resource.service_name}")
|
95
|
+
# exists and disabled
|
96
|
+
# new_daemons += entries
|
97
|
+
else
|
98
|
+
if entries.include?(new_resource.service_name) or entries.include?("@#{new_resource.service_name}")
|
99
|
+
# exists but enabled (or enabled as a back-ground service)
|
100
|
+
# FIXME: Does arch support !@foobar ?
|
101
|
+
entries.each do |daemon|
|
102
|
+
if [new_resource.service_name, "@#{new_resource.service_name}"].include?(daemon)
|
103
|
+
new_daemons << "!#{new_resource.service_name}"
|
104
|
+
else
|
105
|
+
new_daemons << daemon
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
update_daemons(new_daemons)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
#
|
2
|
+
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
3
|
+
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'chef/provider/service'
|
20
|
+
require 'chef/provider/service/init'
|
21
|
+
require 'chef/mixin/command'
|
22
|
+
|
23
|
+
class Chef
|
24
|
+
class Provider
|
25
|
+
class Service
|
26
|
+
class Debian < Chef::Provider::Service::Init
|
27
|
+
UPDATE_RC_D_ENABLED_MATCHES = /\/rc[\dS].d\/S|not installed/i
|
28
|
+
UPDATE_RC_D_PRIORITIES = /\/rc([\dS]).d\/([SK])(\d\d)/i
|
29
|
+
|
30
|
+
def load_current_resource
|
31
|
+
super
|
32
|
+
@priority_success = true
|
33
|
+
@rcd_status = nil
|
34
|
+
@current_resource.priority(get_priority)
|
35
|
+
@current_resource.enabled(service_currently_enabled?(@current_resource.priority))
|
36
|
+
@current_resource
|
37
|
+
end
|
38
|
+
|
39
|
+
def define_resource_requirements
|
40
|
+
# do not call super here, inherit only shared_requirements
|
41
|
+
shared_resource_requirements
|
42
|
+
requirements.assert(:all_actions) do |a|
|
43
|
+
update_rcd = "/usr/sbin/update-rc.d"
|
44
|
+
a.assertion { ::File.exists? update_rcd }
|
45
|
+
a.failure_message Chef::Exceptions::Service, "#{update_rcd} does not exist!"
|
46
|
+
# no whyrun recovery - this is a base system component of debian
|
47
|
+
# distros and must be present
|
48
|
+
end
|
49
|
+
|
50
|
+
requirements.assert(:all_actions) do |a|
|
51
|
+
a.assertion { @priority_success }
|
52
|
+
a.failure_message Chef::Exceptions::Service, "/usr/sbin/update-rc.d -n -f #{@current_resource.service_name} failed - #{@rcd_status.inspect}"
|
53
|
+
# This can happen if the service is not yet installed,so we'll fake it.
|
54
|
+
a.whyrun ["Unable to determine priority of service, assuming service would have been correctly installed earlier in the run.",
|
55
|
+
"Assigning temporary priorities to continue.",
|
56
|
+
"If this service is not properly installed prior to this point, this will fail."] do
|
57
|
+
temp_priorities = {"6"=>[:stop, "20"],
|
58
|
+
"0"=>[:stop, "20"],
|
59
|
+
"1"=>[:stop, "20"],
|
60
|
+
"2"=>[:start, "20"],
|
61
|
+
"3"=>[:start, "20"],
|
62
|
+
"4"=>[:start, "20"],
|
63
|
+
"5"=>[:start, "20"]}
|
64
|
+
@current_resource.priority(temp_priorities)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def get_priority
|
70
|
+
priority = {}
|
71
|
+
|
72
|
+
@rcd_status = popen4("/usr/sbin/update-rc.d -n -f #{@current_resource.service_name} remove") do |pid, stdin, stdout, stderr|
|
73
|
+
|
74
|
+
[stdout, stderr].each do |iop|
|
75
|
+
iop.each_line do |line|
|
76
|
+
if UPDATE_RC_D_PRIORITIES =~ line
|
77
|
+
# priority[runlevel] = [ S|K, priority ]
|
78
|
+
# S = Start, K = Kill
|
79
|
+
# debian runlevels: 0 Halt, 1 Singleuser, 2 Multiuser, 3-5 == 2, 6 Reboot
|
80
|
+
priority[$1] = [($2 == "S" ? :start : :stop), $3]
|
81
|
+
end
|
82
|
+
if line =~ UPDATE_RC_D_ENABLED_MATCHES
|
83
|
+
enabled = true
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
unless @rcd_status.exitstatus == 0
|
90
|
+
@priority_success = false
|
91
|
+
end
|
92
|
+
priority
|
93
|
+
end
|
94
|
+
|
95
|
+
def service_currently_enabled?(priority)
|
96
|
+
enabled = false
|
97
|
+
priority.each { |runlevel, arguments|
|
98
|
+
Chef::Log.debug("#{@new_resource} runlevel #{runlevel}, action #{arguments[0]}, priority #{arguments[1]}")
|
99
|
+
# if we are in a update-rc.d default startup runlevel && we start in this runlevel
|
100
|
+
if (2..5).include?(runlevel.to_i) && arguments[0] == :start
|
101
|
+
enabled = true
|
102
|
+
end
|
103
|
+
}
|
104
|
+
|
105
|
+
enabled
|
106
|
+
end
|
107
|
+
|
108
|
+
def enable_service()
|
109
|
+
if @new_resource.priority.is_a? Integer
|
110
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
|
111
|
+
run_command(:command => "/usr/sbin/update-rc.d #{@new_resource.service_name} defaults #{@new_resource.priority} #{100 - @new_resource.priority}")
|
112
|
+
elsif @new_resource.priority.is_a? Hash
|
113
|
+
# we call the same command regardless of we're enabling or disabling
|
114
|
+
# users passing a Hash are responsible for setting their own start priorities
|
115
|
+
set_priority()
|
116
|
+
else # No priority, go with update-rc.d defaults
|
117
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
|
118
|
+
run_command(:command => "/usr/sbin/update-rc.d #{@new_resource.service_name} defaults")
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
def disable_service()
|
124
|
+
if @new_resource.priority.is_a? Integer
|
125
|
+
# Stop processes in reverse order of start using '100 - start_priority'
|
126
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
|
127
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} stop #{100 - @new_resource.priority} 2 3 4 5 .")
|
128
|
+
elsif @new_resource.priority.is_a? Hash
|
129
|
+
# we call the same command regardless of we're enabling or disabling
|
130
|
+
# users passing a Hash are responsible for setting their own stop priorities
|
131
|
+
set_priority()
|
132
|
+
else
|
133
|
+
# no priority, using '100 - 20 (update-rc.d default)' to stop in reverse order of start
|
134
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
|
135
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} stop 80 2 3 4 5 .")
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def set_priority()
|
140
|
+
args = ""
|
141
|
+
@new_resource.priority.each do |level, o|
|
142
|
+
action = o[0]
|
143
|
+
priority = o[1]
|
144
|
+
args += "#{action} #{priority} #{level} . "
|
145
|
+
end
|
146
|
+
run_command(:command => "/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
|
147
|
+
run_command(:command => "/usr/sbin/update-rc.d #{@new_resource.service_name} #{args}")
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|