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,803 @@
1
+ # Windows Cookbook
2
+
3
+ [![Build status](https://ci.appveyor.com/api/projects/status/9x4uepmm1g4rktie/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks/windows/branch/master) [![Cookbook Version](https://img.shields.io/cookbook/v/windows.svg)](https://supermarket.chef.io/cookbooks/windows)
4
+
5
+ Provides a set of Windows-specific resources to aid in the creation of cookbooks/recipes targeting the Windows platform.
6
+
7
+ ## Requirements
8
+
9
+ ### Platforms
10
+
11
+ - Windows 7
12
+ - Windows Server 2008 R2
13
+ - Windows 8, 8.1
14
+ - Windows Server 2012 (R1, R2)
15
+
16
+ ### Chef
17
+
18
+ - Chef 12.6+
19
+
20
+ ## Resources
21
+
22
+ ### windows_auto_run
23
+
24
+ #### Actions
25
+
26
+ - `:create` - Create an item to be run at login
27
+ - `:remove` - Remove an item that was previously setup to run at login
28
+
29
+ #### Properties
30
+
31
+ - `name` - Name attribute. The name of the value to be stored in the registry
32
+ - `program` - The program to be run at login
33
+ - `args` - The arguments for the program
34
+
35
+ #### Examples
36
+
37
+ Run BGInfo at login
38
+
39
+ ```ruby
40
+ windows_auto_run 'BGINFO' do
41
+ program 'C:/Sysinternals/bginfo.exe'
42
+ args '\'C:/Sysinternals/Config.bgi\' /NOLICPROMPT /TIMER:0'
43
+ action :create
44
+ end
45
+ ```
46
+
47
+ ### windows_certificate
48
+
49
+ Installs a certificate into the Windows certificate store from a file, and grants read-only access to the private key for designated accounts. Due to current limitations in WinRM, installing certificated remotely may not work if the operation requires a user profile. Operations on the local machine store should still work.
50
+
51
+ #### Actions
52
+
53
+ - `:create` - creates or updates a certificate.
54
+ - `:delete` - deletes a certificate.
55
+ - `:acl_add` - adds read-only entries to a certificate's private key ACL.
56
+
57
+ #### Properties
58
+
59
+ - `source` - name attribute. The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete).
60
+ - `pfx_password` - the password to access the source if it is a pfx file.
61
+ - `private_key_acl` - array of 'domain\account' entries to be granted read-only access to the certificate's private key. This is not idempotent.
62
+ - `store_name` - the certificate store to manipulate. One of MY (default : personal store), CA (trusted intermediate store) or ROOT (trusted root store).
63
+ - `user_store` - if false (default) then use the local machine store; if true then use the current user's store.
64
+
65
+ #### Examples
66
+
67
+ ```ruby
68
+ # Add PFX cert to local machine personal store and grant accounts read-only access to private key
69
+ windows_certificate "c:/test/mycert.pfx" do
70
+ pfx_password "password"
71
+ private_key_acl ["acme\fred", "pc\jane"]
72
+ end
73
+ ```
74
+
75
+ ```ruby
76
+ # Add cert to trusted intermediate store
77
+ windows_certificate "c:/test/mycert.cer" do
78
+ store_name "CA"
79
+ end
80
+ ```
81
+
82
+ ```ruby
83
+ # Remove all certificates matching the subject
84
+ windows_certificate "me.acme.com" do
85
+ action :delete
86
+ end
87
+ ```
88
+
89
+ ### windows_certificate_binding
90
+
91
+ Binds a certificate to an HTTP port in order to enable TLS communication.
92
+
93
+ #### Actions
94
+
95
+ - `:create` - creates or updates a binding.
96
+ - `:delete` - deletes a binding.
97
+
98
+ #### Properties
99
+
100
+ - `cert_name` - name attribute. The thumbprint(hash) or subject that identifies the certificate to be bound.
101
+ - `name_kind` - indicates the type of cert_name. One of :subject (default) or :hash.
102
+ - `address` - the address to bind against. Default is 0.0.0.0 (all IP addresses).
103
+ - `port` - the port to bind against. Default is 443.
104
+ - `app_id` - the GUID that defines the application that owns the binding. Default is the values used by IIS.
105
+ - `store_name` - the store to locate the certificate in. One of MY (default : personal store), CA (trusted intermediate store) or ROOT (trusted root store).
106
+
107
+ #### Examples
108
+
109
+ ```ruby
110
+ # Bind the first certificate matching the subject to the default TLS port
111
+ windows_certificate_binding "me.acme.com" do
112
+ end
113
+ ```
114
+
115
+ ```ruby
116
+ # Bind a cert from the CA store with the given hash to port 4334
117
+ windows_certificate_binding "me.acme.com" do
118
+ cert_name "d234567890a23f567c901e345bc8901d34567890"
119
+ name_kind :hash
120
+ store_name "CA"
121
+ port 4334
122
+ end
123
+ ```
124
+
125
+ ### windows_feature
126
+
127
+ **BREAKING CHANGE - Version 3.0.0**
128
+
129
+ This resource has been moved from using LWRPs and multiple providers to using Custom Resources. To maintain functionality, you'll need to change `provider` to `install_method`.
130
+
131
+ Windows Roles and Features can be thought of as built-in operating system packages that ship with the OS. A server role is a set of software programs that, when they are installed and properly configured, lets a computer perform a specific function for multiple users or other computers within a network. A Role can have multiple Role Services that provide functionality to the Role. Role services are software programs that provide the functionality of a role. Features are software programs that, although they are not directly parts of roles, can support or augment the functionality of one or more roles, or improve the functionality of the server, regardless of which roles are installed. Collectively we refer to all of these attributes as 'features'.
132
+
133
+ This resource allows you to manage these 'features' in an unattended, idempotent way.
134
+
135
+ There are three methods for the `windows_feature` which map into Microsoft's three major tools for managing roles/features: [Deployment Image Servicing and Management (DISM)](http://msdn.microsoft.com/en-us/library/dd371719%28v=vs.85%29.aspx), [Servermanagercmd](http://technet.microsoft.com/en-us/library/ee344834%28WS.10%29.aspx) (The CLI for Server Manager), and [PowerShell](https://technet.microsoft.com/en-us/library/cc731774(v=ws.11).aspx). As Servermanagercmd is deprecated, Chef will set the default method to `:windows_feature_dism` if `dism.exe` is present on the system being configured. The default method will fall back to `:windows_feature_servermanagercmd`, and then `:windows_feature_powershell`.
136
+
137
+ For more information on Roles, Role Services and Features see the [Microsoft TechNet article on the topic](http://technet.microsoft.com/en-us/library/cc754923.aspx). For a complete list of all features that are available on a node type either of the following commands at a command prompt:
138
+
139
+ For Dism:
140
+
141
+ ```text
142
+ dism /online /Get-Features
143
+ ```
144
+
145
+ For ServerManagerCmd:
146
+
147
+ ```text
148
+ servermanagercmd -query
149
+ ```
150
+
151
+ For PowerShell:
152
+
153
+ ```text
154
+ get-windowsfeature
155
+ ```
156
+
157
+ #### Actions
158
+
159
+ - `:install` - install a Windows role/feature
160
+ - `:remove` - remove a Windows role/feature
161
+ - `:delete` - remove a Windows role/feature from the image (not supported by ServerManagerCmd)
162
+
163
+ #### Properties
164
+
165
+ - `feature_name` - name of the feature/role(s) to install. The same feature may have different names depending on the provider used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS).
166
+ - `all` - Boolean. Optional. Default: false. DISM and Powershell providers only. Forces all dependencies to be installed.
167
+ - `source` - String. Optional. DISM provider only. Uses local repository for feature install.
168
+ - `install_method` - Symbol. Optional. **REPLACEMENT FOR THE PREVIOUS PROVIDER OPTION** If not supplied, Chef will determine which method to use (in the order of `:windows_feature_dism`, `:windows_feature_servercmd`, `:windows_feature_powershell`)
169
+
170
+ #### Examples
171
+
172
+ Install the DHCP Server feature
173
+
174
+ ```ruby
175
+ windows_feature 'DHCPServer' do
176
+ action :install
177
+ end
178
+ ```
179
+
180
+ Install the .Net 3.5.1 feature on Server 2012 using repository files on DVD and install all dependencies
181
+
182
+ ```ruby
183
+ windows_feature "NetFx3" do
184
+ action :install
185
+ all true
186
+ source "d:\sources\sxs"
187
+ end
188
+ ```
189
+
190
+ Remove Telnet Server and Client features
191
+
192
+ ```ruby
193
+ windows_feature ['TelnetServer', 'TelnetClient'] do
194
+ action :remove
195
+ end
196
+ ```
197
+
198
+ Add the SMTP Server feature using the PowerShell provider
199
+
200
+ ```ruby
201
+ windows_feature "smtp-server" do
202
+ action :install
203
+ all true
204
+ install_method :windows_feature_powershell
205
+ end
206
+ ```
207
+
208
+ Install multiple features using one resource with the PowerShell provider
209
+
210
+ ```ruby
211
+ windows_feature ['Web-Asp-Net45', 'Web-Net-Ext45'] do
212
+ action :install
213
+ install_method :windows_feature_powershell
214
+ end
215
+ ```
216
+
217
+ ### windows_font
218
+
219
+ Installs a font.
220
+
221
+ Font files should be included in the cookbooks
222
+
223
+ #### Actions
224
+
225
+ - `:install` - install a font to the system fonts directory.
226
+
227
+ #### Properties
228
+
229
+ - `name` - The file name of the font file name to install. The path defaults to the files/default directory of the cookbook you're calling windows_font from. Defaults to the resource name.
230
+ - `source` - Set an alternate path to the font file.
231
+
232
+ #### Examples
233
+
234
+ ```ruby
235
+ windows_font 'Code New Roman.otf'
236
+ ```
237
+
238
+ ### windows_http_acl
239
+
240
+ Sets the Access Control List for an http URL to grant non-admin accounts permission to open HTTP endpoints.
241
+
242
+ #### Actions
243
+
244
+ - `:create` - creates or updates the ACL for a URL.
245
+ - `:delete` - deletes the ACL from a URL.
246
+
247
+ #### Properties
248
+
249
+ - `url` - the name of the url to be created/deleted.
250
+ - `sddl` - the DACL string configuring all permissions to URL. Mandatory for create if user is not provided. Can't be use with `user`.
251
+ - `user` - the name (domain\user) of the user or group to be granted permission to the URL. Mandatory for create if sddl is not provided. Can't be use with `sddl`. Only one user or group can be granted permission so this replaces any previously defined entry.
252
+
253
+ #### Examples
254
+
255
+ ```ruby
256
+ windows_http_acl 'http://+:50051/' do
257
+ user 'pc\\fred'
258
+ end
259
+ ```
260
+
261
+ ```ruby
262
+ # Grant access to users "NT SERVICE\WinRM" and "NT SERVICE\Wecsvc" via sddl
263
+ windows_http_acl 'http://+:5985/' do
264
+ sddl 'D:(A;;GX;;;S-1-5-80-569256582-2953403351-2909559716-1301513147-412116970)(A;;GX;;;S-1-5-80-4059739203-877974739-1245631912-527174227-2996563517)'
265
+ end
266
+ ```
267
+
268
+ ```ruby
269
+ windows_http_acl 'http://+:50051/' do
270
+ action :delete
271
+ end
272
+ ```
273
+
274
+ ### windows_pagefile
275
+
276
+ Configures the file that provides virtual memory for applications requiring more memory than available RAM or that are paged out to free up memory in use.
277
+
278
+
279
+ #### Actions
280
+
281
+ - `:set` - configures the default pagefile, creating if it doesn't exist.
282
+ - `:delete` - deletes the specified pagefile.
283
+
284
+ #### Properties
285
+
286
+ - `name` - the path to the pagefile, String, name_property: true
287
+ - `system_managed` - configures whether the system manages the pagefile size. [true, false]
288
+ - `automatic_managed` - all of the settings are managed by the system. If this is set to true, other settings will be ignored. [true, false], default: false
289
+ - `initial_size` - initial size of the pagefile in bytes. Integer
290
+ - `maximum_size` - maximum size of the pagefile in bytes. Integer
291
+
292
+ ### windows_printer_port
293
+
294
+ Create and delete TCP/IPv4 printer ports.
295
+
296
+ #### Actions
297
+
298
+ - `:create` - Create a TCIP/IPv4 printer port. This is the default action.
299
+ - `:delete` - Delete a TCIP/IPv4 printer port
300
+
301
+ #### Properties
302
+
303
+ - `ipv4_address` - Name attribute. Required. IPv4 address, e.g. '10.0.24.34'
304
+ - `port_name` - Port name. Optional. Defaults to 'IP_' + `ipv4_address`
305
+ - `port_number` - Port number. Optional. Defaults to 9100.
306
+ - `port_description` - Port description. Optional.
307
+ - `snmp_enabled` - Boolean. Optional. Defaults to false.
308
+ - `port_protocol` - Port protocol, 1 (RAW), or 2 (LPR). Optional. Defaults to 1.
309
+
310
+ #### Examples
311
+
312
+ Create a TCP/IP printer port named 'IP_10.4.64.37' with all defaults
313
+
314
+ ```ruby
315
+ windows_printer_port '10.4.64.37' do
316
+ action :create
317
+ end
318
+ ```
319
+
320
+ Delete a printer port
321
+
322
+ ```ruby
323
+ windows_printer_port '10.4.64.37' do
324
+ action :delete
325
+ end
326
+ ```
327
+
328
+ Delete a port with a custom port_name
329
+
330
+ ```ruby
331
+ windows_printer_port '10.4.64.38' do
332
+ port_name 'My awesome port'
333
+ action :delete
334
+ end
335
+ ```
336
+
337
+ Create a port with more options
338
+
339
+ ```ruby
340
+ windows_printer_port '10.4.64.39' do
341
+ port_name 'My awesome port'
342
+ snmp_enabled true
343
+ port_protocol 2
344
+ end
345
+ ```
346
+
347
+ ### windows_printer
348
+
349
+ Create Windows printer. Note that this doesn't currently install a printer driver. You must already have the driver installed on the system.
350
+
351
+ The Windows Printer LWRP will automatically create a TCP/IP printer port for you using the `ipv4_address` property. If you want more granular control over the printer port, just create it using the `windows_printer_port` LWRP before creating the printer.
352
+
353
+ #### Actions
354
+
355
+ - `:create` - Create a new printer
356
+ - `:delete` - Delete a new printer
357
+
358
+ #### Properties
359
+
360
+ - `device_id` - Name attribute. Required. Printer queue name, e.g. 'HP LJ 5200 in fifth floor copy room'
361
+ - `comment` - Optional string describing the printer queue.
362
+ - `default` - Boolean. Optional. Defaults to false. Note that Windows sets the first printer defined to the default printer regardless of this setting.
363
+ - `driver_name` - String. Required. Exact name of printer driver. Note that the printer driver must already be installed on the node.
364
+ - `location` - Printer location, e.g. 'Fifth floor copy room', or 'US/NYC/Floor42/Room4207'
365
+ - `shared` - Boolean. Defaults to false.
366
+ - `share_name` - Printer share name.
367
+ - `ipv4_address` - Printer IPv4 address, e.g. '10.4.64.23'. You don't have to be able to ping the IP address to set it. Required.
368
+
369
+ An error of "Set-WmiInstance : Generic failure" is most likely due to the printer driver name not matching or not being installed.
370
+
371
+ #### Examples
372
+
373
+ Create a printer
374
+
375
+ ```ruby
376
+ windows_printer 'HP LaserJet 5th Floor' do
377
+ driver_name 'HP LaserJet 4100 Series PCL6'
378
+ ipv4_address '10.4.64.38'
379
+ end
380
+ ```
381
+
382
+ Delete a printer. Note: this doesn't delete the associated printer port. See `windows_printer_port` above for how to delete the port.
383
+
384
+ ```ruby
385
+ windows_printer 'HP LaserJet 5th Floor' do
386
+ action :delete
387
+ end
388
+ ```
389
+
390
+ ### windows_share
391
+
392
+ Creates, modifies and removes Windows shares. All properties are idempotent.
393
+
394
+ #### Actions
395
+
396
+ - :create: creates/modifies a share
397
+ - :delete: deletes a share
398
+
399
+ #### Properties
400
+
401
+ - share_name: name attribute, the share name.
402
+ - path: path to the directory to be shared. Required when creating. If the share already exists on a different path then it is deleted and re-created.
403
+ - description: description to be applied to the share
404
+ - full_users: array of users which should have "Full control" permissions
405
+ - change_users: array of users which should have "Change" permissions
406
+ - read_users: array of users which should have "Read" permissions
407
+
408
+ #### Examples
409
+
410
+ ```ruby
411
+ windows_share "foo" do
412
+ action :create
413
+ path "C:\\foo"
414
+ full_users ["DOMAIN_A\\some_user", "DOMAIN_B\\some_other_user"]
415
+ read_users ["DOMAIN_C\\Domain users"]
416
+ end
417
+ ```
418
+
419
+ ```ruby
420
+ windows_share "foo" do
421
+ action :delete
422
+ end
423
+ ```
424
+
425
+ ### windows_shortcut
426
+
427
+ Creates and modifies Windows shortcuts.
428
+
429
+ #### Actions
430
+
431
+ - `:create` - create or modify a windows shortcut
432
+
433
+ #### Properties
434
+
435
+ - `name` - name attribute. The shortcut to create/modify.
436
+ - `target` - what the shortcut links to
437
+ - `arguments` - arguments to pass to the target when the shortcut is executed
438
+ - `description` - description of the shortcut
439
+ - `cwd` - Working directory to use when the target is executed
440
+ - `iconlocation` - Icon to use, in the format of `"path, index"` where index is which icon in that file to use (See [WshShortcut.IconLocation](https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx))
441
+
442
+ #### Examples
443
+
444
+ Add a shortcut all users desktop:
445
+
446
+ ```ruby
447
+ require 'win32ole'
448
+ all_users_desktop = WIN32OLE.new("WScript.Shell").SpecialFolders("AllUsersDesktop")
449
+
450
+ windows_shortcut "#{all_users_desktop}/Notepad.lnk" do
451
+ target "C:\\WINDOWS\\notepad.exe"
452
+ description "Launch Notepad"
453
+ iconlocation "C:\\windows\\notepad.exe, 0"
454
+ end
455
+ ```
456
+
457
+ #### Library Methods
458
+
459
+ ```ruby
460
+ Registry.value_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','BGINFO')
461
+ Registry.key_exists?('HKLM\SOFTWARE\Microsoft')
462
+ BgInfo = Registry.get_value('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','BGINFO')
463
+ ```
464
+
465
+ ### windows_path
466
+
467
+ #### Actions
468
+
469
+ - `:add` - Add an item to the system path
470
+ - `:remove` - Remove an item from the system path
471
+
472
+ #### Properties
473
+
474
+ - `path` - Name attribute. The name of the value to add to the system path
475
+
476
+ #### Examples
477
+
478
+ Add Sysinternals to the system path
479
+
480
+ ```ruby
481
+ windows_path 'C:\Sysinternals' do
482
+ action :add
483
+ end
484
+ ```
485
+
486
+ Remove 7-Zip from the system path
487
+
488
+ ```ruby
489
+ windows_path 'C:\7-Zip' do
490
+ action :remove
491
+ end
492
+ ```
493
+
494
+ ### windows_task
495
+
496
+ Creates, deletes or runs a Windows scheduled task. Requires Windows Server 2008 due to API usage.
497
+
498
+ #### Actions
499
+
500
+ - `:create` - creates a task (or updates existing if user or command has changed)
501
+ - `:delete` - deletes a task
502
+ - `:run` - runs a task
503
+ - `:end` - ends a task
504
+ - `:change` - changes the un/pw or command of a task
505
+ - `:enable` - enable a task
506
+ - `:disable` - disable a task
507
+
508
+ #### Properties
509
+
510
+ - `task_name` - name attribute, The task name. ("Task Name" or "/Task Name")
511
+ - `force` - When used with create, will update the task.
512
+ - `command` - The command the task will run.
513
+ - `cwd` - The directory the task will be run from.
514
+ - `user` - The user to run the task as. (defaults to 'SYSTEM')
515
+ - `password` - The user's password. (requires user)
516
+ - `run_level` - Run with `:limited` or `:highest` privileges.
517
+ - `frequency` - Frequency with which to run the task. (default is :hourly. Other valid values include :minute, :hourly, :daily, :weekly, :monthly, :once, :on_logon, :onstart, :on_idle) :once requires start_time
518
+ - `frequency_modifier` - Multiple for frequency. (15 minutes, 2 days). Monthly tasks may also use these values": ('FIRST', 'SECOND', 'THIRD', 'FOURTH', 'LAST', 'LASTDAY')
519
+ - `start_day` - Specifies the first date on which the task runs. Optional string (MM/DD/YYYY)
520
+ - `start_time` - Specifies the start time to run the task. Optional string (HH:mm)
521
+ - `interactive_enabled` - (Allow task to run interactively or non-interactively. Requires user and password.)
522
+ - `day` - For monthly or weekly tasks, the day(s) on which the task runs. (MON - SUN, *, 1 - 31)
523
+ - `months` - The Months of the year on which the task runs. (JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, *). Multiple months should be comma delimited.
524
+ - `idle_time` - For :on_idle frequency, the time (in minutes) without user activity that must pass to trigger the task. (1 - 999)
525
+
526
+ #### Examples
527
+
528
+ Create a `chef-client` task with TaskPath `\` running every 15 minutes
529
+
530
+ ```ruby
531
+ windows_task 'chef-client' do
532
+ user 'Administrator'
533
+ password '$ecR3t'
534
+ cwd 'C:\\chef\\bin'
535
+ command 'chef-client -L C:\\tmp\\'
536
+ run_level :highest
537
+ frequency :minute
538
+ frequency_modifier 15
539
+ end
540
+ ```
541
+
542
+ Update `chef-client` task with new password and log location
543
+
544
+ ```ruby
545
+ windows_task 'chef-client' do
546
+ user 'Administrator'
547
+ password 'N3wPassW0Rd'
548
+ cwd 'C:\\chef\\bin'
549
+ command 'chef-client -L C:\\chef\\logs\\'
550
+ action :change
551
+ end
552
+ ```
553
+
554
+ Delete a task named `old task`
555
+
556
+ ```ruby
557
+ windows_task 'old task' do
558
+ action :delete
559
+ end
560
+ ```
561
+
562
+ Enable a task named `chef-client`
563
+
564
+ ```ruby
565
+ windows_task 'chef-client' do
566
+ action :enable
567
+ end
568
+ ```
569
+
570
+ Disable a task named `ProgramDataUpdater` with TaskPath `\Microsoft\Windows\Application Experience\`
571
+
572
+ ```ruby
573
+ windows_task '\Microsoft\Windows\Application Experience\ProgramDataUpdater' do
574
+ action :disable
575
+ end
576
+ ```
577
+
578
+ ### windows_zipfile
579
+
580
+ Most version of Windows do not ship with native cli utility for managing compressed files. This resource provides a pure-ruby implementation for managing zip files. Be sure to use the `not_if` or `only_if` meta parameters to guard the resource for idempotence or action will be taken every Chef run.
581
+
582
+ #### Actions
583
+
584
+ - `:unzip` - unzip a compressed file
585
+ - `:zip` - zip a directory (recursively)
586
+
587
+ #### Properties
588
+
589
+ - `path` - name attribute. The path where files will be (un)zipped to.
590
+ - `source` - source of the zip file (either a URI or local path) for :unzip, or directory to be zipped for :zip.
591
+ - `overwrite` - force an overwrite of the files if they already exist.
592
+ - `checksum` - for :unzip, useful if source is remote, if the local file matches the SHA-256 checksum, Chef will not download it.
593
+
594
+ #### Examples
595
+
596
+ Unzip a remote zip file locally
597
+
598
+ ```ruby
599
+ windows_zipfile 'c:/bin' do
600
+ source 'http://download.sysinternals.com/Files/SysinternalsSuite.zip'
601
+ action :unzip
602
+ not_if {::File.exists?('c:/bin/PsExec.exe')}
603
+ end
604
+ ```
605
+
606
+ Unzip a local zipfile
607
+
608
+ ```ruby
609
+ windows_zipfile 'c:/the_codez' do
610
+ source 'c:/foo/baz/the_codez.zip'
611
+ action :unzip
612
+ end
613
+ ```
614
+
615
+ Create a local zipfile
616
+
617
+ ```ruby
618
+ windows_zipfile 'c:/foo/baz/the_codez.zip' do
619
+ source 'c:/the_codez'
620
+ action :zip
621
+ end
622
+ ```
623
+
624
+ ## Libraries
625
+
626
+ ### WindowsHelper
627
+
628
+ Helper that allows you to use helpful functions in windows
629
+
630
+ #### installed_packages
631
+
632
+ Returns a hash of all DisplayNames installed
633
+
634
+ ```ruby
635
+ # usage in a recipe
636
+ ::Chef::Recipe.send(:include, Windows::Helper)
637
+ hash_of_installed_packages = installed_packages
638
+ ```
639
+
640
+ #### is_package_installed?
641
+
642
+ - `package_name` - The name of the package you want to query to see if it is installed
643
+ - `returns` - true if the package is installed, false if it the package is not installed
644
+
645
+ Download a file if a package isn't installed
646
+
647
+ ```ruby
648
+ # usage in a recipe to not download a file if package is already installed
649
+ ::Chef::Recipe.send(:include, Windows::Helper)
650
+ is_win_sdk_installed = is_package_installed?('Windows Software Development Kit')
651
+
652
+ remote_file 'C:\windows\temp\windows_sdk.zip' do
653
+ source 'http://url_to_download/windows_sdk.zip'
654
+ action :create_if_missing
655
+ not_if {is_win_sdk_installed}
656
+ end
657
+ ```
658
+
659
+ Do something if a package is installed
660
+
661
+ ```ruby
662
+ # usage in a provider
663
+ include Windows::Helper
664
+ if is_package_installed?('Windows Software Development Kit')
665
+ # do something if package is installed
666
+ end
667
+ ```
668
+
669
+ ### Windows::VersionHelper
670
+
671
+ Helper that allows you to get information of the windows version running on your node. It leverages windows ohai from kernel.os_info, easy to mock and to use even on linux.
672
+
673
+ #### core_version?
674
+
675
+ Determines whether given node is running on a windows Core.
676
+
677
+ ```ruby
678
+ if ::Windows::VersionHelper.core_version? node
679
+ fail 'Windows Core is not supported'
680
+ end
681
+ ```
682
+
683
+ #### workstation_version?
684
+
685
+ Determines whether given node is a windows workstation version (XP, Vista, 7, 8, 8.1, 10)
686
+
687
+ ```ruby
688
+ if ::Windows::VersionHelper.workstation_version? node
689
+ fail 'Only server version of windows are supported'
690
+ end
691
+ ```
692
+
693
+ #### server_version?
694
+
695
+ Determines whether given node is a windows server version (Server 2003, Server 2008, Server 2012, Server 2016)
696
+
697
+ ```ruby
698
+ if ::Windows::VersionHelper.server_version? node
699
+ puts 'Server version of windows are cool'
700
+ end
701
+ ```
702
+
703
+ #### nt_version
704
+
705
+ Determines NT version of the given node
706
+
707
+ ```ruby
708
+ case ::Windows::VersionHelper.nt_version node
709
+ when '6.0' then 'Windows vista or Server 2008'
710
+ when '6.1' then 'Windows 7 or Server 2008R2'
711
+ when '6.2' then 'Windows 8 or Server 2012'
712
+ when '6.3' then 'Windows 8.1 or Server 2012R2'
713
+ when '10.0' then 'Windows 10'
714
+ end
715
+ ```
716
+
717
+ ## Windows ChefSpec Matchers
718
+
719
+ The Windows cookbook includes custom [ChefSpec](https://github.com/sethvargo/chefspec) matchers you can use to test your own cookbooks that consume Windows cookbook LWRPs.
720
+
721
+ ### Example Matcher Usage
722
+
723
+ ```ruby
724
+ expect(chef_run).to install_windows_package('Node.js').with(
725
+ source: 'http://nodejs.org/dist/v0.10.26/x64/node-v0.10.26-x64.msi')
726
+ ```
727
+
728
+ ### Windows Cookbook Matchers
729
+
730
+ - create_windows_auto_run
731
+ - remove_windows_auto_run
732
+ - create_windows_certificate
733
+ - delete_windows_certificate
734
+ - add_acl_to_windows_certificate
735
+ - create_windows_certificate_binding
736
+ - delete_windows_certificate_binding
737
+ - install_windows_feature
738
+ - install_windows_feature_dism
739
+ - install_windows_feature_servermanagercmd
740
+ - install_windows_feature_powershell
741
+ - remove_windows_feature
742
+ - remove_windows_feature_dism
743
+ - remove_windows_feature_servermanagercmd
744
+ - remove_windows_feature_powershell
745
+ - delete_windows_feature
746
+ - delete_windows_feature_dism
747
+ - delete_windows_feature_powershell
748
+ - install_windows_font
749
+ - create_windows_http_acl
750
+ - delete_windows_http_acl
751
+ - install_windows_package
752
+ - remove_windows_package
753
+ - set_windows_pagefile
754
+ - add_windows_path
755
+ - remove_windows_path
756
+ - create_windows_printer
757
+ - delete_windows_printer
758
+ - create_windows_printer_port
759
+ - delete_windows_printer_port
760
+ - create_windows_shortcut
761
+ - create_windows_shortcut
762
+ - create_windows_task
763
+ - disable_windows_task
764
+ - enable_windows_task
765
+ - delete_windows_task
766
+ - run_windows_task
767
+ - change_windows_task
768
+ - unzip_windows_zipfile_to
769
+ - zip_windows_zipfile_to
770
+
771
+ ## Usage
772
+
773
+ Place an explicit dependency on this cookbook (using depends in the cookbook's metadata.rb) from any cookbook where you would like to use the Windows-specific resources/providers that ship with this cookbook.
774
+
775
+ ```ruby
776
+ depends 'windows'
777
+ ```
778
+
779
+ ## License & Authors
780
+
781
+ - Author:: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io))
782
+ - Author:: Doug MacEachern ([dougm@vmware.com](mailto:dougm@vmware.com))
783
+ - Author:: Paul Morton ([pmorton@biaprotect.com](mailto:pmorton@biaprotect.com))
784
+ - Author:: Doug Ireton ([doug.ireton@nordstrom.com](mailto:doug.ireton@nordstrom.com))
785
+
786
+ ```text
787
+ Copyright 2011-2016, Chef Software, Inc.
788
+ Copyright 2010, VMware, Inc.
789
+ Copyright 2011, Business Intelligence Associates, Inc
790
+ Copyright 2012, Nordstrom, Inc.
791
+
792
+ Licensed under the Apache License, Version 2.0 (the "License");
793
+ you may not use this file except in compliance with the License.
794
+ You may obtain a copy of the License at
795
+
796
+ http://www.apache.org/licenses/LICENSE-2.0
797
+
798
+ Unless required by applicable law or agreed to in writing, software
799
+ distributed under the License is distributed on an "AS IS" BASIS,
800
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
801
+ See the License for the specific language governing permissions and
802
+ limitations under the License.
803
+ ```