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,166 @@
|
|
1
|
+
# ohai Cookbook CHANGELOG
|
2
|
+
|
3
|
+
This file is used to list changes made in each version of the ohai cookbook.
|
4
|
+
|
5
|
+
## 5.1.0 (2017-05-06)
|
6
|
+
|
7
|
+
- Workaround action_class bug by requiring Chef 12.7+
|
8
|
+
|
9
|
+
## 5.0.4 (2017-04-25)
|
10
|
+
|
11
|
+
- Fix lack of .rb extension when deleting plugins.
|
12
|
+
|
13
|
+
## 5.0.3 (2017-04-06)
|
14
|
+
|
15
|
+
- Use class_eval again in the custom resource to provide Chef 12.5/12.6 compatibility
|
16
|
+
- Remove kind_of and use name_property not name_attribute
|
17
|
+
- Fix failures on Chef 13
|
18
|
+
|
19
|
+
## 5.0.2 (2017-03-24)
|
20
|
+
|
21
|
+
- Remove class_eval
|
22
|
+
|
23
|
+
## 5.0.1 (2017-03-14)
|
24
|
+
|
25
|
+
- Test with Delivery Local Mode
|
26
|
+
- Bump the dependency to 12.7+ due to failures on 12.5-12.6
|
27
|
+
|
28
|
+
## 5.0.0 (2017-02-23)
|
29
|
+
|
30
|
+
- Require Chef 12.5+ and remove compat_resource dependency
|
31
|
+
|
32
|
+
## 4.2.3 (2016-12-02)
|
33
|
+
- Prevent chef_version metadata from failing runs in Opsworks
|
34
|
+
- Better explain how to resolve the plugin_path issue
|
35
|
+
- Add suse as a supported platform
|
36
|
+
- Require at least compat_resource 12.14.7
|
37
|
+
|
38
|
+
## 4.2.2 (2016-09-19)
|
39
|
+
- Ignore case in plugin path check on Windows
|
40
|
+
|
41
|
+
## 4.2.1 (2016-09-08)
|
42
|
+
- Fix typo in compile warning text
|
43
|
+
- Depend on the latest compat_resource (12.14)
|
44
|
+
- Remove Chef 11 compat in the metadata
|
45
|
+
- Require Chef 12.1 not 12.0
|
46
|
+
- Define ohai_plugin matcher for Chefspec
|
47
|
+
|
48
|
+
## v4.2.0 (2016-07-19)
|
49
|
+
|
50
|
+
- Added the ability to specify the source cookbook for the cookbook_file or template used in the ohai_plugin resource.
|
51
|
+
- Added chef_version to the metadata
|
52
|
+
- Added testing on openSUSE and switched from Rubocop to Cookstyle
|
53
|
+
|
54
|
+
## v4.1.1 (2016-06-16)
|
55
|
+
|
56
|
+
- Fixed error in notifies reload for the delete action
|
57
|
+
- Bump the compat_resource requirement from 12.9+ to 12.10+ to prevent random failures
|
58
|
+
|
59
|
+
## v4.1.0 (2016-05-26)
|
60
|
+
|
61
|
+
- Added the ability to use templates and pass in variables with the plugin custom resource
|
62
|
+
|
63
|
+
## v4.0.2 (2016-05-23)
|
64
|
+
|
65
|
+
- Resolve failures on Windows nodes
|
66
|
+
|
67
|
+
## v4.0.1 (2016-05-19)
|
68
|
+
|
69
|
+
- Added .rb to the name of the plugins so they actually load
|
70
|
+
- Added testing to ensure the plugins are being loaded in the chef run
|
71
|
+
|
72
|
+
## v4.0.0 (2016-05-18)
|
73
|
+
|
74
|
+
### BREAKING CHANGE:
|
75
|
+
|
76
|
+
The 4.0 release of the Ohai cookbook removes the previous cookbook_file behavior that required forking the cookbook and adding your own plugins. Instead the cookbook ships with a new ohai_plugin custom resource for installing plugins. In addition to this new custom resource the cookbook now requires Chef 12+. See the readme and test recipe for examples. If you require Chef 11 support you'll need to pin to version 3.0 in your environment.
|
77
|
+
|
78
|
+
## v3.0.1 (2016-03-14)
|
79
|
+
|
80
|
+
- Fixed the Chefspec matchers
|
81
|
+
|
82
|
+
## v3.0.0 (2016-03-14)
|
83
|
+
|
84
|
+
- Change the default value for `node['ohai']['hints_path']` to use the Ohai config value. This should be the same value in most use cases, but if a custom path is specified in the chef client config this value will get used automatically by the cookbook.
|
85
|
+
- Removed backwards compatibility with Chefspec < 4.1 in the matchers library
|
86
|
+
- Fix bad link to the custom Ohai plugin documentation in the readme
|
87
|
+
- Improve documentation for `node['ohai']['plugin_path']`
|
88
|
+
|
89
|
+
## v2.1.0 (2016-01-26)
|
90
|
+
|
91
|
+
- Properly handle creating ohai hints without specifying the content. Previously if the content wasn't specified a deprecation notice would be thrown and the file would not be created
|
92
|
+
- Simplified the test suite and added inspec tests to ensure hints are created, especially if the content is not specified
|
93
|
+
- Added FreeBSD and Windows as supported platform in the metadata and add them to the Test Kitchen config
|
94
|
+
- Add Test Kitchen integration tests to Travis CI
|
95
|
+
- Updated testing Gems to the latest releases in the Gemfile
|
96
|
+
|
97
|
+
## v2.0.4 (2015-10-30)
|
98
|
+
|
99
|
+
- Resolved deprecation warnings with the Chefspec matchers
|
100
|
+
|
101
|
+
## v2.0.3 (2015-10-21)
|
102
|
+
|
103
|
+
- Validate the hints before loading them to avoid failures
|
104
|
+
- Added supported platforms to the metadata
|
105
|
+
- Updated .gitignore file
|
106
|
+
- Updated Test Kitchen config for the latest platforms
|
107
|
+
- Added Chef standard Rubocop config
|
108
|
+
- Added Travis CI testing
|
109
|
+
- Added Berksfile
|
110
|
+
- Updated contributing and testing docs
|
111
|
+
- Added maintainers.md and maintainers.toml files
|
112
|
+
- Added Travis and cookbook version badges to the readme
|
113
|
+
- Expanded the requirements section in the readme and clarify the minimum supported Chef release is 11
|
114
|
+
- Updated Opscode -> Chef Software
|
115
|
+
- Added a Rakefile for simplified testing
|
116
|
+
- Added a Chefignore file
|
117
|
+
- Resolved Rubocop warnings
|
118
|
+
- Added source_url and issues_url to the metadata
|
119
|
+
- Added Chefspec matchers
|
120
|
+
- Added basic convergence Chefspec test
|
121
|
+
|
122
|
+
## v2.0.1 (2014-06-07)
|
123
|
+
|
124
|
+
- [COOK-4683] Remove warnings about reopening resource
|
125
|
+
|
126
|
+
Please note, this changes the name of a remote_directory resource. It is not expected that anyone would be explicitly notifying this resource but, please review [PR #16](https://github.com/chef-cookbooks/ohai/pull/16/files) for more info.
|
127
|
+
|
128
|
+
## v2.0.0 (2014-02-25)
|
129
|
+
|
130
|
+
'[COOK-3865] - create lwrp ohai_hint'
|
131
|
+
|
132
|
+
## v1.1.12
|
133
|
+
|
134
|
+
- Dummy release due to a Community Site upload failure
|
135
|
+
|
136
|
+
## v1.1.10
|
137
|
+
|
138
|
+
### Bug
|
139
|
+
|
140
|
+
- **[COOK-3091](https://tickets.chef.io/browse/COOK-3091)** - Fix checking `Chef::Config[:config_file]`
|
141
|
+
|
142
|
+
## v1.1.8
|
143
|
+
|
144
|
+
- [COOK-1918] - Ohai cookbook to distribute plugins fails on windows
|
145
|
+
- [COOK-2096] - Ohai cookbook sets unix-only default path attribute
|
146
|
+
|
147
|
+
## v1.1.6
|
148
|
+
|
149
|
+
- [COOK-2057] - distribution from another cookbok fails if ohai attributes are loaded after the other cookbook
|
150
|
+
|
151
|
+
## v1.1.4
|
152
|
+
|
153
|
+
- [COOK-1128] - readme update, Replace reference to deprecated chef cookbook with one to chef-client
|
154
|
+
|
155
|
+
## v1.1.2
|
156
|
+
|
157
|
+
- [COOK-1424] - prevent plugin_path growth to infinity
|
158
|
+
|
159
|
+
## v1.1.0
|
160
|
+
|
161
|
+
- [COOK-1174] - custom_plugins is only conditionally available
|
162
|
+
- [COOK-1383] - allow plugins from other cookbooks
|
163
|
+
|
164
|
+
## v1.0.2
|
165
|
+
|
166
|
+
- [COOK-463] ohai cookbook default recipe should only reload plugins if there were updates
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!-- This is a generated file. Please do not edit directly -->
|
2
|
+
|
3
|
+
# Maintainers
|
4
|
+
|
5
|
+
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
|
6
|
+
|
7
|
+
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
|
8
|
+
|
9
|
+
# Project Maintainer
|
10
|
+
* [Tim Smith](https://github.com/tas50)
|
11
|
+
|
12
|
+
# Maintainers
|
13
|
+
* [Jennifer Davis](https://github.com/sigje)
|
14
|
+
* [Tim Smith](https://github.com/tas50)
|
15
|
+
* [Thom May](https://github.com/thommay)
|
@@ -0,0 +1,134 @@
|
|
1
|
+
# ohai Cookbook
|
2
|
+
|
3
|
+
[](https://travis-ci.org/chef-cookbooks/ohai) [](https://ci.appveyor.com/project/ChefWindowsCookbooks/ohai/branch/master) [](https://supermarket.chef.io/cookbooks/ohai)
|
4
|
+
|
5
|
+
Contains custom resources for adding Ohai hints and installing custom Ohai plugins. Handles path creation as well as the reloading of Ohai so that new data will be available during the same run.
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
### Platforms
|
10
|
+
|
11
|
+
- Debian/Ubuntu
|
12
|
+
- RHEL/CentOS/Scientific/Amazon/Oracle
|
13
|
+
- openSUSE / SUSE Enterprise Linux
|
14
|
+
- FreeBSD
|
15
|
+
- Windows
|
16
|
+
|
17
|
+
### Chef
|
18
|
+
|
19
|
+
- Chef 12.7+
|
20
|
+
|
21
|
+
### Cookbooks
|
22
|
+
|
23
|
+
- none
|
24
|
+
|
25
|
+
## Custom Resources
|
26
|
+
|
27
|
+
### `ohai_hint`
|
28
|
+
|
29
|
+
Creates Ohai hint files, which are consumed by Ohai plugins in order to determine if they should run or not.
|
30
|
+
|
31
|
+
#### Resource Attributes
|
32
|
+
|
33
|
+
- `hint_name` - The name of hints file and key. Should be string, default is name of resource.
|
34
|
+
- `content` - Values of hints. It will be used as automatic attributes. Should be Hash, default is empty Hash
|
35
|
+
- `compile_time` - Should the resource run at compile time. This defaults to true
|
36
|
+
|
37
|
+
#### Examples
|
38
|
+
|
39
|
+
Hint file installed to the default directory:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
ohai_hint 'ec2'
|
43
|
+
```
|
44
|
+
|
45
|
+
Hint file not installed at compile time:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
ohai_hint 'ec2' do
|
49
|
+
compile_time false
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
Hint file installed with content:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
ohai_hint 'raid_present' do
|
57
|
+
content Hash[:a, 'test_content']
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
#### ChefSpec Matchers
|
62
|
+
|
63
|
+
You can check for the creation or deletion of ohai hints with chefspec using these custom matches:
|
64
|
+
|
65
|
+
- create_ohai_hint
|
66
|
+
- delete_ohai_hint
|
67
|
+
|
68
|
+
### `ohai_plugin`
|
69
|
+
|
70
|
+
Installs custom Ohai plugins.
|
71
|
+
|
72
|
+
#### Resource Attributes
|
73
|
+
|
74
|
+
- `plugin_name` - The name to give the plugin on the filesystem. Should be string, default is name of resource.
|
75
|
+
- `path` - The path to your custom plugin directory. Defaults to a directory named 'plugins' under the directory 'ohai' in the Chef config dir.
|
76
|
+
- `source_file` - The source file for the plugin in your cookbook if not NAME.rb.
|
77
|
+
- `cookbook` - The cookbook where the source file exists if not the cookbook where the ohai_plugin resource is running from.
|
78
|
+
- `resource` - The resource type for the plugin file. Either `:cookbook_file` or `:template`. Defaults to `:cookbook_file`.
|
79
|
+
- `variables` - Usable only if `resource` is `:template`. Defines the template's variables.
|
80
|
+
- `compile_time` - Should the resource run at compile time. This defaults to `true`.
|
81
|
+
|
82
|
+
#### examples
|
83
|
+
|
84
|
+
Simple Ohai plugin installation:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
ohai_plugin 'my_custom_plugin'
|
88
|
+
```
|
89
|
+
|
90
|
+
Installation where the resource doesn't match the filename and you install to a custom plugins dir:
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
ohai_plugin 'My Ohai Plugin' do
|
94
|
+
name 'my_custom_plugin'
|
95
|
+
path '/my/custom/path/'
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
99
|
+
Installation using a template:
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
ohai_plugin 'My Templated Plugin' do
|
103
|
+
name 'templated_plugin'
|
104
|
+
resource :template
|
105
|
+
variables node_type: :web_server
|
106
|
+
end
|
107
|
+
```
|
108
|
+
|
109
|
+
#### ChefSpec Matchers
|
110
|
+
|
111
|
+
You can check for the creation or deletion of ohai plugins with chefspec using these custom matches:
|
112
|
+
|
113
|
+
- create_ohai_plugin
|
114
|
+
- delete_ohai_plugin
|
115
|
+
|
116
|
+
## License & Authors
|
117
|
+
|
118
|
+
**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))
|
119
|
+
|
120
|
+
**Copyright:** 2011-2016, Chef Software, Inc.
|
121
|
+
|
122
|
+
```
|
123
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
124
|
+
you may not use this file except in compliance with the License.
|
125
|
+
You may obtain a copy of the License at
|
126
|
+
|
127
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
128
|
+
|
129
|
+
Unless required by applicable law or agreed to in writing, software
|
130
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
131
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
132
|
+
See the License for the specific language governing permissions and
|
133
|
+
limitations under the License.
|
134
|
+
```
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook:: ohai
|
3
|
+
# Library:: matchers
|
4
|
+
#
|
5
|
+
# Author:: Tim Smith (<tsmith@chef.io>)
|
6
|
+
#
|
7
|
+
# Copyright:: 2016-2017, Chef Software, Inc.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
if defined?(ChefSpec)
|
23
|
+
ChefSpec.define_matcher :ohai_hint
|
24
|
+
ChefSpec.define_matcher :ohai_plugin
|
25
|
+
|
26
|
+
def create_ohai_hint(resource)
|
27
|
+
ChefSpec::Matchers::ResourceMatcher.new(:ohai_hint, :create, resource)
|
28
|
+
end
|
29
|
+
|
30
|
+
def delete_ohai_hint(resource)
|
31
|
+
ChefSpec::Matchers::ResourceMatcher.new(:ohai_hint, :delete, resource)
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_ohai_plugin(resource)
|
35
|
+
ChefSpec::Matchers::ResourceMatcher.new(:ohai_plugin, :create, resource)
|
36
|
+
end
|
37
|
+
|
38
|
+
def delete_ohai_plugin(resource)
|
39
|
+
ChefSpec::Matchers::ResourceMatcher.new(:ohai_plugin, :delete, resource)
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"ohai","version":"5.1.0","description":"Provides custom resources for installing Ohai hints and plugins","long_description":"# ohai Cookbook\n\n[](https://travis-ci.org/chef-cookbooks/ohai) [](https://ci.appveyor.com/project/ChefWindowsCookbooks/ohai/branch/master) [](https://supermarket.chef.io/cookbooks/ohai)\n\nContains custom resources for adding Ohai hints and installing custom Ohai plugins. Handles path creation as well as the reloading of Ohai so that new data will be available during the same run.\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Amazon/Oracle\n- openSUSE / SUSE Enterprise Linux\n- FreeBSD\n- Windows\n\n### Chef\n\n- Chef 12.7+\n\n### Cookbooks\n\n- none\n\n## Custom Resources\n\n### `ohai_hint`\n\nCreates Ohai hint files, which are consumed by Ohai plugins in order to determine if they should run or not.\n\n#### Resource Attributes\n\n- `hint_name` - The name of hints file and key. Should be string, default is name of resource.\n- `content` - Values of hints. It will be used as automatic attributes. Should be Hash, default is empty Hash\n- `compile_time` - Should the resource run at compile time. This defaults to true\n\n#### Examples\n\nHint file installed to the default directory:\n\n```ruby\nohai_hint 'ec2'\n```\n\nHint file not installed at compile time:\n\n```ruby\nohai_hint 'ec2' do\n compile_time false\nend\n```\n\nHint file installed with content:\n\n```ruby\nohai_hint 'raid_present' do\n content Hash[:a, 'test_content']\nend\n```\n\n#### ChefSpec Matchers\n\nYou can check for the creation or deletion of ohai hints with chefspec using these custom matches:\n\n- create_ohai_hint\n- delete_ohai_hint\n\n### `ohai_plugin`\n\nInstalls custom Ohai plugins.\n\n#### Resource Attributes\n\n- `plugin_name` - The name to give the plugin on the filesystem. Should be string, default is name of resource.\n- `path` - The path to your custom plugin directory. Defaults to a directory named 'plugins' under the directory 'ohai' in the Chef config dir.\n- `source_file` - The source file for the plugin in your cookbook if not NAME.rb.\n- `cookbook` - The cookbook where the source file exists if not the cookbook where the ohai_plugin resource is running from.\n- `resource` - The resource type for the plugin file. Either `:cookbook_file` or `:template`. Defaults to `:cookbook_file`.\n- `variables` - Usable only if `resource` is `:template`. Defines the template's variables.\n- `compile_time` - Should the resource run at compile time. This defaults to `true`.\n\n#### examples\n\nSimple Ohai plugin installation:\n\n```ruby\nohai_plugin 'my_custom_plugin'\n```\n\nInstallation where the resource doesn't match the filename and you install to a custom plugins dir:\n\n```ruby\nohai_plugin 'My Ohai Plugin' do\n name 'my_custom_plugin'\n path '/my/custom/path/'\nend\n```\n\nInstallation using a template:\n\n```ruby\nohai_plugin 'My Templated Plugin' do\n name 'templated_plugin'\n resource :template\n variables node_type: :web_server\nend\n```\n\n#### ChefSpec Matchers\n\nYou can check for the creation or deletion of ohai plugins with chefspec using these custom matches:\n\n- create_ohai_plugin\n- delete_ohai_plugin\n\n## License & Authors\n\n**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))\n\n**Copyright:** 2011-2016, Chef Software, Inc.\n\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":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"ubuntu":">= 0.0.0","debian":">= 0.0.0","centos":">= 0.0.0","redhat":">= 0.0.0","amazon":">= 0.0.0","scientific":">= 0.0.0","fedora":">= 0.0.0","oracle":">= 0.0.0","suse":">= 0.0.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0","freebsd":">= 0.0.0","windows":">= 0.0.0","zlinux":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/ohai","issues_url":"https://github.com/chef-cookbooks/ohai/issues","chef_version":[[">= 12.7"]],"ohai_version":[]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook:: ohai
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright:: 2011-2017, Chef Software, Inc
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
Chef::Log.warn('The Ohai cookbook default recipe has no content as of the 4.0 release. See the readme for instructions on using the custom resources.')
|
@@ -0,0 +1,55 @@
|
|
1
|
+
property :hint_name, String, name_property: true
|
2
|
+
property :content, Hash
|
3
|
+
property :compile_time, [true, false], default: true
|
4
|
+
|
5
|
+
action :create do
|
6
|
+
directory ::Ohai::Config.ohai.hints_path.first do
|
7
|
+
action :create
|
8
|
+
recursive true
|
9
|
+
end
|
10
|
+
|
11
|
+
file ohai_hint_path do
|
12
|
+
action :create
|
13
|
+
content build_content
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
action :delete do
|
18
|
+
file ohai_hint_path do
|
19
|
+
action :delete
|
20
|
+
notifies :reload, ohai[reload ohai post hint removal]
|
21
|
+
end
|
22
|
+
|
23
|
+
ohai 'reload ohai post hint removal' do
|
24
|
+
action :nothing
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
action_class do
|
29
|
+
def ohai_hint_path
|
30
|
+
path = ::File.join(::Ohai::Config.ohai.hints_path.first, new_resource.hint_name)
|
31
|
+
path << '.json' unless path.end_with?('.json')
|
32
|
+
path
|
33
|
+
end
|
34
|
+
|
35
|
+
def build_content
|
36
|
+
# passing nil to file produces deprecation warnings so pass an empty string
|
37
|
+
return nil if new_resource.content.nil? || new_resource.content.empty?
|
38
|
+
JSON.pretty_generate(new_resource.content)
|
39
|
+
end
|
40
|
+
|
41
|
+
def file_content(path)
|
42
|
+
return JSON.parse(::File.read(path))
|
43
|
+
rescue JSON::ParserError
|
44
|
+
Chef::Log.debug("Could not parse JSON in ohai hint at #{ohai_hint_path}. It's probably an empty hint file")
|
45
|
+
return nil
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# this resource forces itself to run at compile_time
|
50
|
+
def after_created
|
51
|
+
return unless compile_time
|
52
|
+
Array(action).each do |action|
|
53
|
+
run_action(action)
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
property :plugin_name, String, name_property: true
|
2
|
+
property :path, String
|
3
|
+
property :source_file, String
|
4
|
+
property :cookbook, String
|
5
|
+
property :resource, [:cookbook_file, :template], default: :cookbook_file
|
6
|
+
property :variables, Hash
|
7
|
+
property :compile_time, [true, false], default: true
|
8
|
+
|
9
|
+
action :create do
|
10
|
+
# why create_if_missing you ask?
|
11
|
+
# no one can agree on perms and this allows them to manage the perms elsewhere
|
12
|
+
directory desired_plugin_path do
|
13
|
+
action :create
|
14
|
+
recursive true
|
15
|
+
not_if { ::File.exist?(desired_plugin_path) }
|
16
|
+
end
|
17
|
+
|
18
|
+
if new_resource.resource.eql?(:cookbook_file)
|
19
|
+
cookbook_file ::File.join(desired_plugin_path, new_resource.plugin_name + '.rb') do
|
20
|
+
cookbook new_resource.cookbook
|
21
|
+
source new_resource.source_file || "#{new_resource.plugin_name}.rb"
|
22
|
+
notifies :reload, "ohai[#{new_resource.plugin_name}]", :immediately
|
23
|
+
end
|
24
|
+
elsif new_resource.resource.eql?(:template)
|
25
|
+
template ::File.join(desired_plugin_path, new_resource.plugin_name + '.rb') do
|
26
|
+
cookbook new_resource.cookbook
|
27
|
+
source new_resource.source_file || "#{new_resource.plugin_name}.rb"
|
28
|
+
variables new_resource.variables
|
29
|
+
notifies :reload, "ohai[#{new_resource.plugin_name}]", :immediately
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Add the plugin path to the ohai plugin path if need be and warn
|
34
|
+
# the user that this is going to result in a reload every run
|
35
|
+
unless in_plugin_path?(desired_plugin_path)
|
36
|
+
plugin_path_warning
|
37
|
+
Chef::Log.warn("Adding #{desired_plugin_path} to the Ohai plugin path for this chef-client run only")
|
38
|
+
add_to_plugin_path(desired_plugin_path)
|
39
|
+
reload_required = true
|
40
|
+
end
|
41
|
+
|
42
|
+
ohai new_resource.plugin_name do
|
43
|
+
action :nothing
|
44
|
+
action :reload if reload_required
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
action :delete do
|
49
|
+
file ::File.join(desired_plugin_path, new_resource.plugin_name + '.rb') do
|
50
|
+
action :delete
|
51
|
+
notifies :reload, 'ohai[reload ohai post plugin removal]'
|
52
|
+
end
|
53
|
+
|
54
|
+
ohai 'reload ohai post plugin removal' do
|
55
|
+
action :nothing
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
action_class do
|
60
|
+
# return the path property if specified or
|
61
|
+
# CHEF_CONFIG_PATH/ohai/plugins if a path isn't specified
|
62
|
+
def desired_plugin_path
|
63
|
+
if new_resource.path
|
64
|
+
new_resource.path
|
65
|
+
else
|
66
|
+
::File.join(chef_config_path, 'ohai', 'plugins')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# return the chef config files dir or fail hard
|
71
|
+
def chef_config_path
|
72
|
+
if Chef::Config['config_file']
|
73
|
+
::File.dirname(Chef::Config['config_file'])
|
74
|
+
else
|
75
|
+
Chef::Application.fatal!("No chef config file defined. Are you running \
|
76
|
+
chef-solo? If so you will need to define a path for the ohai_plugin as the \
|
77
|
+
path cannot be determined")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# is the desired plugin dir in the ohai config plugin dir array?
|
82
|
+
def in_plugin_path?(path)
|
83
|
+
# get the directory where we plan to stick the plugin (not the actual file path)
|
84
|
+
desired_dir = ::File.directory?(path) ? path : ::File.dirname(path)
|
85
|
+
|
86
|
+
case node['platform']
|
87
|
+
when 'windows'
|
88
|
+
::Ohai::Config.ohai['plugin_path'].map(&:downcase).include?(desired_dir.downcase)
|
89
|
+
else
|
90
|
+
::Ohai::Config.ohai['plugin_path'].include?(desired_dir)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def add_to_plugin_path(path)
|
95
|
+
::Ohai::Config.ohai['plugin_path'] << path # new format
|
96
|
+
end
|
97
|
+
|
98
|
+
# we need to warn the user that unless the path for this plugin is in Ohai's
|
99
|
+
# plugin path already we're going to have to reload Ohai on every Chef run.
|
100
|
+
# Ideally in future versions of Ohai /etc/chef/ohai/plugins is in the path.
|
101
|
+
def plugin_path_warning
|
102
|
+
Chef::Log.warn("The Ohai plugin_path does not include #{desired_plugin_path}. \
|
103
|
+
Ohai will reload on each chef-client run in order to add this directory to the \
|
104
|
+
path unless you modify your client.rb configuration to add this directory to \
|
105
|
+
plugin_path. The plugin_path can be set via the chef-client::config recipe. \
|
106
|
+
See 'Ohai Settings' at https://docs.chef.io/config_rb_client.html#ohai-settings \
|
107
|
+
for more details.")
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# this resource forces itself to run at compile_time
|
112
|
+
def after_created
|
113
|
+
return unless compile_time
|
114
|
+
Array(action).each do |action|
|
115
|
+
run_action(action)
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
*.rbc
|
2
|
+
.config
|
3
|
+
coverage
|
4
|
+
InstalledFiles
|
5
|
+
lib/bundler/man
|
6
|
+
pkg
|
7
|
+
rdoc
|
8
|
+
spec/reports
|
9
|
+
test/tmp
|
10
|
+
test/version_tmp
|
11
|
+
tmp
|
12
|
+
_Store
|
13
|
+
*~
|
14
|
+
*#
|
15
|
+
.#*
|
16
|
+
\#*#
|
17
|
+
.*.sw[a-z]
|
18
|
+
*.un~
|
19
|
+
*.tmp
|
20
|
+
*.bk
|
21
|
+
*.bkup
|
22
|
+
|
23
|
+
# ruby/bundler files
|
24
|
+
.ruby-version
|
25
|
+
.ruby-gemset
|
26
|
+
.rvmrc
|
27
|
+
Gemfile.lock
|
28
|
+
.bundle
|
29
|
+
*.gem
|
30
|
+
|
31
|
+
# YARD artifacts
|
32
|
+
.yardoc
|
33
|
+
_yardoc
|
34
|
+
doc/
|
35
|
+
.idea
|
36
|
+
|
37
|
+
# chef stuff
|
38
|
+
Berksfile.lock
|
39
|
+
.kitchen
|
40
|
+
.kitchen.local.yml
|
41
|
+
vendor/
|
42
|
+
.coverage/
|
43
|
+
.zero-knife.rb
|
44
|
+
Policyfile.lock.json
|
45
|
+
Cheffile.lock
|
46
|
+
.librarian/
|
47
|
+
|
48
|
+
# vagrant stuff
|
49
|
+
.vagrant/
|
50
|
+
.vagrant.d/
|
51
|
+
.kitchen/
|
@@ -0,0 +1,25 @@
|
|
1
|
+
driver:
|
2
|
+
name: vagrant
|
3
|
+
|
4
|
+
provisioner:
|
5
|
+
name: chef_zero
|
6
|
+
deprecations_as_errors: true
|
7
|
+
|
8
|
+
platforms:
|
9
|
+
- name: centos-6.8
|
10
|
+
- name: centos-7.3
|
11
|
+
- name: fedora-25
|
12
|
+
|
13
|
+
|
14
|
+
suites:
|
15
|
+
- name: default
|
16
|
+
run_list:
|
17
|
+
- recipe[selinux_policy_test::setup]
|
18
|
+
- recipe[selinux_policy_test::single_port]
|
19
|
+
- recipe[selinux_policy_test::twice_port]
|
20
|
+
- recipe[selinux_policy_test::range_port]
|
21
|
+
- recipe[selinux_policy_test::bad_port]
|
22
|
+
- recipe[selinux_policy_test::module]
|
23
|
+
- recipe[selinux_policy_test::module_directory]
|
24
|
+
- recipe[selinux_policy_test::fcontext]
|
25
|
+
- recipe[selinux_policy_test::fcontext_filetype]
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Use Travis's cointainer based infrastructure
|
2
|
+
sudo: false
|
3
|
+
|
4
|
+
addons:
|
5
|
+
apt:
|
6
|
+
sources:
|
7
|
+
- chef-stable-precise
|
8
|
+
packages:
|
9
|
+
- chefdk
|
10
|
+
|
11
|
+
# Don't `bundle install`
|
12
|
+
install: echo "skip bundle install"
|
13
|
+
|
14
|
+
branches:
|
15
|
+
only:
|
16
|
+
- master
|
17
|
+
|
18
|
+
# Ensure we make ChefDK's Ruby the default
|
19
|
+
before_script:
|
20
|
+
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
|
21
|
+
|
22
|
+
script:
|
23
|
+
- /opt/chefdk/embedded/bin/chef --version
|
24
|
+
- /opt/chefdk/embedded/bin/cookstyle --version
|
25
|
+
- /opt/chefdk/embedded/bin/foodcritic --version
|
26
|
+
- /opt/chefdk/bin/chef exec rake
|