vagrant-clone 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/.rakeTasks +7 -0
- data/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/runConfigurations/clone.xml +21 -0
- data/.idea/runConfigurations/libvirt.xml +21 -0
- data/.idea/vagrant-clone.iml +114 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +948 -0
- data/Gemfile +9 -3
- data/Gemfile.lock +123 -37
- data/Rakefile +2 -1
- data/Vagrantfile +9 -0
- data/cookbooks/apt/CHANGELOG.md +321 -0
- data/cookbooks/apt/CONTRIBUTING.md +2 -0
- data/cookbooks/apt/MAINTAINERS.md +15 -0
- data/cookbooks/apt/README.md +250 -0
- data/cookbooks/apt/attributes/default.rb +57 -0
- data/cookbooks/apt/files/15update-stamp +1 -0
- data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/libraries/helpers.rb +49 -0
- data/cookbooks/apt/libraries/matchers.rb +16 -0
- data/cookbooks/apt/metadata.json +1 -0
- data/cookbooks/apt/recipes/cacher-client.rb +52 -0
- data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
- data/cookbooks/apt/recipes/default.rb +93 -0
- data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
- data/cookbooks/apt/resources/preference.rb +90 -0
- data/cookbooks/apt/templates/01proxy.erb +11 -0
- data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
- data/cookbooks/apt/templates/10recommends.erb +3 -0
- data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
- data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
- data/cookbooks/apt/templates/acng.conf.erb +275 -0
- data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
- data/cookbooks/build-essential/.foodcritic +1 -0
- data/cookbooks/build-essential/CHANGELOG.md +257 -0
- data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
- data/cookbooks/build-essential/MAINTAINERS.md +15 -0
- data/cookbooks/build-essential/README.md +134 -0
- data/cookbooks/build-essential/attributes/default.rb +21 -0
- data/cookbooks/build-essential/libraries/matchers.rb +9 -0
- data/cookbooks/build-essential/metadata.json +1 -0
- data/cookbooks/build-essential/recipes/_windows.rb +53 -0
- data/cookbooks/build-essential/recipes/default.rb +24 -0
- data/cookbooks/build-essential/resources/build_essential.rb +106 -0
- data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
- data/cookbooks/compat_resource/CHANGELOG.md +53 -0
- data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
- data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
- data/cookbooks/compat_resource/README.md +60 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
- data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
- data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
- data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
- data/cookbooks/compat_resource/metadata.json +1 -0
- data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
- data/cookbooks/inifile_chef_gem/README.md +46 -0
- data/cookbooks/inifile_chef_gem/metadata.json +51 -0
- data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
- data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
- data/cookbooks/mariadb/CHANGELOG.md +332 -0
- data/cookbooks/mariadb/README.md +225 -0
- data/cookbooks/mariadb/attributes/default.rb +199 -0
- data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
- data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
- data/cookbooks/mariadb/libraries/matchers.rb +21 -0
- data/cookbooks/mariadb/metadata.json +1 -0
- data/cookbooks/mariadb/providers/configuration.rb +39 -0
- data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
- data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
- data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
- data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
- data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
- data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
- data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
- data/cookbooks/mariadb/recipes/client.rb +47 -0
- data/cookbooks/mariadb/recipes/config.rb +115 -0
- data/cookbooks/mariadb/recipes/default.rb +46 -0
- data/cookbooks/mariadb/recipes/devel.rb +41 -0
- data/cookbooks/mariadb/recipes/galera.rb +324 -0
- data/cookbooks/mariadb/recipes/plugins.rb +3 -0
- data/cookbooks/mariadb/recipes/repository.rb +45 -0
- data/cookbooks/mariadb/recipes/server.rb +157 -0
- data/cookbooks/mariadb/resources/configuration.rb +13 -0
- data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
- data/cookbooks/mariadb/resources/replication.rb +192 -0
- data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
- data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
- data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
- data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
- data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
- data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
- data/cookbooks/mingw/.foodcritic +1 -0
- data/cookbooks/mingw/CHANGELOG.md +50 -0
- data/cookbooks/mingw/CONTRIBUTING.md +2 -0
- data/cookbooks/mingw/MAINTAINERS.md +14 -0
- data/cookbooks/mingw/README.md +133 -0
- data/cookbooks/mingw/files/default/bash.bat +17 -0
- data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
- data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
- data/cookbooks/mingw/files/default/pthread.h +719 -0
- data/cookbooks/mingw/files/default/time.h +297 -0
- data/cookbooks/mingw/libraries/_helper.rb +38 -0
- data/cookbooks/mingw/metadata.json +1 -0
- data/cookbooks/mingw/recipes/default.rb +19 -0
- data/cookbooks/mingw/resources/get.rb +56 -0
- data/cookbooks/mingw/resources/msys2_package.rb +139 -0
- data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
- data/cookbooks/ohai/.foodcritic +2 -0
- data/cookbooks/ohai/CHANGELOG.md +166 -0
- data/cookbooks/ohai/CONTRIBUTING.md +2 -0
- data/cookbooks/ohai/MAINTAINERS.md +15 -0
- data/cookbooks/ohai/README.md +134 -0
- data/cookbooks/ohai/libraries/matchers.rb +41 -0
- data/cookbooks/ohai/metadata.json +1 -0
- data/cookbooks/ohai/recipes/default.rb +20 -0
- data/cookbooks/ohai/resources/hint.rb +55 -0
- data/cookbooks/ohai/resources/plugin.rb +117 -0
- data/cookbooks/selinux_policy/.gitignore +51 -0
- data/cookbooks/selinux_policy/.kitchen.yml +25 -0
- data/cookbooks/selinux_policy/.rubocop.yml +2 -0
- data/cookbooks/selinux_policy/.travis.yml +26 -0
- data/cookbooks/selinux_policy/Berksfile +8 -0
- data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
- data/cookbooks/selinux_policy/LICENSE +13 -0
- data/cookbooks/selinux_policy/README.md +217 -0
- data/cookbooks/selinux_policy/Rakefile +68 -0
- data/cookbooks/selinux_policy/TESTING.md +2 -0
- data/cookbooks/selinux_policy/Thorfile +12 -0
- data/cookbooks/selinux_policy/attributes/default.rb +5 -0
- data/cookbooks/selinux_policy/chefignore +102 -0
- data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
- data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
- data/cookbooks/selinux_policy/metadata.json +58 -0
- data/cookbooks/selinux_policy/metadata.rb +20 -0
- data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
- data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
- data/cookbooks/selinux_policy/providers/module.rb +81 -0
- data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
- data/cookbooks/selinux_policy/providers/port.rb +58 -0
- data/cookbooks/selinux_policy/recipes/default.rb +9 -0
- data/cookbooks/selinux_policy/recipes/install.rb +32 -0
- data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
- data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
- data/cookbooks/selinux_policy/resources/module.rb +21 -0
- data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
- data/cookbooks/selinux_policy/resources/port.rb +9 -0
- data/cookbooks/seven_zip/CHANGELOG.md +30 -0
- data/cookbooks/seven_zip/README.md +108 -0
- data/cookbooks/seven_zip/attributes/default.rb +31 -0
- data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
- data/cookbooks/seven_zip/metadata.json +1 -0
- data/cookbooks/seven_zip/providers/archive.rb +68 -0
- data/cookbooks/seven_zip/recipes/default.rb +41 -0
- data/cookbooks/seven_zip/resources/archive.rb +29 -0
- data/cookbooks/windows/.foodcritic +2 -0
- data/cookbooks/windows/CHANGELOG.md +528 -0
- data/cookbooks/windows/CONTRIBUTING.md +2 -0
- data/cookbooks/windows/MAINTAINERS.md +21 -0
- data/cookbooks/windows/README.md +803 -0
- data/cookbooks/windows/attributes/default.rb +21 -0
- data/cookbooks/windows/files/dism_features.rb +45 -0
- data/cookbooks/windows/libraries/matchers.rb +586 -0
- data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
- data/cookbooks/windows/libraries/registry_helper.rb +356 -0
- data/cookbooks/windows/libraries/version.rb +207 -0
- data/cookbooks/windows/libraries/version_helper.rb +79 -0
- data/cookbooks/windows/libraries/windows_helper.rb +174 -0
- data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
- data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
- data/cookbooks/windows/metadata.json +1 -0
- data/cookbooks/windows/recipes/default.rb +21 -0
- data/cookbooks/windows/resources/auto_run.rb +46 -0
- data/cookbooks/windows/resources/certificate.rb +166 -0
- data/cookbooks/windows/resources/certificate_binding.rb +128 -0
- data/cookbooks/windows/resources/feature.rb +82 -0
- data/cookbooks/windows/resources/feature_dism.rb +108 -0
- data/cookbooks/windows/resources/feature_powershell.rb +70 -0
- data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
- data/cookbooks/windows/resources/font.rb +80 -0
- data/cookbooks/windows/resources/http_acl.rb +110 -0
- data/cookbooks/windows/resources/pagefile.rb +152 -0
- data/cookbooks/windows/resources/path.rb +54 -0
- data/cookbooks/windows/resources/printer.rb +103 -0
- data/cookbooks/windows/resources/printer_port.rb +101 -0
- data/cookbooks/windows/resources/share.rb +291 -0
- data/cookbooks/windows/resources/shortcut.rb +53 -0
- data/cookbooks/windows/resources/task.rb +384 -0
- data/cookbooks/windows/resources/zipfile.rb +125 -0
- data/cookbooks/yum/.foodcritic +1 -0
- data/cookbooks/yum/CHANGELOG.md +351 -0
- data/cookbooks/yum/CONTRIBUTING.md +2 -0
- data/cookbooks/yum/MAINTAINERS.md +16 -0
- data/cookbooks/yum/README.md +125 -0
- data/cookbooks/yum/attributes/main.rb +103 -0
- data/cookbooks/yum/libraries/matchers.rb +9 -0
- data/cookbooks/yum/metadata.json +1 -0
- data/cookbooks/yum/recipes/default.rb +26 -0
- data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
- data/cookbooks/yum/resources/globalconfig.rb +119 -0
- data/cookbooks/yum/templates/.DS_Store +0 -0
- data/cookbooks/yum/templates/main.erb +276 -0
- data/cookbooks/yum-epel/CHANGELOG.md +138 -0
- data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
- data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
- data/cookbooks/yum-epel/README.md +172 -0
- data/cookbooks/yum-epel/attributes/default.rb +8 -0
- data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel.rb +21 -0
- data/cookbooks/yum-epel/metadata.json +1 -0
- data/cookbooks/yum-epel/recipes/default.rb +27 -0
- data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
- data/cookbooks/yum-scl/.kitchen.yml +24 -0
- data/cookbooks/yum-scl/.rubocop.yml +6 -0
- data/cookbooks/yum-scl/.travis.yml +28 -0
- data/cookbooks/yum-scl/Berksfile +3 -0
- data/cookbooks/yum-scl/Berksfile.lock +25 -0
- data/cookbooks/yum-scl/CHANGELOG.md +11 -0
- data/cookbooks/yum-scl/Gemfile +46 -0
- data/cookbooks/yum-scl/README.md +76 -0
- data/cookbooks/yum-scl/attributes/centos.rb +83 -0
- data/cookbooks/yum-scl/attributes/default.rb +15 -0
- data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
- data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
- data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
- data/cookbooks/yum-scl/metadata.json +42 -0
- data/cookbooks/yum-scl/metadata.rb +12 -0
- data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
- data/cookbooks/yum-scl/recipes/default.rb +17 -0
- data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
- data/lib/vagrant-clone/command/clone.rb +66 -61
- data/lib/vagrant-clone/errors.rb +61 -0
- data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
- data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
- data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
- data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
- data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
- data/lib/vagrant-clone/version.rb +2 -2
- data/lib/vagrant-clone.rb +6 -6
- data/libvirt.txt +7 -0
- data/performance_testing.rb +165 -0
- data/results.txt +45 -0
- data/scripts/create_box.sh +134 -0
- data/test.rb +92 -0
- data/tools/create_box.sh +130 -0
- data/vagrant-clone.gemspec +7 -7
- metadata +296 -5
- data/lib/vagrant-clone/command/errors.rb +0 -16
- data/lib/vagrant-clone/command/provider/docker.rb +0 -13
- data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,153 @@
|
|
1
|
+
#
|
2
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
3
|
+
#
|
4
|
+
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
|
5
|
+
#
|
6
|
+
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
7
|
+
#
|
8
|
+
|
9
|
+
if Gem::Requirement.new('< 12.16.42').satisfied_by?(Gem::Version.new(Chef::VERSION))
|
10
|
+
#--
|
11
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
12
|
+
# Author:: Christopher Walters (<cw@chef.io>)
|
13
|
+
# Author:: Tim Hinderliter (<tim@chef.io>)
|
14
|
+
# Copyright:: Copyright 2008-2016, Chef Software Inc.
|
15
|
+
# License:: Apache License, Version 2.0
|
16
|
+
#
|
17
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
18
|
+
# you may not use this file except in compliance with the License.
|
19
|
+
# You may obtain a copy of the License at
|
20
|
+
#
|
21
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
22
|
+
#
|
23
|
+
# Unless required by applicable law or agreed to in writing, software
|
24
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
25
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
26
|
+
# See the License for the specific language governing permissions and
|
27
|
+
# limitations under the License.
|
28
|
+
#
|
29
|
+
|
30
|
+
require "chef/exceptions"
|
31
|
+
require "chef/mixin/params_validate"
|
32
|
+
require "chef/node"
|
33
|
+
require "chef/resource_collection"
|
34
|
+
|
35
|
+
class Chef
|
36
|
+
# == Chef::Runner
|
37
|
+
# This class is responsible for executing the steps in a Chef run.
|
38
|
+
class Runner
|
39
|
+
|
40
|
+
attr_reader :run_context
|
41
|
+
|
42
|
+
include Chef::Mixin::ParamsValidate
|
43
|
+
|
44
|
+
def initialize(run_context)
|
45
|
+
@run_context = run_context
|
46
|
+
end
|
47
|
+
|
48
|
+
def delayed_actions
|
49
|
+
@run_context.delayed_actions
|
50
|
+
end
|
51
|
+
|
52
|
+
def events
|
53
|
+
@run_context.events
|
54
|
+
end
|
55
|
+
|
56
|
+
# Determine the appropriate provider for the given resource, then
|
57
|
+
# execute it.
|
58
|
+
def run_action(resource, action, notification_type = nil, notifying_resource = nil)
|
59
|
+
# If there are any before notifications, why-run the resource
|
60
|
+
# and notify anyone who needs notifying
|
61
|
+
before_notifications = run_context.before_notifications(resource) || []
|
62
|
+
unless before_notifications.empty?
|
63
|
+
forced_why_run do
|
64
|
+
Chef::Log.info("#{resource} running why-run #{action} action to support before action")
|
65
|
+
resource.run_action(action, notification_type, notifying_resource)
|
66
|
+
end
|
67
|
+
|
68
|
+
if resource.updated_by_last_action?
|
69
|
+
before_notifications.each do |notification|
|
70
|
+
Chef::Log.info("#{resource} sending #{notification.action} action to #{notification.resource} (before)")
|
71
|
+
run_action(notification.resource, notification.action, :before, resource)
|
72
|
+
end
|
73
|
+
resource.updated_by_last_action(false)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Actually run the action for realsies
|
78
|
+
resource.run_action(action, notification_type, notifying_resource)
|
79
|
+
|
80
|
+
# Execute any immediate and queue up any delayed notifications
|
81
|
+
# associated with the resource, but only if it was updated *this time*
|
82
|
+
# we ran an action on it.
|
83
|
+
if resource.updated_by_last_action?
|
84
|
+
run_context.immediate_notifications(resource).each do |notification|
|
85
|
+
Chef::Log.info("#{resource} sending #{notification.action} action to #{notification.resource} (immediate)")
|
86
|
+
run_action(notification.resource, notification.action, :immediate, resource)
|
87
|
+
end
|
88
|
+
|
89
|
+
run_context.delayed_notifications(resource).each do |notification|
|
90
|
+
# send the notification to the run_context of the receiving resource
|
91
|
+
notification.resource.run_context.add_delayed_action(notification)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Iterates over the +resource_collection+ in the +run_context+ calling
|
97
|
+
# +run_action+ for each resource in turn.
|
98
|
+
def converge
|
99
|
+
# Resolve all lazy/forward references in notifications
|
100
|
+
run_context.resource_collection.each do |resource|
|
101
|
+
resource.resolve_notification_references
|
102
|
+
end
|
103
|
+
|
104
|
+
# Execute each resource.
|
105
|
+
run_context.resource_collection.execute_each_resource do |resource|
|
106
|
+
Array(resource.action).each { |action| run_action(resource, action) }
|
107
|
+
end
|
108
|
+
|
109
|
+
rescue Exception => e
|
110
|
+
Chef::Log.info "Running queued delayed notifications before re-raising exception"
|
111
|
+
run_delayed_notifications(e)
|
112
|
+
else
|
113
|
+
run_delayed_notifications(nil)
|
114
|
+
true
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
# Run all our :delayed actions
|
120
|
+
def run_delayed_notifications(error = nil)
|
121
|
+
collected_failures = Exceptions::MultipleFailures.new
|
122
|
+
collected_failures.client_run_failure(error) unless error.nil?
|
123
|
+
delayed_actions.each do |notification|
|
124
|
+
result = run_delayed_notification(notification)
|
125
|
+
if result.kind_of?(Exception)
|
126
|
+
collected_failures.notification_failure(result)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
collected_failures.raise!
|
130
|
+
end
|
131
|
+
|
132
|
+
def run_delayed_notification(notification)
|
133
|
+
Chef::Log.info( "#{notification.notifying_resource} sending #{notification.action}"\
|
134
|
+
" action to #{notification.resource} (delayed)")
|
135
|
+
# Struct of resource/action to call
|
136
|
+
run_action(notification.resource, notification.action, :delayed)
|
137
|
+
true
|
138
|
+
rescue Exception => e
|
139
|
+
e
|
140
|
+
end
|
141
|
+
|
142
|
+
# helper to run a block of code with why_run forced to true and then restore it correctly
|
143
|
+
def forced_why_run
|
144
|
+
saved = Chef::Config[:why_run]
|
145
|
+
Chef::Config[:why_run] = true
|
146
|
+
yield
|
147
|
+
ensure
|
148
|
+
Chef::Config[:why_run] = saved
|
149
|
+
end
|
150
|
+
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Chef
|
2
|
+
NOT_PASSED = Object.new if !defined?(NOT_PASSED)
|
3
|
+
# Earlier versions of Chef didn't have this message
|
4
|
+
module ChefCompatDeprecation
|
5
|
+
def log_deprecation(message, location=nil)
|
6
|
+
if !location
|
7
|
+
# Pick the first caller that is *not* part of the Chef or ChefCompat gem,
|
8
|
+
# that's the thing the user wrote.
|
9
|
+
chef_compat_gem_path = File.expand_path("../../..", __FILE__)
|
10
|
+
chef_gem_path = File.expand_path("../..",::Chef::Resource.instance_method(:initialize).source_location[0])
|
11
|
+
caller(0..10).each do |c|
|
12
|
+
if !c.start_with?(chef_gem_path) && !c.start_with?(chef_compat_gem_path)
|
13
|
+
location = c
|
14
|
+
break
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
begin
|
20
|
+
super
|
21
|
+
# Bleagh. `super_method` doesn't exist on older rubies and I haven't
|
22
|
+
# figured out a way to check for its existence otherwise.
|
23
|
+
rescue NoMethodError
|
24
|
+
Chef::Log.warn(message)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class<<self
|
30
|
+
prepend ChefCompatDeprecation
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
class Chef
|
2
|
+
class RunContext
|
3
|
+
class ChildRunContext < RunContext
|
4
|
+
# magic that lets us re-parse the ChildRunContext without erroring due to
|
5
|
+
# cheffish and chef-provisioning hooks having been loaded (on old versions of
|
6
|
+
# chef-client without the lazy hooks for those gems)
|
7
|
+
@__skip_method_checking = true
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# fix to quiet constant redefined warnings
|
13
|
+
if defined?(Chef::RunContext::ChildRunContext::CHILD_STATE)
|
14
|
+
Chef::RunContext::ChildRunContext.send(:remove_const, :CHILD_STATE)
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'chef_compat/monkeypatches/chef'
|
18
|
+
require 'chef_compat/monkeypatches/chef/exceptions'
|
19
|
+
require 'chef_compat/monkeypatches/chef/log'
|
20
|
+
require 'chef_compat/monkeypatches/chef/node'
|
21
|
+
require 'chef_compat/monkeypatches/chef/mixin/params_validate'
|
22
|
+
require 'chef_compat/monkeypatches/chef/property'
|
23
|
+
require 'chef_compat/monkeypatches/chef/provider'
|
24
|
+
require 'chef_compat/monkeypatches/chef/recipe' # copied from chef
|
25
|
+
require 'chef_compat/monkeypatches/chef/recipe_hook'
|
26
|
+
require 'chef_compat/monkeypatches/chef/resource'
|
27
|
+
require 'chef_compat/monkeypatches/chef/resource_builder'
|
28
|
+
require 'chef_compat/monkeypatches/chef/resource/lwrp_base'
|
29
|
+
require 'chef_compat/monkeypatches/chef/resource_collection'
|
30
|
+
require 'chef_compat/monkeypatches/chef/resource_collection/resource_list'
|
31
|
+
require 'chef_compat/monkeypatches/chef/resource_collection/resource_set'
|
32
|
+
require 'chef_compat/monkeypatches/chef/run_context' # copied from chef
|
33
|
+
require 'chef_compat/monkeypatches/chef/runner' # copied from chef
|
34
|
+
|
35
|
+
# fix for Chef::RunContext instance that has already been created
|
36
|
+
ObjectSpace.each_object(Chef::RunContext) do |run_context|
|
37
|
+
run_context.node.run_context = run_context
|
38
|
+
run_context.instance_variable_set(:@loaded_recipes_hash, {})
|
39
|
+
run_context.instance_variable_set(:@loaded_attributes_hash, {})
|
40
|
+
run_context.initialize_child_state
|
41
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'chef_compat/resource'
|
2
|
+
require 'chef_compat/copied_from_chef/chef/resource'
|
3
|
+
require 'chef/mixin/convert_to_class_name'
|
4
|
+
require 'chef/mixin/from_file'
|
5
|
+
|
6
|
+
module ChefCompat
|
7
|
+
class Resource < ChefCompat::CopiedFromChef::Chef::Resource
|
8
|
+
class LWRPBase < ChefCompat::Resource
|
9
|
+
class<<self
|
10
|
+
|
11
|
+
include Chef::Mixin::ConvertToClassName
|
12
|
+
include Chef::Mixin::FromFile
|
13
|
+
|
14
|
+
alias :attribute :property
|
15
|
+
|
16
|
+
# Adds +action_names+ to the list of valid actions for this resource.
|
17
|
+
# Does not include superclass's action list when appending.
|
18
|
+
def actions(*action_names)
|
19
|
+
action_names = action_names.flatten
|
20
|
+
if !action_names.empty? && !@allowed_actions
|
21
|
+
self.allowed_actions = ([ :nothing ] + action_names).uniq
|
22
|
+
else
|
23
|
+
allowed_actions(*action_names)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
alias :actions= :allowed_actions=
|
27
|
+
|
28
|
+
# @deprecated
|
29
|
+
def valid_actions(*args)
|
30
|
+
Chef::Log.warn("`valid_actions' is deprecated, please use allowed_actions `instead'!")
|
31
|
+
allowed_actions(*args)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Set the run context on the class. Used to provide access to the node
|
35
|
+
# during class definition.
|
36
|
+
attr_accessor :run_context
|
37
|
+
|
38
|
+
def node
|
39
|
+
run_context ? run_context.node : nil
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'chef_compat/monkeypatches'
|
2
|
+
require 'chef_compat/copied_from_chef/chef/resource'
|
3
|
+
|
4
|
+
# We do NOT want action defined if chefspec is engaged
|
5
|
+
if Chef::Provider::InlineResources::ClassMethods.instance_method(:action).source_location[0] =~ /chefspec/
|
6
|
+
ChefCompat::CopiedFromChef::Chef::Provider::InlineResources::ClassMethods.instance_eval do
|
7
|
+
remove_method(:action)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
module ChefCompat
|
12
|
+
class Resource < ChefCompat::CopiedFromChef::Chef::Resource
|
13
|
+
def initialize(*args, &block)
|
14
|
+
super
|
15
|
+
# @resource_name is used in earlier Chef versions
|
16
|
+
@resource_name = self.class.resource_name
|
17
|
+
end
|
18
|
+
# Things we'll need to define ourselves:
|
19
|
+
# 1. provider
|
20
|
+
# 2. resource_name
|
21
|
+
|
22
|
+
def provider(*args, &block)
|
23
|
+
super || self.class.action_class
|
24
|
+
end
|
25
|
+
def provider=(arg)
|
26
|
+
provider(arg)
|
27
|
+
end
|
28
|
+
|
29
|
+
if !respond_to?(:resource_name)
|
30
|
+
def self.resource_name(name=Chef::NOT_PASSED)
|
31
|
+
# Setter
|
32
|
+
if name != Chef::NOT_PASSED
|
33
|
+
# remove_canonical_dsl
|
34
|
+
|
35
|
+
# Set the resource_name and call provides
|
36
|
+
if name
|
37
|
+
name = name.to_sym
|
38
|
+
# If our class is not already providing this name, provide it.
|
39
|
+
# Commented out: use of resource_name and provides will need to be
|
40
|
+
# mutually exclusive in this world, generally.
|
41
|
+
# if !Chef::ResourceResolver.includes_handler?(name, self)
|
42
|
+
provides name#, canonical: true
|
43
|
+
# end
|
44
|
+
@resource_name = name
|
45
|
+
else
|
46
|
+
@resource_name = nil
|
47
|
+
end
|
48
|
+
end
|
49
|
+
@resource_name
|
50
|
+
end
|
51
|
+
def self.resource_name=(name)
|
52
|
+
resource_name(name)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "chef/version"
|
2
|
+
|
3
|
+
if Gem::Requirement.new(">= 12.0").satisfied_by?(Gem::Version.new(Chef::VERSION))
|
4
|
+
|
5
|
+
require 'chef_compat/resource'
|
6
|
+
require 'chef_compat/property'
|
7
|
+
require 'chef_compat/mixin/properties'
|
8
|
+
|
9
|
+
resources_dir = File.expand_path("chef_compat/copied_from_chef/chef/resource", File.dirname(__FILE__))
|
10
|
+
providers_dir = File.expand_path("chef_compat/copied_from_chef/chef/provider", File.dirname(__FILE__))
|
11
|
+
Dir["#{resources_dir}/*.rb"].each {|file| require file }
|
12
|
+
Dir["#{providers_dir}/*.rb"].each {|file| require file }
|
13
|
+
else
|
14
|
+
|
15
|
+
class Chef
|
16
|
+
class Resource
|
17
|
+
def self.property(args, &block)
|
18
|
+
raise_chef_11_error
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.resource_name(args, &block)
|
22
|
+
raise_chef_11_error
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.action(args, &block)
|
26
|
+
raise_chef_11_error
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.raise_chef_11_error
|
30
|
+
raise "This resource is written with Chef 12.5 custom resources, and requires at least Chef 12.0 used with the compat_resource cookbook, it will not work with Chef 11.x clients, and those users must pin their cookbooks to older versions or upgrade."
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
unless Gem::Requirement.new(">= 12.0").satisfied_by?(Gem::Version.new(Chef::VERSION))
|
2
|
+
raise "This resource is written with Chef 12.5 custom resources, and requires at least Chef 12.0 used with the compat_resource cookbook, it will not work with Chef 11.x clients, and those users must pin their cookbooks to older versions or upgrade."
|
3
|
+
end
|
4
|
+
|
5
|
+
# If users are on old verisons of ChefDK which activates an (old) gem via cheffish before this cookbook loads, then
|
6
|
+
# we just try to monkeypatch over the top of a monkeypatch. Its possible that we have checks in this cookbook which
|
7
|
+
# will defeat that purpose and fail to monkeypatch on top of monkeypatches -- in which case those checks should be
|
8
|
+
# removed -- this cookbook needs to win when it gets into a fight with the old gem versions.
|
9
|
+
if Gem.loaded_specs["compat_resource"]
|
10
|
+
Chef.log_deprecation "using compat_resource as a gem is deprecated; please update cheffish and chef-provisioning gems (or use the latest Chef/ChefDK packages) or else manually pin your compat_resource cookbook version to the same version as the gem you are using to remove this warning"
|
11
|
+
end
|
12
|
+
|
13
|
+
# we want to not pollute the libpath with our files until after we've done the version check
|
14
|
+
require_relative '../files/lib/chef_upstream_version'
|
15
|
+
|
16
|
+
# on any chef client later than the one we were based off of we just turn into a no-op
|
17
|
+
if Gem::Requirement.new("< #{ChefCompat::CHEF_UPSTREAM_VERSION}").satisfied_by?(Gem::Version.new(Chef::VERSION))
|
18
|
+
Chef::Log.debug "loading compat_resource based on chef-version #{ChefCompat::CHEF_UPSTREAM_VERSION} over chef version #{Gem::Version.new(Chef::VERSION)}"
|
19
|
+
$LOAD_PATH.unshift(File.expand_path("../files/lib", File.dirname(__FILE__)))
|
20
|
+
require 'compat_resource'
|
21
|
+
else
|
22
|
+
Chef::Log.debug "NOT LOADING compat_resource based on chef-version #{ChefCompat::CHEF_UPSTREAM_VERSION} over chef version #{Gem::Version.new(Chef::VERSION)}"
|
23
|
+
unless defined?(ChefCompat::Resource) && defined?(ChefCompat::Mixin::Properties)
|
24
|
+
module ChefCompat
|
25
|
+
Resource = Chef::Resource
|
26
|
+
module Mixin
|
27
|
+
Properties = Chef::Mixin::Properties
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"compat_resource","version":"12.19.0","description":"Backports functionality introduced in the latest chef-client releases to any chef-client from 12.1 onwards","long_description":"# compat_resource cookbook\n\n[](https://travis-ci.org/chef-cookbooks/compat_resource) [](https://supermarket.chef.io/cookbooks/compat_resource)\n\nThis cookbook backports functionality introduced in the latest chef-client releases to any chef-client from 12.1 onwards. This includes [Custom Resource](https://docs.chef.io/custom_resources.html) functionality, notification improvements, as well as new resources added to core chef. It allows for the usage of these new resources in cookbooks without requiring the very latest Chef client release.\n\n## Backported functionality\n\n- [Custom Resources](https://docs.chef.io/custom_resources.html)\n- [apt_repository](https://docs.chef.io/resource_apt_repository.html)\n- [apt_update](https://docs.chef.io/resource_apt_update.html)\n- [systemd_unit](https://docs.chef.io/resource_systemd_unit.html)\n- [yum_repository](https://docs.chef.io/resource_yum_repository.html)\n- [:before notifications](https://docs.chef.io/resources.html#timers)\n\n## Requirements\n\n### Platforms\n\n- All platforms supported by Chef\n\n### Chef\n\n- Chef 12.1+\n\n### Cookbooks\n\n- none\n\n## Usage\n\nTo use this cookbook, put `depends 'compat_resource'` in the metadata.rb of your cookbook. Once this is done, you can use all the new custom resource features to define resources. It Just Works.\n\n## Custom Resources?\n\nCurious about how to use custom resources?\n\n- Docs: <https://docs.chef.io/custom_resources.html>\n- Slides: <https://docs.chef.io/decks/custom_resources.html>\n\n## License & Authors\n\n- Author:: Lamont Granquist ([lamont@chef.io](mailto:lamont@chef.io))\n- Author:: John Keiser ([jkeiser@chef.io](mailto:jkeiser@chef.io))\n\n```text\nCopyright:: 2015-2016 Chef Software, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","maintainer":"Lamont Granquist","maintainer_email":"lamont@chef.io","license":"Apache 2.0","platforms":{},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/compat_resource","issues_url":"https://github.com/chef-cookbooks/compat_resource/issues","chef_version":[[">= 12.1"]],"ohai_version":[]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# inifile_chef_gem CHANGELOG
|
2
|
+
|
3
|
+
This file is used to list changes made in each version of the inifile_chef_gem cookbook.
|
4
|
+
|
5
|
+
## 0.1.0
|
6
|
+
- [your_name] - Initial release of inifile_chef_gem
|
7
|
+
|
8
|
+
- - -
|
9
|
+
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
|
10
|
+
|
11
|
+
The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# inifile_chef_gem Cookbook
|
2
|
+
|
3
|
+
inifile_chef_gem is a library cookbook. It provides custom resource, that can be used in recipes
|
4
|
+
## Requirements
|
5
|
+
|
6
|
+
### Chef
|
7
|
+
|
8
|
+
- Chef 12.0 or later
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
Place a dependency in your cookbook's metadata.rb
|
13
|
+
```ruby
|
14
|
+
depends 'inifile_chef_gem'
|
15
|
+
```
|
16
|
+
Install gem using custom resource
|
17
|
+
```ruby
|
18
|
+
inifile_chef_gem 'default' do
|
19
|
+
action :install
|
20
|
+
end
|
21
|
+
```
|
22
|
+
## Resource overview
|
23
|
+
|
24
|
+
### inifile_chef_gem
|
25
|
+
|
26
|
+
The resource installs inifile gem into Chef's Ruby enviroment
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
inifile_chef_gem 'default' do
|
30
|
+
gem_version '3.0.0'
|
31
|
+
action :install
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
#### Parameters
|
36
|
+
- gem_version - The version of rubygem to be installed. Defaults to 3.0.0
|
37
|
+
|
38
|
+
#### Actions
|
39
|
+
- :install - build and install gem into Chef's Ruby enviroment
|
40
|
+
- :remove - Delete the gem from Chef's Ruby environment
|
41
|
+
|
42
|
+
|
43
|
+
## License and Authors
|
44
|
+
|
45
|
+
Authors: Dmitry Shestoperov
|
46
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
{
|
2
|
+
"name": "inifile_chef_gem",
|
3
|
+
"description": "Installs/Configures inifile gem for chef",
|
4
|
+
"long_description": "# inifile_chef_gem Cookbook\n\ninifile_chef_gem is a library cookbook. It provides custom resource, that can be used in recipes\n## Requirements\n\n### Chef\n\n- Chef 12.0 or later\n\n## Usage\n\nPlace a dependency in your cookbook's metadata.rb\n```ruby\ndepends 'inifile_chef_gem'\n```\nInstall gem using custom resource\n```ruby\ninifile_chef_gem 'default' do\n action :install\nend\n```\n## Resource overview\n\n### inifile_chef_gem\n\nThe resource installs inifile gem into Chef's Ruby enviroment\n\n```ruby\ninifile_chef_gem 'default' do\n gem_version '3.0.0'\n action :install\nend\n```\n\n#### Parameters\n- gem_version - The version of rubygem to be installed. Defaults to 3.0.0\n\n#### Actions\n- :install - build and install gem into Chef's Ruby enviroment\n- :remove - Delete the gem from Chef's Ruby environment\n\n\n## License and Authors\n\nAuthors: Dmitry Shestoperov\n\n",
|
5
|
+
"maintainer": "Dmitry Shestoperov",
|
6
|
+
"maintainer_email": "dmitry@shestoperov.info",
|
7
|
+
"license": "All rights reserved",
|
8
|
+
"platforms": {
|
9
|
+
|
10
|
+
},
|
11
|
+
"dependencies": {
|
12
|
+
"build-essential": ">= 0.0.0"
|
13
|
+
},
|
14
|
+
"recommendations": {
|
15
|
+
|
16
|
+
},
|
17
|
+
"suggestions": {
|
18
|
+
|
19
|
+
},
|
20
|
+
"conflicting": {
|
21
|
+
|
22
|
+
},
|
23
|
+
"providing": {
|
24
|
+
|
25
|
+
},
|
26
|
+
"replacing": {
|
27
|
+
|
28
|
+
},
|
29
|
+
"attributes": {
|
30
|
+
|
31
|
+
},
|
32
|
+
"groupings": {
|
33
|
+
|
34
|
+
},
|
35
|
+
"recipes": {
|
36
|
+
|
37
|
+
},
|
38
|
+
"version": "0.1.0",
|
39
|
+
"source_url": "https://github.com/dimsh99/inifile_chef_gem",
|
40
|
+
"issues_url": "https://github.com/dimsh99/inifile_chef_gem/issues",
|
41
|
+
"privacy": false,
|
42
|
+
"chef_versions": [
|
43
|
+
|
44
|
+
],
|
45
|
+
"ohai_versions": [
|
46
|
+
|
47
|
+
],
|
48
|
+
"gems": [
|
49
|
+
|
50
|
+
]
|
51
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
name 'inifile_chef_gem'
|
2
|
+
maintainer 'Dmitry Shestoperov'
|
3
|
+
maintainer_email 'dmitry@shestoperov.info'
|
4
|
+
license 'All rights reserved'
|
5
|
+
description 'Installs/Configures inifile gem for chef'
|
6
|
+
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
7
|
+
issues_url 'https://github.com/dimsh99/inifile_chef_gem/issues'
|
8
|
+
source_url 'https://github.com/dimsh99/inifile_chef_gem'
|
9
|
+
version '0.1.0'
|
10
|
+
|
11
|
+
depends 'build-essential'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
property :inifile_chef_gem_name, kind_of: String,
|
2
|
+
name_attribute: true,
|
3
|
+
required: true
|
4
|
+
property :gem_version, kind_of: String, default: '3.0.0'
|
5
|
+
property :client_version, kind_of: String, default: nil
|
6
|
+
|
7
|
+
actions :install, :remove
|
8
|
+
|
9
|
+
default_action :install
|
10
|
+
|
11
|
+
use_inline_resources if defined?(use_inline_resources)
|
12
|
+
|
13
|
+
action :install do
|
14
|
+
include_recipe 'build-essential::default'
|
15
|
+
|
16
|
+
gem_package 'inifile' do
|
17
|
+
gem_binary RbConfig::CONFIG['bindir'] + '/gem'
|
18
|
+
version new_resource.gem_version
|
19
|
+
action :install
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
action :remove do
|
24
|
+
gem_package 'inifile' do
|
25
|
+
gem_binary RbConfig::CONFIG['bindir'] + '/gem'
|
26
|
+
action :remove
|
27
|
+
end
|
28
|
+
end
|