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.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/.rakeTasks +7 -0
  3. data/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. data/.idea/misc.xml +4 -0
  5. data/.idea/modules.xml +8 -0
  6. data/.idea/runConfigurations/clone.xml +21 -0
  7. data/.idea/runConfigurations/libvirt.xml +21 -0
  8. data/.idea/vagrant-clone.iml +114 -0
  9. data/.idea/vcs.xml +6 -0
  10. data/.idea/workspace.xml +948 -0
  11. data/Gemfile +9 -3
  12. data/Gemfile.lock +123 -37
  13. data/Rakefile +2 -1
  14. data/Vagrantfile +9 -0
  15. data/cookbooks/apt/CHANGELOG.md +321 -0
  16. data/cookbooks/apt/CONTRIBUTING.md +2 -0
  17. data/cookbooks/apt/MAINTAINERS.md +15 -0
  18. data/cookbooks/apt/README.md +250 -0
  19. data/cookbooks/apt/attributes/default.rb +57 -0
  20. data/cookbooks/apt/files/15update-stamp +1 -0
  21. data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
  22. data/cookbooks/apt/libraries/helpers.rb +49 -0
  23. data/cookbooks/apt/libraries/matchers.rb +16 -0
  24. data/cookbooks/apt/metadata.json +1 -0
  25. data/cookbooks/apt/recipes/cacher-client.rb +52 -0
  26. data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
  27. data/cookbooks/apt/recipes/default.rb +93 -0
  28. data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
  29. data/cookbooks/apt/resources/preference.rb +90 -0
  30. data/cookbooks/apt/templates/01proxy.erb +11 -0
  31. data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
  32. data/cookbooks/apt/templates/10recommends.erb +3 -0
  33. data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
  34. data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
  35. data/cookbooks/apt/templates/acng.conf.erb +275 -0
  36. data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
  37. data/cookbooks/build-essential/.foodcritic +1 -0
  38. data/cookbooks/build-essential/CHANGELOG.md +257 -0
  39. data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
  40. data/cookbooks/build-essential/MAINTAINERS.md +15 -0
  41. data/cookbooks/build-essential/README.md +134 -0
  42. data/cookbooks/build-essential/attributes/default.rb +21 -0
  43. data/cookbooks/build-essential/libraries/matchers.rb +9 -0
  44. data/cookbooks/build-essential/metadata.json +1 -0
  45. data/cookbooks/build-essential/recipes/_windows.rb +53 -0
  46. data/cookbooks/build-essential/recipes/default.rb +24 -0
  47. data/cookbooks/build-essential/resources/build_essential.rb +106 -0
  48. data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
  49. data/cookbooks/compat_resource/CHANGELOG.md +53 -0
  50. data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
  51. data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
  52. data/cookbooks/compat_resource/README.md +60 -0
  53. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
  54. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
  55. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
  56. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
  57. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
  58. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
  59. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
  60. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
  61. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
  62. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
  63. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
  64. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
  65. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
  66. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
  67. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
  68. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
  69. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
  70. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
  71. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
  72. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
  73. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
  74. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
  75. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
  76. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
  77. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
  78. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
  79. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
  80. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
  81. data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
  82. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
  83. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
  84. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
  85. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
  86. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
  87. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
  88. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
  89. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
  90. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
  91. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
  92. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
  93. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
  94. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
  95. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
  96. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
  97. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
  98. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
  99. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
  100. data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
  101. data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
  102. data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
  103. data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
  104. data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
  105. data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
  106. data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
  107. data/cookbooks/compat_resource/metadata.json +1 -0
  108. data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
  109. data/cookbooks/inifile_chef_gem/README.md +46 -0
  110. data/cookbooks/inifile_chef_gem/metadata.json +51 -0
  111. data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
  112. data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
  113. data/cookbooks/mariadb/CHANGELOG.md +332 -0
  114. data/cookbooks/mariadb/README.md +225 -0
  115. data/cookbooks/mariadb/attributes/default.rb +199 -0
  116. data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
  117. data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
  118. data/cookbooks/mariadb/libraries/matchers.rb +21 -0
  119. data/cookbooks/mariadb/metadata.json +1 -0
  120. data/cookbooks/mariadb/providers/configuration.rb +39 -0
  121. data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
  122. data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
  123. data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
  124. data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
  125. data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
  126. data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
  127. data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
  128. data/cookbooks/mariadb/recipes/client.rb +47 -0
  129. data/cookbooks/mariadb/recipes/config.rb +115 -0
  130. data/cookbooks/mariadb/recipes/default.rb +46 -0
  131. data/cookbooks/mariadb/recipes/devel.rb +41 -0
  132. data/cookbooks/mariadb/recipes/galera.rb +324 -0
  133. data/cookbooks/mariadb/recipes/plugins.rb +3 -0
  134. data/cookbooks/mariadb/recipes/repository.rb +45 -0
  135. data/cookbooks/mariadb/recipes/server.rb +157 -0
  136. data/cookbooks/mariadb/resources/configuration.rb +13 -0
  137. data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
  138. data/cookbooks/mariadb/resources/replication.rb +192 -0
  139. data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
  140. data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
  141. data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
  142. data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
  143. data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
  144. data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
  145. data/cookbooks/mingw/.foodcritic +1 -0
  146. data/cookbooks/mingw/CHANGELOG.md +50 -0
  147. data/cookbooks/mingw/CONTRIBUTING.md +2 -0
  148. data/cookbooks/mingw/MAINTAINERS.md +14 -0
  149. data/cookbooks/mingw/README.md +133 -0
  150. data/cookbooks/mingw/files/default/bash.bat +17 -0
  151. data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
  152. data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
  153. data/cookbooks/mingw/files/default/pthread.h +719 -0
  154. data/cookbooks/mingw/files/default/time.h +297 -0
  155. data/cookbooks/mingw/libraries/_helper.rb +38 -0
  156. data/cookbooks/mingw/metadata.json +1 -0
  157. data/cookbooks/mingw/recipes/default.rb +19 -0
  158. data/cookbooks/mingw/resources/get.rb +56 -0
  159. data/cookbooks/mingw/resources/msys2_package.rb +139 -0
  160. data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
  161. data/cookbooks/ohai/.foodcritic +2 -0
  162. data/cookbooks/ohai/CHANGELOG.md +166 -0
  163. data/cookbooks/ohai/CONTRIBUTING.md +2 -0
  164. data/cookbooks/ohai/MAINTAINERS.md +15 -0
  165. data/cookbooks/ohai/README.md +134 -0
  166. data/cookbooks/ohai/libraries/matchers.rb +41 -0
  167. data/cookbooks/ohai/metadata.json +1 -0
  168. data/cookbooks/ohai/recipes/default.rb +20 -0
  169. data/cookbooks/ohai/resources/hint.rb +55 -0
  170. data/cookbooks/ohai/resources/plugin.rb +117 -0
  171. data/cookbooks/selinux_policy/.gitignore +51 -0
  172. data/cookbooks/selinux_policy/.kitchen.yml +25 -0
  173. data/cookbooks/selinux_policy/.rubocop.yml +2 -0
  174. data/cookbooks/selinux_policy/.travis.yml +26 -0
  175. data/cookbooks/selinux_policy/Berksfile +8 -0
  176. data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
  177. data/cookbooks/selinux_policy/LICENSE +13 -0
  178. data/cookbooks/selinux_policy/README.md +217 -0
  179. data/cookbooks/selinux_policy/Rakefile +68 -0
  180. data/cookbooks/selinux_policy/TESTING.md +2 -0
  181. data/cookbooks/selinux_policy/Thorfile +12 -0
  182. data/cookbooks/selinux_policy/attributes/default.rb +5 -0
  183. data/cookbooks/selinux_policy/chefignore +102 -0
  184. data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
  185. data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
  186. data/cookbooks/selinux_policy/metadata.json +58 -0
  187. data/cookbooks/selinux_policy/metadata.rb +20 -0
  188. data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
  189. data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
  190. data/cookbooks/selinux_policy/providers/module.rb +81 -0
  191. data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
  192. data/cookbooks/selinux_policy/providers/port.rb +58 -0
  193. data/cookbooks/selinux_policy/recipes/default.rb +9 -0
  194. data/cookbooks/selinux_policy/recipes/install.rb +32 -0
  195. data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
  196. data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
  197. data/cookbooks/selinux_policy/resources/module.rb +21 -0
  198. data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
  199. data/cookbooks/selinux_policy/resources/port.rb +9 -0
  200. data/cookbooks/seven_zip/CHANGELOG.md +30 -0
  201. data/cookbooks/seven_zip/README.md +108 -0
  202. data/cookbooks/seven_zip/attributes/default.rb +31 -0
  203. data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
  204. data/cookbooks/seven_zip/metadata.json +1 -0
  205. data/cookbooks/seven_zip/providers/archive.rb +68 -0
  206. data/cookbooks/seven_zip/recipes/default.rb +41 -0
  207. data/cookbooks/seven_zip/resources/archive.rb +29 -0
  208. data/cookbooks/windows/.foodcritic +2 -0
  209. data/cookbooks/windows/CHANGELOG.md +528 -0
  210. data/cookbooks/windows/CONTRIBUTING.md +2 -0
  211. data/cookbooks/windows/MAINTAINERS.md +21 -0
  212. data/cookbooks/windows/README.md +803 -0
  213. data/cookbooks/windows/attributes/default.rb +21 -0
  214. data/cookbooks/windows/files/dism_features.rb +45 -0
  215. data/cookbooks/windows/libraries/matchers.rb +586 -0
  216. data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
  217. data/cookbooks/windows/libraries/registry_helper.rb +356 -0
  218. data/cookbooks/windows/libraries/version.rb +207 -0
  219. data/cookbooks/windows/libraries/version_helper.rb +79 -0
  220. data/cookbooks/windows/libraries/windows_helper.rb +174 -0
  221. data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
  222. data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
  223. data/cookbooks/windows/metadata.json +1 -0
  224. data/cookbooks/windows/recipes/default.rb +21 -0
  225. data/cookbooks/windows/resources/auto_run.rb +46 -0
  226. data/cookbooks/windows/resources/certificate.rb +166 -0
  227. data/cookbooks/windows/resources/certificate_binding.rb +128 -0
  228. data/cookbooks/windows/resources/feature.rb +82 -0
  229. data/cookbooks/windows/resources/feature_dism.rb +108 -0
  230. data/cookbooks/windows/resources/feature_powershell.rb +70 -0
  231. data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
  232. data/cookbooks/windows/resources/font.rb +80 -0
  233. data/cookbooks/windows/resources/http_acl.rb +110 -0
  234. data/cookbooks/windows/resources/pagefile.rb +152 -0
  235. data/cookbooks/windows/resources/path.rb +54 -0
  236. data/cookbooks/windows/resources/printer.rb +103 -0
  237. data/cookbooks/windows/resources/printer_port.rb +101 -0
  238. data/cookbooks/windows/resources/share.rb +291 -0
  239. data/cookbooks/windows/resources/shortcut.rb +53 -0
  240. data/cookbooks/windows/resources/task.rb +384 -0
  241. data/cookbooks/windows/resources/zipfile.rb +125 -0
  242. data/cookbooks/yum/.foodcritic +1 -0
  243. data/cookbooks/yum/CHANGELOG.md +351 -0
  244. data/cookbooks/yum/CONTRIBUTING.md +2 -0
  245. data/cookbooks/yum/MAINTAINERS.md +16 -0
  246. data/cookbooks/yum/README.md +125 -0
  247. data/cookbooks/yum/attributes/main.rb +103 -0
  248. data/cookbooks/yum/libraries/matchers.rb +9 -0
  249. data/cookbooks/yum/metadata.json +1 -0
  250. data/cookbooks/yum/recipes/default.rb +26 -0
  251. data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
  252. data/cookbooks/yum/resources/globalconfig.rb +119 -0
  253. data/cookbooks/yum/templates/.DS_Store +0 -0
  254. data/cookbooks/yum/templates/main.erb +276 -0
  255. data/cookbooks/yum-epel/CHANGELOG.md +138 -0
  256. data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
  257. data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
  258. data/cookbooks/yum-epel/README.md +172 -0
  259. data/cookbooks/yum-epel/attributes/default.rb +8 -0
  260. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
  261. data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
  262. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
  263. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
  264. data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
  265. data/cookbooks/yum-epel/attributes/epel.rb +21 -0
  266. data/cookbooks/yum-epel/metadata.json +1 -0
  267. data/cookbooks/yum-epel/recipes/default.rb +27 -0
  268. data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
  269. data/cookbooks/yum-scl/.kitchen.yml +24 -0
  270. data/cookbooks/yum-scl/.rubocop.yml +6 -0
  271. data/cookbooks/yum-scl/.travis.yml +28 -0
  272. data/cookbooks/yum-scl/Berksfile +3 -0
  273. data/cookbooks/yum-scl/Berksfile.lock +25 -0
  274. data/cookbooks/yum-scl/CHANGELOG.md +11 -0
  275. data/cookbooks/yum-scl/Gemfile +46 -0
  276. data/cookbooks/yum-scl/README.md +76 -0
  277. data/cookbooks/yum-scl/attributes/centos.rb +83 -0
  278. data/cookbooks/yum-scl/attributes/default.rb +15 -0
  279. data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
  280. data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
  281. data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
  282. data/cookbooks/yum-scl/metadata.json +42 -0
  283. data/cookbooks/yum-scl/metadata.rb +12 -0
  284. data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
  285. data/cookbooks/yum-scl/recipes/default.rb +17 -0
  286. data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
  287. data/lib/vagrant-clone/command/clone.rb +66 -61
  288. data/lib/vagrant-clone/errors.rb +61 -0
  289. data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
  290. data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
  291. data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
  292. data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
  293. data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
  294. data/lib/vagrant-clone/version.rb +2 -2
  295. data/lib/vagrant-clone.rb +6 -6
  296. data/libvirt.txt +7 -0
  297. data/performance_testing.rb +165 -0
  298. data/results.txt +45 -0
  299. data/scripts/create_box.sh +134 -0
  300. data/test.rb +92 -0
  301. data/tools/create_box.sh +130 -0
  302. data/vagrant-clone.gemspec +7 -7
  303. metadata +296 -5
  304. data/lib/vagrant-clone/command/errors.rb +0 -16
  305. data/lib/vagrant-clone/command/provider/docker.rb +0 -13
  306. data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "selinux_policy",
3
+ "description": "Manages SELinux policy components",
4
+ "long_description": "# SELinux Policy Cookbook\n\nThis cookbook can be used to manage SELinux policies and components (rather than just enable / disable enforcing). I made it because I needed some SELinux settings done, and the `execute`s started to look annoying.\n\n## Requirements\n\nNeeds an SELinux policy active (so its values can be managed). Can work with a disabled SELinux system (see attribute `allow_disabled`), which will generate warnings and do nothing (but won't break the run). Also requires SELinux's management tools, namely `semanage`, `setsebool` and `getsebool`. Tools are installed by the `selinux_policy::install` recipe (for RHEL/Debian and the like).\n\n### Chef\n\n- Chef 12.1+\n\n### Platforms\n\n- rhel\n- fedora\n\n## Attributes\n\nThese attributes affect the way all of the LWRPs are behaving.\n\n- `node['selinux_policy']['allow_disabled']` - Whether to allow runs when SELinux is disabled. Will generate warnings, but the run won't fail. Defaults to `true`, set to `false` if you don't have any machines with disabled SELinux.\n\n## Usage\n\n- `selinux_policy::install` - Installs SELinux policy management tools\n\nThis cookbook's functionality is exposed via resources, so it should be called from a wrapper cookbook. Remember to add `depends 'selinux_policy'` to your `metadata.rb`.\n\n### boolean\n\nRepresents an SELinux [boolean](http://wiki.gentoo.org/wiki/SELinux/Tutorials/Using_SELinux_booleans). You can either `set` it, meaning it will be changed without persistence (it will revert to default in the next reboot), or `setpersist` it (default action), so it'll keep it value after rebooting. Using `setpersist` requires an active policy (so that the new value can be saved somewhere).\n\nAttributes:\n\n- `name`: boolean's name. Defaults to resource name.\n- `value`: Its new value (`true`/`false`).\n- `force`: Use `setsebool` even if the current value agrees with the requested one.\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\nselinux_policy_boolean 'httpd_can_network_connect' do\n value true\n # Make sure nginx is started if this value was modified\n notifies :start,'service[nginx]', :immediate\nend\n```\n\n**Note**: Due to ruby interperting `0` as `true`, using `value 0` is unwise.\n\n### port\n\nAllows assigning a network port to a certain SELinux context. As explained [here](http://wiki.centos.org/HowTos/SELinux#head-ad837f60830442ae77a81aedd10c20305a811388), it can be useful for running Apache on a non-standard port.\n\nActions:\n\n- `addormodify` (default): Assigns the port to the right context, whether it's already listed another context or not at all.\n- `add`: Assigns the port to the right context it's if not listed (only uses `-a`).\n- `modify`: Changes the port's context if it's already listed (only uses `-m`).\n- `delete`: Removes the port's context if it's listed (uses `-d`).\n\nAttributes:\n\n- `port`: The port in question, defaults to resource name.\n- `protocol`: `tcp`/`udp`.\n- `secontext`: The SELinux context to assign the port to. Unnecessary when using `delete`.\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Allow nginx to bind to port 5678, by giving it the http_port_t context\nselinux_policy_port '5678' do\n protocol 'tcp'\n secontext 'http_port_t'\nend\n```\n\n### module\n\nManages SEModules\n\nActions:\n\n- `fetch`: Prepares the module's files for compilation. Allow `remote_directory`-like behavior\n- `compile`: Translates a module source directory into a `NAME.pp` file. Uses `make` logic for idempotence.\n- `install`: Adds a compiled module (`pp`) to the current policy. Only installs if the module was modified this run, `force` is enabled or it's missing from the current policy. **Note:** I wish I could compare the existing module to the one generated, but the `extract` capability was only added in [Aug 15](https://github.com/SELinuxProject/selinux/commit/65c6325271b54d3de9c17352a57d469dfbd12729). I'll be happy to see a better idea.\n- `deploy` (default): Runs `fetch`, `compile`, `install` in that order.\n- `remove`: Removes a module.\n\nAttributes:\n\n- `name`: The module name. Defaults to resource name.\n- `directory`: Directory where module is stored. Defaults to a directory inside the Chef cache.\n- `content`: The module content, can be extracted from `audit2allow -m NAME`. This can be used to create simple modules without using external files.\n- `directory_source`: Copies files cookbook to the module directory (uses `remote_directory`). Allows keeping all of the module's source files in the cookbook. **Note:** You can pre-create the module directory and populate it in any other way you'd choose.\n- `cookbook`: Modifies the source cookbook for the `remote_directory`.\n- `force`: Installs the module even if it seems fine. Ruins idempotence but should help solve some weird cases.\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Allow openvpn to write/delete in '/etc/openvpn'\nselinux_policy_module 'openvpn-googleauthenticator' do\n content <<-eos\n module dy-openvpn-googleauthenticator 1.0;\n\n require {\n type openvpn_t;\n type openvpn_etc_t;\n class file { write unlink };\n }\n\n\n #============= openvpn_t ==============\n allow openvpn_t openvpn_etc_t:file { write unlink };\n eos\n action :deploy\nend\n```\n\n### fcontext\n\nAllows managing the SELinux context of files. This can be used to grant SELinux-protected daemons access to additional / moved files.\n\nActions:\n\n- `addormodify` (default): Assigns the file regexp to the right context, whether it's already listed another context or not at all.\n- `add`: Assigns the file regexp to the right context it's if not listed (only uses -a).\n- `modify`: Changes the file regexp context if it's already listed (only uses -m).\n- `delete`: Removes the file regexp context if it's listed (uses -d).\n\nAttributes:\n\n- `file_spec`: This is the file regexp in question, defaults to resource name.\n- `secontext`: The SELinux context to assign the file regexp to. Not required for `:delete`\n- `file_type`: Restrict the fcontext to specific file types. See the table below for an overview. See also <https://en.wikipedia.org/wiki/Unix_file_types> for more info\n- **a** All files\n- **f** Regular files\n- **d** Directory\n- **c** Character device\n- **b** Block device\n- **s** Socket\n- **l** Symbolic link\n- **p** Namedpipe\n\nExample usage (see mysql cookbook for example daemons ):\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Allow http servers (nginx/apache) to modify moodle files\nselinux_policy_fcontext '/var/www/moodle(/.*)?' do\n secontext 'httpd_sys_rw_content_t'\nend\n\n# Allow a custom mysql daemon to access its files.\n{'mysqld_etc_t' => \"/etc/mysql-#{service_name}(/.*)?\",\n'mysqld_etc_t' => \"/etc/mysql-#{service_name}/my\\.cnf\",\n'mysqld_log_t' => \"/var/log/mysql-#{service_name}(/.*)?\",\n'mysqld_db_t' => \"/opt/mysql_data_#{service_name}(/.*)?\",\n'mysqld_var_run_t' => \"/var/run/mysql-#{service_name}(/.*)?\",\n'mysqld_initrc_exec_t' => \"/etc/rc\\.d/init\\.d/mysql-#{service_name}\"}.each do |sc, f|\n selinux_policy_fcontext f do\n secontext sc\n end\nend\n\n# Adapt a symbolic link\nselinux_policy_fcontext '/var/www/symlink_to_webroot' do\n secontext 'httpd_sys_rw_content_t'\n filetype 'l'\nend\n```\n\n### permissive\n\nAllows some types to misbehave without stopping them. Not as good as specific policies, but better than disabling SELinux entirely.\n\nActions:\n\n- `add`: Adds a permissive, unless it's already added\n- `delete`: Deletes a permissive if it's listed\n\nExample usage:\n\n```ruby\ninclude_recipe 'selinux_policy::install'\n\n# Disable enforcement on Nginx\n# As described on http://nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/\n\nselinux_policy_permissive 'nginx' do\n notifies :restart, 'service[nginx]'\nend\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a named feature branch (like `add_component_x`)\n3. Write your change\n4. Write tests for your change (if applicable): If fixing a bug, please add regression tests for the RSpec (if possible) and the kitchen If adding a feature, please create basic tests for it, in both RSpec and kitchen\n5. Run the tests, ensuring they all pass, using `rake testing:user`\n6. Submit a Pull Request using Github Please **attach the test results** using a gist\n\n## License and Authors\n\n- Licensed [GPL v2](http://choosealicense.com/licenses/gpl-2.0/)\n- Author:: [Nitzan Raz](https://github.com/BackSlasher) ([backslasher](http://backslasher.net))\n- Maintainer Community:: Sous Chefs [help@sous-chefs.org](mailto:help@sous-chefs.org)\n",
5
+ "maintainer": "Sous Chefs",
6
+ "maintainer_email": "help@sous-chefs.org",
7
+ "license": "GPL v2",
8
+ "platforms": {
9
+ "redhat": ">= 0.0.0",
10
+ "centos": ">= 0.0.0",
11
+ "fedora": ">= 0.0.0",
12
+ "ubuntu": ">= 0.0.0",
13
+ "debian": ">= 0.0.0",
14
+ "amazon": ">= 0.0.0"
15
+ },
16
+ "dependencies": {
17
+ "compat_resource": ">= 12.16.3"
18
+ },
19
+ "recommendations": {
20
+
21
+ },
22
+ "suggestions": {
23
+
24
+ },
25
+ "conflicting": {
26
+
27
+ },
28
+ "providing": {
29
+
30
+ },
31
+ "replacing": {
32
+
33
+ },
34
+ "attributes": {
35
+
36
+ },
37
+ "groupings": {
38
+
39
+ },
40
+ "recipes": {
41
+
42
+ },
43
+ "version": "2.0.1",
44
+ "source_url": "https://github.com/sous-chefs/selinux_policy",
45
+ "issues_url": "https://github.com/sous-chefs/selinux_policy/issues",
46
+ "privacy": false,
47
+ "chef_versions": [
48
+ [
49
+ ">= 12.1"
50
+ ]
51
+ ],
52
+ "ohai_versions": [
53
+
54
+ ],
55
+ "gems": [
56
+
57
+ ]
58
+ }
@@ -0,0 +1,20 @@
1
+ name 'selinux_policy'
2
+ maintainer 'Sous Chefs'
3
+ maintainer_email 'help@sous-chefs.org'
4
+ license 'GPL v2'
5
+ description 'Manages SELinux policy components'
6
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
+ version '2.0.1'
8
+
9
+ supports 'redhat'
10
+ supports 'centos'
11
+ supports 'fedora'
12
+ supports 'ubuntu'
13
+ supports 'debian'
14
+ supports 'amazon'
15
+
16
+ depends 'compat_resource', '>= 12.16.3'
17
+
18
+ source_url 'https://github.com/sous-chefs/selinux_policy'
19
+ issues_url 'https://github.com/sous-chefs/selinux_policy/issues'
20
+ chef_version '>= 12.1' if respond_to?(:chef_version)
@@ -0,0 +1,28 @@
1
+ include Chef::SELinuxPolicy::Helpers
2
+
3
+ # Support whyrun
4
+ def whyrun_supported?
5
+ true
6
+ end
7
+
8
+ use_inline_resources
9
+
10
+ # Set for now, without persisting
11
+ action :set do
12
+ sebool(false)
13
+ end
14
+
15
+ # Set and persist
16
+ action :setpersist do
17
+ sebool(true)
18
+ end
19
+
20
+ def sebool(persist = false)
21
+ persist_string = persist ? '-P ' : ''
22
+ new_value = new_resource.value ? 'on' : 'off'
23
+ execute "selinux-setbool-#{new_resource.name}-#{new_value}" do
24
+ command "/usr/sbin/setsebool #{persist_string} #{new_resource.name} #{new_value}"
25
+ not_if "/usr/sbin/getsebool #{new_resource.name} | grep '#{new_value}$' >/dev/null" unless new_resource.force
26
+ only_if { use_selinux }
27
+ end
28
+ end
@@ -0,0 +1,78 @@
1
+ include Chef::SELinuxPolicy::Helpers
2
+
3
+ # Support whyrun
4
+ def whyrun_supported?
5
+ true
6
+ end
7
+
8
+ def fcontext_defined(file_spec, file_type, label = nil)
9
+ file_hash = {
10
+ 'a' => 'all files',
11
+ 'f' => 'regular file',
12
+ 'd' => 'directory',
13
+ 'c' => 'character device',
14
+ 'b' => 'block device',
15
+ 's' => 'socket',
16
+ 'l' => 'symbolic link',
17
+ 'p' => 'named pipe',
18
+ }
19
+
20
+ label_matcher = label ? "system_u:object_r:#{Regexp.escape(label)}:s0\\s*$" : ''
21
+ "semanage fcontext -l | grep -qP '^#{Regexp.escape(file_spec)}\\s+#{Regexp.escape(file_hash[file_type])}\\s+#{label_matcher}'"
22
+ end
23
+
24
+ def semanage_options(file_type)
25
+ # Set options for file_type
26
+ if node['platform_family'].include?('rhel') && Chef::VersionConstraint.new('< 7.0').include?(node['platform_version'])
27
+ case file_type
28
+ when 'a' then '-f ""'
29
+ when 'f' then '-f --'
30
+ else; "-f -#{file_type}"
31
+ end
32
+ else
33
+ "-f #{file_type}"
34
+ end
35
+ end
36
+
37
+ use_inline_resources
38
+
39
+ # Run restorecon to fix label
40
+ action :relabel do
41
+ res = shell_out!('find', '/', '-regextype', 'posix-egrep', '-regex', new_resource.file_spec, '-execdir', 'restorecon', '-iRv', '{}', ';')
42
+ new_resource.updated_by_last_action(true) unless res.stdout.empty?
43
+ end
44
+
45
+ # Create if doesn't exist, do not touch if fcontext is already registered
46
+ action :add do
47
+ execute "selinux-fcontext-#{new_resource.secontext}-add" do
48
+ command "/usr/sbin/semanage fcontext -a #{semanage_options(new_resource.file_type)} -t #{new_resource.secontext} '#{new_resource.file_spec}'"
49
+ not_if fcontext_defined(new_resource.file_spec, new_resource.file_type)
50
+ only_if { use_selinux }
51
+ notifies :relabel, new_resource, :immediate
52
+ end
53
+ end
54
+
55
+ # Delete if exists
56
+ action :delete do
57
+ execute "selinux-fcontext-#{new_resource.secontext}-delete" do
58
+ command "/usr/sbin/semanage fcontext #{semanage_options(new_resource.file_type)} -d '#{new_resource.file_spec}'"
59
+ only_if fcontext_defined(new_resource.file_spec, new_resource.file_type, new_resource.secontext)
60
+ only_if { use_selinux }
61
+ notifies :relabel, new_resource, :immediate
62
+ end
63
+ end
64
+
65
+ action :modify do
66
+ execute "selinux-fcontext-#{new_resource.secontext}-modify" do
67
+ command "/usr/sbin/semanage fcontext -m #{semanage_options(new_resource.file_type)} -t #{new_resource.secontext} '#{new_resource.file_spec}'"
68
+ only_if { use_selinux }
69
+ only_if fcontext_defined(new_resource.file_spec, new_resource.file_type)
70
+ not_if fcontext_defined(new_resource.file_spec, new_resource.file_type, new_resource.secontext)
71
+ notifies :relabel, new_resource, :immediate
72
+ end
73
+ end
74
+
75
+ action :addormodify do
76
+ run_action(:add)
77
+ run_action(:modify)
78
+ end
@@ -0,0 +1,81 @@
1
+ include Chef::SELinuxPolicy::Helpers
2
+
3
+ # Support whyrun
4
+ def whyrun_supported?
5
+ true
6
+ end
7
+
8
+ def module_defined(name)
9
+ "/usr/sbin/semodule -l | grep -w '^#{name}'"
10
+ end
11
+
12
+ def shell_boolean(expression)
13
+ expression ? 'true' : 'false'
14
+ end
15
+
16
+ use_inline_resources
17
+
18
+ # Get all the components in the right place
19
+ action :fetch do
20
+ directory new_resource.directory do
21
+ only_if { use_selinux }
22
+ end
23
+
24
+ raise 'dont specify both directory_source and content' if new_resource.directory_source && new_resource.content
25
+
26
+ if new_resource.directory_source # ~FC023
27
+ remote_directory new_resource.directory do
28
+ source new_resource.directory_source
29
+ cookbook new_resource.cookbook
30
+ only_if { use_selinux }
31
+ end
32
+ end
33
+
34
+ if new_resource.content
35
+ file "#{new_resource.directory}/#{new_resource.module_name}.te" do
36
+ content new_resource.content
37
+ only_if { use_selinux }
38
+ end
39
+ end
40
+ end
41
+
42
+ # compile the module
43
+ # XXX allow modifyable path
44
+ action :compile do
45
+ make_command = "/usr/bin/make -f /usr/share/selinux/devel/Makefile #{new_resource.module_name}.pp"
46
+ execute "semodule-compile-#{new_resource.module_name}" do
47
+ command make_command
48
+ not_if "#{make_command} -q", cwd: new_resource.directory # $? = 1 means make wants to execute http://www.gnu.org/software/make/manual/html_node/Running.html
49
+ only_if { use_selinux }
50
+ cwd new_resource.directory
51
+ end
52
+ end
53
+
54
+ # deploy / upgrade module
55
+ # XXX this looks ugly AF because CentOS 6.X doesn't support extracting
56
+ # SELinux modules from the current policy, which I planned on comparing
57
+ # to my compiled file. I'll be happy to see anything else (that works).
58
+ action :install do
59
+ filename = "#{new_resource.directory}/#{new_resource.module_name}.pp"
60
+ execute "semodule-install-#{new_resource.module_name}" do
61
+ command "/usr/sbin/semodule -i #{filename}"
62
+ only_if "#{shell_boolean(new_resource.updated_by_last_action? || new_resource.force)} || ! (#{module_defined(new_resource.module_name)}) "
63
+ only_if { use_selinux }
64
+ end
65
+ end
66
+
67
+ # deploy should do all three, as it used to do
68
+ action :deploy do
69
+ run_action(:fetch)
70
+ run_action(:compile)
71
+ run_action(:install)
72
+ end
73
+
74
+ # remove module
75
+ action :remove do
76
+ execute "semodule-remove-#{new_resource.module_name}" do
77
+ command "/usr/sbin/semodule -r #{new_resource.module_name}"
78
+ only_if module_defined(new_resource.module_name)
79
+ only_if { use_selinux }
80
+ end
81
+ end
@@ -0,0 +1,26 @@
1
+ include Chef::SELinuxPolicy::Helpers
2
+
3
+ # Support whyrun
4
+ def whyrun_supported?
5
+ true
6
+ end
7
+
8
+ use_inline_resources
9
+
10
+ # Create if doesn't exist, do not touch if port is already registered (even under different type)
11
+ action :add do
12
+ execute "selinux-permissive-#{new_resource.name}-add" do
13
+ command "/usr/sbin/semanage permissive -a '#{new_resource.name}'"
14
+ not_if "/usr/sbin/semanage permissive -l | grep '^#{new_resource.name}$'"
15
+ only_if { use_selinux }
16
+ end
17
+ end
18
+
19
+ # Delete if exists
20
+ action :delete do
21
+ execute "selinux-port-#{new_resource.name}-delete" do
22
+ command "/usr/sbin/semanage permissive -d '#{new_resource.name}'"
23
+ not_if "/usr/sbin/semanage permissive -l | grep '^#{new_resource.name}$'"
24
+ only_if { use_selinux }
25
+ end
26
+ end
@@ -0,0 +1,58 @@
1
+ include Chef::SELinuxPolicy::Helpers
2
+
3
+ # Support whyrun
4
+ def whyrun_supported?
5
+ true
6
+ end
7
+
8
+ def port_defined(protocol, port, label = nil)
9
+ base_command = "seinfo --protocol=#{protocol} --portcon=#{port} | awk -F: '$(NF-1) !~ /reserved_port_t$/ {print $(NF-1)}'"
10
+ grep = if label
11
+ "grep -P '#{Regexp.escape(label)}'"
12
+ else
13
+ 'grep -q ^'
14
+ end
15
+ "#{base_command} | #{grep}"
16
+ end
17
+
18
+ def validate_port(port)
19
+ raise ArgumentError, "port value: #{port} is invalid." unless port.to_s =~ /^\d+$/
20
+ end
21
+
22
+ use_inline_resources
23
+
24
+ # Create if doesn't exist, do not touch if port is already registered (even under different type)
25
+ action :add do
26
+ validate_port(new_resource.port)
27
+ execute "selinux-port-#{new_resource.port}-add" do
28
+ command "/usr/sbin/semanage port -a -t #{new_resource.secontext} -p #{new_resource.protocol} #{new_resource.port}"
29
+ not_if port_defined(new_resource.protocol, new_resource.port)
30
+ only_if { use_selinux }
31
+ end
32
+ end
33
+
34
+ # Delete if exists
35
+ action :delete do
36
+ validate_port(new_resource.port)
37
+ execute "selinux-port-#{new_resource.port}-delete" do
38
+ command "/usr/sbin/semanage port -d -p #{new_resource.protocol} #{new_resource.port}"
39
+ only_if port_defined(new_resource.protocol, new_resource.port)
40
+ only_if { use_selinux }
41
+ end
42
+ end
43
+
44
+ action :modify do
45
+ execute "selinux-port-#{new_resource.port}-modify" do
46
+ command "/usr/sbin/semanage port -m -t #{new_resource.secontext} -p #{new_resource.protocol} #{new_resource.port}"
47
+ only_if port_defined(new_resource.protocol, new_resource.port)
48
+ not_if port_defined(new_resource.protocol, new_resource.port, new_resource.secontext)
49
+ only_if { use_selinux }
50
+ end
51
+ end
52
+
53
+ action :addormodify do
54
+ # Try to add new port
55
+ run_action(:add)
56
+ # Try to modify existing port
57
+ run_action(:modify)
58
+ end
@@ -0,0 +1,9 @@
1
+ #
2
+ # Cookbook Name:: selinux_policy
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2014, BackSlasher
6
+ #
7
+ # GPLv2
8
+ #
9
+ # Nothing's here!
@@ -0,0 +1,32 @@
1
+ #
2
+ # Cookbook Name:: selinux_policy
3
+ # Recipe:: install
4
+ #
5
+ # Copyright 2014, BackSlasher
6
+ #
7
+ # GPLv2
8
+ #
9
+ case node['platform_family']
10
+ when 'debian'
11
+ raise 'Install SELinux manually on Ubuntu. See https://wiki.ubuntu.com/SELinux' if node['platform'] == 'ubuntu'
12
+ pkgs = ['policycoreutils', 'selinux-policy-dev', 'setools', 'make']
13
+ when 'rhel'
14
+ case node['platform_version'].to_i
15
+ when 5
16
+ # policycoreutils-python does not exist in RHEL5
17
+ pkgs = ['policycoreutils', 'selinux-policy-devel', 'setools-console', 'make']
18
+ when 6
19
+ # selinux-policy-devel does not exist in RHEL6
20
+ pkgs = ['policycoreutils-python', 'selinux-policy', 'setools-console', 'make']
21
+ when 7
22
+ pkgs = ['policycoreutils-python', 'selinux-policy-devel', 'setools-console', 'make']
23
+ else
24
+ raise 'Unknown version of RHEL/derivative, cannot determine required package names'
25
+ end
26
+ when 'fedora'
27
+ pkgs = ['policycoreutils-python', 'selinux-policy-devel', 'setools-console', 'make']
28
+ else
29
+ raise 'Unknown distro, cannot determine required package names'
30
+ end
31
+
32
+ pkgs.each { |p| package p }
@@ -0,0 +1,8 @@
1
+ # A resource for managing SELinux Booleans
2
+
3
+ actions :set, :setpersist
4
+ default_action :setpersist
5
+
6
+ attribute :name, kind_of: String, name_attribute: true
7
+ attribute :value, kind_of: [TrueClass, FalseClass]
8
+ attribute :force, kind_of: [TrueClass, FalseClass], default: false
@@ -0,0 +1,8 @@
1
+ # Manages file specs in SELinux
2
+ # See http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/index.html#id3715134
3
+
4
+ actions :add, :delete, :modify, :addormodify, :relabel
5
+ default_action :addormodify
6
+ attribute :file_spec, kind_of: String, name_attribute: true
7
+ attribute :secontext, kind_of: String
8
+ attribute :file_type, kind_of: String, default: 'a', equal_to: %w(a f d c b s l p)
@@ -0,0 +1,21 @@
1
+ # A resource for managing SE modules
2
+
3
+ actions :deploy, :fetch, :compile, :install, :remove
4
+ default_action :deploy
5
+
6
+ attribute :module_name, kind_of: String, name_attribute: true
7
+ attribute :force, kind_of: [TrueClass, FalseClass], default: false
8
+
9
+ attribute :directory, kind_of: String, default: nil # content to work with. Defaults to autogenerated name in the Chef cache. Can be provided and pre-populated
10
+ def directory(arg = nil)
11
+ if arg || @directory
12
+ set_or_return(:directory, arg, kind_of: String)
13
+ else
14
+ "#{Chef::Config[:file_cache_path]}/#{module_name}"
15
+ end
16
+ end
17
+
18
+ # Content options:
19
+ attribute :content, kind_of: String, default: nil # provide a 'te' file directly. Optional
20
+ attribute :directory_source, kind_of: String, default: nil # Source directory for module source code. If specified, will use "remote_directory" on the directory specified as `directory`
21
+ attribute :cookbook, kind_of: String, default: nil # Related to directory
@@ -0,0 +1,6 @@
1
+ # a resource for managing selinux permissive contexts
2
+
3
+ actions :add, :delete
4
+ default_action :add
5
+
6
+ attribute :name, kind_of: String, name_attribute: true
@@ -0,0 +1,9 @@
1
+ # Manages a port assignment in SELinux
2
+ # See http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/index.html#id3715134
3
+
4
+ actions :add, :delete, :modify, :addormodify
5
+ default_action :addormodify
6
+
7
+ attribute :port, kind_of: [Integer, String], name_attribute: true
8
+ attribute :protocol, kind_of: String, equal_to: %w(tcp udp)
9
+ attribute :secontext, kind_of: String
@@ -0,0 +1,30 @@
1
+ seven_zip Cookbook CHANGELOG
2
+ ========================
3
+ This file is used to list changes made in each version of the seven_zip cookbook.
4
+
5
+ v2.0.2
6
+ ------
7
+ - Add timeout to extract action on seven\_zip resource and configurable default\_extract_timeout attribute.
8
+
9
+ v2.0.1
10
+ ------
11
+ - [GH Issue 21 - NoMethodError: Undefined method or attribute `kernel' on `node'](https://github.com/daptiv/seven_zip/issues/21).
12
+
13
+ v2.0.0
14
+ ------
15
+ - [Upgrade to 7-Zip 15.14](https://github.com/daptiv/seven_zip/pull/9).
16
+ - [7-Zip now installed to the default MSI location by default](https://github.com/daptiv/seven_zip/pull/11).
17
+ - [7z.exe is located using the Windows registry unless the home attribute is explicitly set](https://github.com/daptiv/seven_zip/pull/10).
18
+ - [7-Zip is only added to the Windows PATH if the syspath attribute is set](https://github.com/daptiv/seven_zip/pull/11).
19
+ - [Installation idempotence check was fixed](https://github.com/daptiv/seven_zip/pull/14), package name was corrected.
20
+ - [TravisCI build added](https://github.com/daptiv/seven_zip/pull/12).
21
+ - [ServerSpec tests added](https://github.com/daptiv/seven_zip/pull/9)
22
+ - [Document Archive LRWP](https://github.com/daptiv/seven_zip/pull/6)
23
+
24
+ v1.0.2
25
+ ------
26
+ - [COOK-3476 - Upgrade to 7-zip 9.22](https://tickets.opscode.com/browse/COOK-3476)
27
+
28
+ 1.0.0
29
+ -----
30
+ - initial release
@@ -0,0 +1,108 @@
1
+ [![Cookbook Version](http://img.shields.io/cookbook/v/seven_zip.svg)](https://supermarket.chef.io/cookbooks/seven_zip)
2
+ [![Build status](https://ci.appveyor.com/api/projects/status/y1lsnlkd2b3q6gfd/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/seven-zip/branch/master)
3
+
4
+ # seven_zip Cookbook
5
+ [7-Zip](http://www.7-zip.org/) is a file archiver with a high compression ratio. This cookbook installs the full 7-zip suite of tools (GUI and CLI). This cookbook replaces the older [7-zip cookbook](https://github.com/sneal/7-zip).
6
+
7
+ # Requirements
8
+ ## Platforms
9
+ - Windows XP
10
+ - Windows Vista
11
+ - Windows 7
12
+ - Windows 8, 8.1
13
+ - Windows 10
14
+ - Windows Server 2003 R2
15
+ - Windows Server 2008 (R1, R2)
16
+ - Windows Server 2012 (R1, R2)
17
+
18
+ ## Chef
19
+ - Chef >= 11.6
20
+
21
+ ## Cookbooks
22
+ - windows
23
+
24
+ # Attributes
25
+ ## Optional
26
+ <table>
27
+ <tr>
28
+ <th>Key</th>
29
+ <th>Type</th>
30
+ <th>Description</th>
31
+ <th>Default</th>
32
+ </tr>
33
+ <tr>
34
+ <td><code>['seven_zip']['home']</code></td>
35
+ <td>String</td>
36
+ <td>7-Zip installation directory.</td>
37
+ <td></td>
38
+ </tr>
39
+ <tr>
40
+ <td><code>['seven_zip']['syspath']</code></td>
41
+ <td>Boolean</td>
42
+ <td>If true, adds 7-zip directory to system PATH environment variable.</td>
43
+ <td></td>
44
+ </tr>
45
+ <tr>
46
+ <td><code>['seven_zip']['default_extract_timeout']</code></td>
47
+ <td>Integer</td>
48
+ <td>The default timeout for an extract operation in seconds. This can be overridden by a resource attribute.</td>
49
+ <td>600</td>
50
+ </tr>
51
+ </table>
52
+
53
+ # Usage
54
+ ## default
55
+
56
+ Add `seven_zip::default` to your run\_list which will download and install 7-zip for the current Windows platform.
57
+
58
+ # Resource/Provider
59
+ ## seven_zip_archive
60
+ Extracts a 7-zip compatible archive (iso, zip, 7z etc) to the specified destination directory.
61
+
62
+ #### Actions
63
+ - `:extract` - Extract a 7-zip compatible archive
64
+
65
+ #### Attribute Parameters
66
+ - `path` - Name attribute. The destination to extract to.
67
+ - `source` - The file path to the archive to extract.
68
+ - `overwrite` - Defaults to false. If true, the destination files will be overwritten.
69
+ - `checksum` - The archive file checksum.
70
+ - `timeout` - The extract action timeout in seconds, defaults to `node['seven_zip']['default_extract_timeout']`.
71
+
72
+ #### Examples
73
+ Extract 7-zip source files to `C:\seven_zip_source`.
74
+
75
+ ```ruby
76
+ seven_zip_archive 'seven_zip_source' do
77
+ path 'C:\seven_zip_source'
78
+ source 'http://www.7-zip.org/a/7z1514-src.7z'
79
+ overwrite true
80
+ checksum '3713aed72728eae8f6649e4803eba0b3676785200c76df6269034c520df4bbd5'
81
+ timeout 30
82
+ end
83
+ ```
84
+
85
+ # Recipes
86
+ ## default
87
+
88
+ Installs 7-zip and adds it to your system PATH.
89
+
90
+ # License & Authors
91
+ - Author:: Seth Chisamore (<schisamo@chef.io>)
92
+ - Author:: Shawn Neal (<sneal@sneal.net>)
93
+
94
+ ```text
95
+ Copyright:: 2011-2016, Chef Software, Inc.
96
+
97
+ Licensed under the Apache License, Version 2.0 (the "License");
98
+ you may not use this file except in compliance with the License.
99
+ You may obtain a copy of the License at
100
+
101
+ http://www.apache.org/licenses/LICENSE-2.0
102
+
103
+ Unless required by applicable law or agreed to in writing, software
104
+ distributed under the License is distributed on an "AS IS" BASIS,
105
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
106
+ See the License for the specific language governing permissions and
107
+ limitations under the License.
108
+ ```
@@ -0,0 +1,31 @@
1
+ #
2
+ # Author:: Seth Chisamore (<schisamo@chef.io>)
3
+ # Cookbook Name:: seven_zip
4
+ # Attribute:: default
5
+ #
6
+ # Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ if node['kernel']['machine'] == 'x86_64'
22
+ default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514-x64.msi'
23
+ default['seven_zip']['checksum'] = 'cefe1a9092d8a6be68468c33910d6206b40e934fb63cab686c5cccf369fbf712'
24
+ default['seven_zip']['package_name'] = '7-Zip 15.14 (x64 edition)'
25
+ else
26
+ default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514.msi'
27
+ default['seven_zip']['checksum'] = 'eaf58e29941d8ca95045946949d75d9b5455fac167df979a7f8e4a6bf2d39680'
28
+ default['seven_zip']['package_name'] = '7-Zip 15.14'
29
+ end
30
+
31
+ default['seven_zip']['default_extract_timeout'] = 600