From d52ae8ff3667c693b643da5619b9c46f2e9019d1 Mon Sep 17 00:00:00 2001 From: Tara Baskara Date: Tue, 13 Aug 2019 11:06:44 +0700 Subject: [PATCH 1/4] add nginx reload Co-authored-by: fadlinurhasan --- recipes/default.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/default.rb b/recipes/default.rb index 084d21e..af9ba80 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -34,6 +34,7 @@ kibana_port: node['kibana']['config']['port'], base_path: node['kibana']['config']['server.basePath'] ) + notifies :reload, 'service[nginx]' end %w[sites-enabled sites-available conf.d].each do |conf_dir| From 73f04bc24d90a79808ba0814997ac14a968c8503 Mon Sep 17 00:00:00 2001 From: Tara Baskara Date: Tue, 13 Aug 2019 11:07:33 +0700 Subject: [PATCH 2/4] add auto accept chef client and driver config for kitchen Co-authored-by: fadlinurhasan --- .kitchen.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index caea738..b2577d7 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -9,6 +9,9 @@ provisioner: # For example: # always_update_cookbooks: <%= !ENV['CI'] %> always_update_cookbooks: true + client_rb: + environment: _default + chef_license: accept verifier: name: inspec @@ -25,6 +28,11 @@ suites: - name: default run_list: - recipe[kibana_wrapper_cookbook::default] + driver_config: + customize: + memory: 1024 + network: + - ['private_network', {ip: '192.168.33.10'}] verifier: inspec_tests: - test/integration/default From ec576aa3edda8a210984a3b281c0e708ec707f1a Mon Sep 17 00:00:00 2001 From: Tara Baskara Date: Tue, 13 Aug 2019 11:08:03 +0700 Subject: [PATCH 3/4] bump version Co-authored-by: fadlinurhasan --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 5c7b44e..6547d9b 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'Apache-2.0' description 'Installs/Configures Kibana' long_description 'Installs/Configures Kibana' -version '6.3.0' +version '6.3.1' supports 'ubuntu' chef_version '>= 14.1.1' if respond_to?(:chef_version) From 45bfd3c7347a4691f000803dd92882b015cdb493 Mon Sep 17 00:00:00 2001 From: Tara Baskara Date: Tue, 13 Aug 2019 11:15:03 +0700 Subject: [PATCH 4/4] update cookbook Co-authored-by: fadlinurhasan --- cookbooks/kibana5/README.md | 2 +- cookbooks/kibana5/attributes/default.rb | 2 +- cookbooks/kibana5/libraries/helpers.rb | 130 +++++-- cookbooks/kibana5/metadata.json | 19 +- cookbooks/kibana5/metadata.rb | 2 +- cookbooks/kibana_wrapper_cookbook/README.md | 23 +- .../kibana_wrapper_cookbook/metadata.json | 5 +- cookbooks/kibana_wrapper_cookbook/metadata.rb | 2 +- .../recipes/default.rb | 1 + cookbooks/seven_zip/appveyor.yml | 4 +- cookbooks/seven_zip/metadata.json | 2 +- cookbooks/seven_zip/metadata.rb | 2 +- cookbooks/seven_zip/providers/archive.rb | 11 +- cookbooks/windows/CHANGELOG.md | 19 + cookbooks/windows/README.md | 342 +----------------- cookbooks/windows/libraries/version.rb | 19 - cookbooks/windows/libraries/windows_helper.rb | 15 +- cookbooks/windows/metadata.json | 2 +- cookbooks/windows/metadata.rb | 4 +- 19 files changed, 174 insertions(+), 432 deletions(-) diff --git a/cookbooks/kibana5/README.md b/cookbooks/kibana5/README.md index 9345fff..d69e6d0 100644 --- a/cookbooks/kibana5/README.md +++ b/cookbooks/kibana5/README.md @@ -31,7 +31,7 @@ This resource installs Kibana 5 binaries. |Attribute|Description|Type|Default| |---------|-----------|----|-------| |`name`| Simply name. Currently not used. |String|| -|`version`| Version of Kibana. 5.2.0 and above are supported. |String|`5.6.11`| +|`version`| Version of Kibana. 5.2.0 and above are supported. |String|`5.6.16`| |`install_method`| Installation method. Currently only `release` is supported. This means installation from official binaries provided by Elastic. |String|`release`| |`base_dir`| Base directory for Kibana binaries. |String|`/opt/kibana`| |`svc_user`| Kibana daemon user. |String|`kibana`| diff --git a/cookbooks/kibana5/attributes/default.rb b/cookbooks/kibana5/attributes/default.rb index 6c3ac4a..bfb1662 100644 --- a/cookbooks/kibana5/attributes/default.rb +++ b/cookbooks/kibana5/attributes/default.rb @@ -20,7 +20,7 @@ default['kibana5']['url'] = nil default['kibana5']['checksum'] = nil -default['kibana5']['version'] = '5.6.11' +default['kibana5']['version'] = '5.6.16' default['kibana5']['distribution_base_url'] = 'https://artifacts.elastic.co/downloads/kibana' default['kibana5']['service_user'] = 'kibana' default['kibana5']['service_group'] = 'kibana' diff --git a/cookbooks/kibana5/libraries/helpers.rb b/cookbooks/kibana5/libraries/helpers.rb index 12f659d..517d51a 100644 --- a/cookbooks/kibana5/libraries/helpers.rb +++ b/cookbooks/kibana5/libraries/helpers.rb @@ -58,66 +58,100 @@ def kibana_arch # Returns SHA256 checksum map for Kibana artifacts def kibana_checksum_map { + '6.8.0' => { + 'darwin' => { + 'x86_64' => { + 'checksum' => 'e19aa9fba9384ca91381c5d5f2d312b72a6f7100e56e143db771b6c3608edde2', + }, + }, + 'release' => { + 'x86_64' => { + 'checksum' => '6f4d7323a12f3dd2078c0289e334dbd0bc9659da315b8a2ec91fcfd5efd20776', + }, + }, + 'windows' => { + 'x86_64' => { + 'checksum' => '5cfb592b9231c77ad2e2f46b703d86f191c53ae1c46bbce6c860dcbb4cfb2982', + }, + }, + }, + '6.7.0' => { + 'release' => { + 'x86_64' => { + 'checksum' => '5e88dadbedef9be6c388999210c80eb3c04e453fe4c9c02662e15efb40d3b40e', + }, + }, + 'windows' => { + 'x86_64' => { + 'checksum' => 'a725274b54a613c7f64b6ba050cbcb571bb52a8911845923677836373ea82cab', + }, + }, + 'darwin' => { + 'x86_64' => { + 'checksum' => 'bb500fd706c51fae5375c531ea1338f2836d584582932965b7e6b0a99a9c41e3', + }, + }, + }, '6.6.2' => { 'release' => { 'x86_64' => { - 'checksum' => '9a4026f3bccec93130e4b0c6c61d1a23f64302f2389572523df84696f6be0cb3', + 'checksum' => '45b32f6053c683bf8ba2cb0841c1ee705e524586a2aa3547afcca629fea0a6b0', }, }, 'windows' => { 'x86_64' => { - 'checksum' => 'a061e4815eaa4880612bab89b99110790af09f6612f1134dff706f2be27c3546', + 'checksum' => '5e15d1c4e183fe22fe47d86dec3c068c6a46ec46cb37d44cd5e1ccceac991a2f', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => '55008c3c0d458810d24def654f2f76b3b60d8138a014d5bbdb00c2ab60912f76', + 'checksum' => '4109dc969d572b87dd05ef95e32ba0afddedb250c150d46e2b428ec4a4431822', }, }, }, '6.6.1' => { 'release' => { 'x86_64' => { - 'checksum' => '843026137f4499df0da7911c67b3342d5cf175fb3b047e18d536bc6533a1c987', + 'checksum' => '9a29eae0edf71450dc4a5d1e30dec9afe64f75d95d26572e208dad3adc36f975', }, }, 'windows' => { 'x86_64' => { - 'checksum' => '2a2773bf1b93541f83dcd15564f30730ca5aa5980323c590dfafb75f08a69f2d', + 'checksum' => '24b2467b512eb4197eec9a170c0eb59e5e6c6dec776bcad6a4f1c8de7e7db4ab', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => '7f9a2512419e5763ed79d92578d89544d8858c7d71ec3b2fd980043086ae8ce7', + 'checksum' => '85724d4fec3cd6cf79b78182296568f822b7726acaba61d31556c86c8c4f7080', }, }, }, '6.6.0' => { 'release' => { 'x86_64' => { - 'checksum' => '39921f2ee5992792d16c899e08e06459bd6cc4bd76d4ec1c3aa715dab323bd62', + 'checksum' => '8b3cc99e6e6d5f5559fd858b43befb16cf65994375b4e904ec3a702aba947865', }, }, 'windows' => { 'x86_64' => { - 'checksum' => 'd180ff3aa2147436b8511f9852abda19b044aea9abe8780c7d328bad28a06500', + 'checksum' => '82150be20d6a7a149e8f12439f0751e9a93d8ccd60dcdfdcd6576f484baedfcf', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => 'f408c1929424896fd7db45bd70437eff95e6fe44c782d48dfdfb971def1f0f51', + 'checksum' => '924a087119915c9c355e6c212d704586a9d063c25eae17dea6988311f3bce336', }, }, }, '6.5.4' => { 'release' => { 'x86_64' => { - 'checksum' => '18941a55dfe388f8f082fda74cf73a465b519d2cb9dcf4f0bdb5d413870fcab1', + 'checksum' => '7a511725bb43f136037c3ca12b2a379497745f81f6af9b75486f7f5f3a3a9653', }, }, 'windows' => { 'x86_64' => { - 'checksum' => '98c54c3d81f1feda786f07e7f1c5cd906603b7b7c9fb7111601b3a4e56f301d7', + 'checksum' => 'da990f86478021c8ca79643b5d0cadfef6066ebb3c5efe70866b71571c2bf6a2', }, }, 'darwin' => { @@ -129,85 +163,85 @@ def kibana_checksum_map '6.5.3' => { 'release' => { 'x86_64' => { - 'checksum' => '31f2c8d2558ddc25575b400f705d2da80942cd3b721f688500066ad1b785b325', + 'checksum' => '4a424a677798592455703239a15e474baecd400e940886c74e402ae9940f7720', }, }, 'windows' => { 'x86_64' => { - 'checksum' => 'c6b61117db725be9c949680935eecd0c7ff107211e09e552fb98e47511256d58', + 'checksum' => '18dfa7ee6893776ea1f07a07859eb03476dc381fea41aa92fc950e493a651e91', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => '1d1400f5b9d942c4366c77d9c30b6acfdf9ea62d7bbad35abf9627b1610548c4', + 'checksum' => '34439306069aaed252fdbbf70e7299875a61d352656202438ebb725196a92ad8', }, }, }, '6.5.2' => { 'release' => { 'x86_64' => { - 'checksum' => '8ccf7024c8e382062c0da6202e3ba35cb184cb0e77ff35367680cba55b508e68', + 'checksum' => 'aa17ec706aab6e419b65333d25054d3a99749938fdb9399572f3eb9e7d6d00cd', }, }, 'windows' => { 'x86_64' => { - 'checksum' => '0f7ef47797c7500aaacdf0929c783cd79d70ce5ba30260ff502c3a1322b3aa60', + 'checksum' => '69b2fc980bc3ae741222f103c797ee8df2d2f4d900386db580ee9f47d74070c1', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => '23034aca235f778b89c185f6990e78dc4977ebe6a922308ca76d7236edcdba8d', + 'checksum' => '01fcd50304705fd5d6919b24e202757b6d07d11278092e2c6a6bef21582234e7', }, }, }, '6.5.1' => { 'release' => { 'x86_64' => { - 'checksum' => 'a378fcc78ec57bd6d9bb5ac34f594e2b7f1ece61c0657530020e206a8b12d9c1', + 'checksum' => 'bbbcb59cc3f5e9b8e4dd747c72437360b101ae6d29f1e6df40fb2b39e4223752', }, }, 'windows' => { 'x86_64' => { - 'checksum' => 'c958d8e0b34d90df71f1a5e938243e72c92ec14af07728b20b2d0d42dd271520', + 'checksum' => '36cf357c683ef00e95811a70fd4b433fb5a8a9d85f1fe6b783cdeeae9fb70559', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => 'cd3e3b70bc86738373d47c400c59c354732adb412915793a58bfe58132175c5a', + 'checksum' => 'a3729b5579b19dbbc1fa2c9deb1de9566ae2eb07dc64efd8857271f614b64d42', }, }, }, '6.5.0' => { 'release' => { 'x86_64' => { - 'checksum' => 'ffd028bc67c632e266a9ac5e3d4ff0eebd0f5c50e0d2d98ccf86f40b833eed4f', + 'checksum' => '9fc9edd5730843f6622bb845ac4edda7f48e8d38dc78cda154d453925a2c1e0d', }, }, 'windows' => { 'x86_64' => { - 'checksum' => 'ca9dae66c6911896858b7361c7cd1401053eb2e7a86e6478b63151f269d19206', + 'checksum' => 'b1357d5e9b81b386ceea6f05d5a0104d36051f816b4fa20cdea7d07b004d66f6', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => 'e4419bd7381ee237246b792ab18d2c1c15c3474b35e16048265b31071ae6d706', + 'checksum' => '6d98807f681acd240d464144405a6ca19a8cc6ee680afe5e5cb20745e1b9130b', }, }, }, '6.4.3' => { 'release' => { 'x86_64' => { - 'checksum' => '18e28dafd3e1cf0343a6eab38abb750a82fa312169414291d488831df88233f5', + 'checksum' => '5f1fe4f464bbfeccbd79c620ad728c1537b6f92af54b31e9cc7c4e86adce4c2c', }, }, 'windows' => { 'x86_64' => { - 'checksum' => '8fc20bc7176faae255ffb91ef59b620e69cfd37b6717e95747f26ea3a37f5222', + 'checksum' => '1d744e0e0822d03c933220a3314ae1dcdb7e36be06be1fdabca6d1a4dd7d3fbb', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => '4a256a1b40cb0021d3df6a2149732c1298c3e8280fde8021fc9c9df2d66d9eb3', + 'checksum' => 'ac70e261057f85557bad5035c6ed939c54cd09ea4ff8a831692a9a59f8212e4a', }, }, }, @@ -517,63 +551,83 @@ def kibana_checksum_map }, }, }, + '5.6.16' => { + 'release' => { + 'x86_64' => { + 'checksum' => '4abbb3a0876fcdf8be76366e0fe5348aaa3bac71c68ec1884c8b14eee121f943', + }, + 'x86' => { + 'checksum' => 'b63a80c45cd866141799640ffeaf18990fc66f40ec7977498c20701606246a2e', + }, + }, + 'windows' => { + 'x86' => { + 'checksum' => '7e05d4a579c9c085b07ecbb8b80d0b44b2de87efb9a6c51b14d14e9ea9e51579', + }, + }, + 'darwin' => { + 'x86_64' => { + 'checksum' => '9406f8fc55adef28673d99674942b18eb14ba02621774c155074e29cd0130c4b', + }, + }, + }, '5.6.15' => { 'release' => { 'x86_64' => { - 'checksum' => '5219f4b1bbf649967b919e732110920727c3f5f462d7e4d9cc67d2324d54d16b', + 'checksum' => '5b6891dd6c865262c08956f49c310c0d729b60bfb85bc39564f961fa5344223c', }, 'x86' => { - 'checksum' => 'f762859ec69f7660640a6823422f717976bf182451525ab98a86ba946a749493', + 'checksum' => '9586cc909a105e89db52f7c5c60e50fb921c465a0e2a1275bc35a175897121ee', }, }, 'windows' => { 'x86' => { - 'checksum' => '22794da5d22abaf06f773c93dfcb160f16529febeaaaebfa1a77bc91029697fe', + 'checksum' => 'b2ed1097fa4f2c86442ec25647d2304ded6b62c20c82f863e3dbe97261d3bbfb', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => 'e7eaee01146b4a5600de90f8fe0164c2f194229a2fdc772167bf9b47d22a1756', + 'checksum' => '94af3109b88229b864738c6b449efc669a786e31922641cc24423a1be3dd38e6', }, }, }, '5.6.14' => { 'release' => { 'x86_64' => { - 'checksum' => '0a4b5bc914a5a5c6c4b19db83a9754099fb48289c12cb29e55222a6760e49edc', + 'checksum' => '71cdc8c7c223967de0ca492147f91d3fd093876f9bc5802ccdab2f76d5f23b1a', }, 'x86' => { - 'checksum' => 'c0134771f3a1d72384f3fe7304271aa4113139408ccbb91eb93a3bb5eaf4a579', + 'checksum' => '1dfb19333b0082a791e70d3b7a85cf6120f8a42b598c4a074f996e5888894bbb', }, }, 'windows' => { 'x86' => { - 'checksum' => '6fe92acd669ee8354e5a9e34291124b418e055fdf7e73e2fb37468e186337c59', + 'checksum' => '9a17fc932294568c233232471bb2891e2cb7fc27a252e13054cbb9a1253e2806', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => 'cf78ff58c5e8dc0f75273da5c1ef8a2be88f5e03c1a79946b28f907264af0874', + 'checksum' => '46b9b092170604addf462e3e5f85b40294efb489c187fa8ead032624993e0ab6', }, }, }, '5.6.13' => { 'release' => { 'x86_64' => { - 'checksum' => 'b4b1846f11bee1cc67dae242516dd2079fe83fb9e1975838e5eb41107570c97d', + 'checksum' => '1294523f9be72517a68e4a1a8fe672059235b2cbd257aaff88750225da62c201', }, 'x86' => { - 'checksum' => '9fdefe88b78d9e48a6447d2eb4122aaf1edb79c1a7a9bb7ada2137aba5db7ac4', + 'checksum' => '0ac212901139249e6c08645ddbcc8b2f084d180bbac3110f2223d188fdbbb61c', }, }, 'windows' => { 'x86' => { - 'checksum' => '28a4d48a29299bfcd14cf6c43564e67bd8b1e47ea81823f3f322fd3c670d13d0', + 'checksum' => '2a851d002e4f3f6588f890006c92750421c7d1e2a28816a0becb9f957c8828da', }, }, 'darwin' => { 'x86_64' => { - 'checksum' => 'c88a3df789a638fe5c6899762b4081f63e9a43ee6537b921604187c2a4880a83', + 'checksum' => 'b08b75f4ebad7022d74bb14caae137b8c92d5e849e9e988fbbd76971b1ebcc43', }, }, }, diff --git a/cookbooks/kibana5/metadata.json b/cookbooks/kibana5/metadata.json index ee8cc97..b735390 100644 --- a/cookbooks/kibana5/metadata.json +++ b/cookbooks/kibana5/metadata.json @@ -1,7 +1,7 @@ { "name": "kibana5", "description": "Installs/Configures kibana 5", - "long_description": "# chef-kibana5\n[![Cookbook Version](https://img.shields.io/cookbook/v/kibana5.svg)](https://supermarket.chef.io/cookbooks/kibana5)\n[![Build Status](https://travis-ci.org/anuriq/chef-kibana5.svg?branch=master)](https://travis-ci.org/anuriq/chef-kibana5)\n\n## Description\n\nThis cookbook installs and configures [Kibana](https://www.elastic.co/products/kibana) version 5.2.0 and above. This cookbook may work with Kibana 6.x.x, but no guarantee.\n\n## Requirements\n\n### Cookbooks\n\n- [ark](https://supermarket.chef.io/cookbooks/ark)\n- [systemd](https://supermarket.chef.io/cookbooks/systemd)\n\n### Platforms\n\nTested only on CentOS 7 and Ubuntu 16.04. Should work on any modern Linux OS with systemd.\n\n## Recipes\n* `default.rb` - Runs `kibana5_install` and `kibana5_configure` with default options.\n\n## Resources\n\n### kibana5_install\n\nThis resource installs Kibana 5 binaries.\n\n#### Attributes\n\n|Attribute|Description|Type|Default|\n|---------|-----------|----|-------|\n|`name`| Simply name. Currently not used. |String||\n|`version`| Version of Kibana. 5.2.0 and above are supported. |String|`5.6.11`|\n|`install_method`| Installation method. Currently only `release` is supported. This means installation from official binaries provided by Elastic. |String|`release`|\n|`base_dir`| Base directory for Kibana binaries. |String|`/opt/kibana`|\n|`svc_user`| Kibana daemon user. |String|`kibana`|\n|`svc_group`| Kibana daemon group. |String|`kibana`|\n\n### kibana5_configure\n\nThis resource configures Kibana daemon and main configuration file.\n\n#### Attributes\n\n|Attribute|Description|Type|Default|\n|---------|-----------|----|-------|\n|`svc_name`| Name of the daemon |String||\n|`svc_user`| Kibana daemon user. |String|`kibana`|\n|`svc_group`| Kibana daemon group. |String|`kibana`|\n|`configuration`| Hash with configuration file values. See examples. |Hash||\n|`template_cookbook`| Override template from other cookbook. |String|`kibana5`|\n\nexamples of configuration hashes:\n\n```ruby\n{\n 'server.port' => 5601,\n 'server.host' => 'localhost',\n 'elasticsearch.url' => 'http://localhost:9200',\n}\n```\n\n```ruby\n{\n 'server.port' => 5601,\n 'server.host' => 'localhost',\n 'server.name' => 'My-Kibana',\n 'elasticsearch.url' => 'http://localhost:9200',\n 'logging.dest' => '/var/log/kibana.log',\n 'logging.verbose' => 'true',\n 'elasticsearch.requestHeadersWhitelist' => '[ authorization ]',\n}\n```\n\n## Usage\n\nIt is recommended to use resources directly.\n\n## Examples\nYou may see examples in fixture cookbook:\n[test/fixtures/kibana5-test/recipes/default.rb](test/fixtures/kibana5-test/recipes/default.rb)\n[test/fixtures/kibana5-test/recipes/nginx.rb](test/fixtures/kibana5-test/recipes/nginx.rb)\n\n## Authors\n- Author:: Azat Khadiev (anuriq@gmail.com)\n", + "long_description": "# chef-kibana5\n[![Cookbook Version](https://img.shields.io/cookbook/v/kibana5.svg)](https://supermarket.chef.io/cookbooks/kibana5)\n[![Build Status](https://travis-ci.org/anuriq/chef-kibana5.svg?branch=master)](https://travis-ci.org/anuriq/chef-kibana5)\n\n## Description\n\nThis cookbook installs and configures [Kibana](https://www.elastic.co/products/kibana) version 5.2.0 and above. This cookbook may work with Kibana 6.x.x, but no guarantee.\n\n## Requirements\n\n### Cookbooks\n\n- [ark](https://supermarket.chef.io/cookbooks/ark)\n- [systemd](https://supermarket.chef.io/cookbooks/systemd)\n\n### Platforms\n\nTested only on CentOS 7 and Ubuntu 16.04. Should work on any modern Linux OS with systemd.\n\n## Recipes\n* `default.rb` - Runs `kibana5_install` and `kibana5_configure` with default options.\n\n## Resources\n\n### kibana5_install\n\nThis resource installs Kibana 5 binaries.\n\n#### Attributes\n\n|Attribute|Description|Type|Default|\n|---------|-----------|----|-------|\n|`name`| Simply name. Currently not used. |String||\n|`version`| Version of Kibana. 5.2.0 and above are supported. |String|`5.6.16`|\n|`install_method`| Installation method. Currently only `release` is supported. This means installation from official binaries provided by Elastic. |String|`release`|\n|`base_dir`| Base directory for Kibana binaries. |String|`/opt/kibana`|\n|`svc_user`| Kibana daemon user. |String|`kibana`|\n|`svc_group`| Kibana daemon group. |String|`kibana`|\n\n### kibana5_configure\n\nThis resource configures Kibana daemon and main configuration file.\n\n#### Attributes\n\n|Attribute|Description|Type|Default|\n|---------|-----------|----|-------|\n|`svc_name`| Name of the daemon |String||\n|`svc_user`| Kibana daemon user. |String|`kibana`|\n|`svc_group`| Kibana daemon group. |String|`kibana`|\n|`configuration`| Hash with configuration file values. See examples. |Hash||\n|`template_cookbook`| Override template from other cookbook. |String|`kibana5`|\n\nexamples of configuration hashes:\n\n```ruby\n{\n 'server.port' => 5601,\n 'server.host' => 'localhost',\n 'elasticsearch.url' => 'http://localhost:9200',\n}\n```\n\n```ruby\n{\n 'server.port' => 5601,\n 'server.host' => 'localhost',\n 'server.name' => 'My-Kibana',\n 'elasticsearch.url' => 'http://localhost:9200',\n 'logging.dest' => '/var/log/kibana.log',\n 'logging.verbose' => 'true',\n 'elasticsearch.requestHeadersWhitelist' => '[ authorization ]',\n}\n```\n\n## Usage\n\nIt is recommended to use resources directly.\n\n## Examples\nYou may see examples in fixture cookbook:\n[test/fixtures/kibana5-test/recipes/default.rb](test/fixtures/kibana5-test/recipes/default.rb)\n[test/fixtures/kibana5-test/recipes/nginx.rb](test/fixtures/kibana5-test/recipes/nginx.rb)\n\n## Authors\n- Author:: Azat Khadiev (anuriq@gmail.com)\n", "maintainer": "Azat Khadiev", "maintainer_email": "anuriq@gmail.com", "license": "Apache-2.0", @@ -13,17 +13,32 @@ "dependencies": { "ark": ">= 0.0.0", "systemd": ">= 0.0.0" + }, + "recommendations": { + + }, + "suggestions": { + + }, + "conflicting": { + }, "providing": { + }, + "replacing": { + }, "attributes": { + }, + "groupings": { + }, "recipes": { }, - "version": "1.6.4", + "version": "1.6.6", "source_url": "https://github.com/anuriq/chef-kibana5", "issues_url": "https://github.com/anuriq/chef-kibana5/issues", "privacy": false, diff --git a/cookbooks/kibana5/metadata.rb b/cookbooks/kibana5/metadata.rb index 23ae0ed..af6a1db 100644 --- a/cookbooks/kibana5/metadata.rb +++ b/cookbooks/kibana5/metadata.rb @@ -4,7 +4,7 @@ license 'Apache-2.0' description 'Installs/Configures kibana 5' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.6.4' +version '1.6.6' issues_url 'https://github.com/anuriq/chef-kibana5/issues' if respond_to?(:issues_url) source_url 'https://github.com/anuriq/chef-kibana5' if respond_to?(:source_url) diff --git a/cookbooks/kibana_wrapper_cookbook/README.md b/cookbooks/kibana_wrapper_cookbook/README.md index 7883e56..c0eb494 100644 --- a/cookbooks/kibana_wrapper_cookbook/README.md +++ b/cookbooks/kibana_wrapper_cookbook/README.md @@ -1,4 +1,25 @@ # kibana_wrapper_cookbook -TODO: Enter the cookbook description here. +Chef cookbook for provisioning kibana cluster. + +## Releasing New Version + +We need to do these whenever we release a new version: + +1. Run +``` +bundle exec berks update +bundle exec berks vendor cookbooks +``` + +2. Commit and updated `cookbooks` directory +3. Tag the commit that we want to release with format `-` + +## Version + +This cookbook version will follow kibana version with extra revision indicator suffixed. For example: + +- `6.3.0-1` means that this is a revision 1 cookbook that will provision kibana version `6.3.0` + + diff --git a/cookbooks/kibana_wrapper_cookbook/metadata.json b/cookbooks/kibana_wrapper_cookbook/metadata.json index 367ef73..f6493d7 100644 --- a/cookbooks/kibana_wrapper_cookbook/metadata.json +++ b/cookbooks/kibana_wrapper_cookbook/metadata.json @@ -14,14 +14,11 @@ }, "providing": { - }, - "attributes": { - }, "recipes": { }, - "version": "0.1.0", + "version": "6.3.1", "source_url": "https://github.com/BaritoLog/kibana_wrapper_cookbook", "issues_url": "https://github.com/BaritoLog/kibana_wrapper_cookbook/issues", "privacy": false, diff --git a/cookbooks/kibana_wrapper_cookbook/metadata.rb b/cookbooks/kibana_wrapper_cookbook/metadata.rb index 2838f2d..6547d9b 100644 --- a/cookbooks/kibana_wrapper_cookbook/metadata.rb +++ b/cookbooks/kibana_wrapper_cookbook/metadata.rb @@ -4,7 +4,7 @@ license 'Apache-2.0' description 'Installs/Configures Kibana' long_description 'Installs/Configures Kibana' -version '0.1.0' +version '6.3.1' supports 'ubuntu' chef_version '>= 14.1.1' if respond_to?(:chef_version) diff --git a/cookbooks/kibana_wrapper_cookbook/recipes/default.rb b/cookbooks/kibana_wrapper_cookbook/recipes/default.rb index 084d21e..af9ba80 100644 --- a/cookbooks/kibana_wrapper_cookbook/recipes/default.rb +++ b/cookbooks/kibana_wrapper_cookbook/recipes/default.rb @@ -34,6 +34,7 @@ kibana_port: node['kibana']['config']['port'], base_path: node['kibana']['config']['server.basePath'] ) + notifies :reload, 'service[nginx]' end %w[sites-enabled sites-available conf.d].each do |conf_dir| diff --git a/cookbooks/seven_zip/appveyor.yml b/cookbooks/seven_zip/appveyor.yml index 5824353..321b270 100644 --- a/cookbooks/seven_zip/appveyor.yml +++ b/cookbooks/seven_zip/appveyor.yml @@ -1,4 +1,4 @@ -version: "3.0.0.{build}-{branch}" +version: "3.1.1.{build}-{branch}" image: Visual Studio 2013 platform: x64 @@ -19,7 +19,7 @@ skip_tags: true clone_depth: 1 install: - - ps: (& cmd /c); iex (irm https://omnitruck.chef.io/install.ps1); Install-Project -Project chefdk -channel current + - ps: (& cmd /c); iex (irm https://omnitruck.chef.io/install.ps1); Install-Project -Project chefdk -channel stable -version 3.10.1 - ps: 'Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version' - ps: $PSVersionTable - c:\opscode\chefdk\bin\chef.bat exec ruby --version diff --git a/cookbooks/seven_zip/metadata.json b/cookbooks/seven_zip/metadata.json index fdc1c73..cf13785 100644 --- a/cookbooks/seven_zip/metadata.json +++ b/cookbooks/seven_zip/metadata.json @@ -20,7 +20,7 @@ "recipes": { }, - "version": "3.1.0", + "version": "3.1.1", "source_url": "https://github.com/windowschefcookbooks/seven_zip", "issues_url": "https://github.com/windowschefcookbooks/seven_zip/issues", "privacy": false, diff --git a/cookbooks/seven_zip/metadata.rb b/cookbooks/seven_zip/metadata.rb index fb835ad..d840292 100644 --- a/cookbooks/seven_zip/metadata.rb +++ b/cookbooks/seven_zip/metadata.rb @@ -7,6 +7,6 @@ license 'Apache-2.0' description 'Installs/Configures 7-Zip' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.1.0' +version '3.1.1' supports 'windows' depends 'windows' diff --git a/cookbooks/seven_zip/providers/archive.rb b/cookbooks/seven_zip/providers/archive.rb index b1e43fa..c935569 100644 --- a/cookbooks/seven_zip/providers/archive.rb +++ b/cookbooks/seven_zip/providers/archive.rb @@ -20,6 +20,7 @@ require 'fileutils' require 'chef/mixin/shell_out' +require 'chef/util/path_helper' include Chef::Mixin::ShellOut include Windows::Helper @@ -35,7 +36,7 @@ def whyrun_supported? overwrite_file = @new_resource.overwrite ? ' -y' : ' -aos' cmd = "\"#{seven_zip_exe}\" x" cmd << overwrite_file - cmd << " -o\"#{win_friendly_path(@new_resource.path)}\"" + cmd << " -o\"#{Chef::Util::PathHelper.cleanpath(@new_resource.path)}\"" cmd << " \"#{local_source}\"" Chef::Log.debug(cmd) shell_out!(cmd, timeout: extract_timeout) @@ -43,13 +44,9 @@ def whyrun_supported? end def seven_zip_exe - path = if node['seven_zip']['home'] - node['seven_zip']['home'] - else - seven_zip_exe_from_registry - end + path = node['seven_zip']['home'] || seven_zip_exe_from_registry Chef::Log.debug("Using 7-zip home: #{path}") - win_friendly_path(::File.join(path, '7z.exe')) + Chef::Util::PathHelper.cleanpath(::File.join(path, '7z.exe')) end def seven_zip_exe_from_registry diff --git a/cookbooks/windows/CHANGELOG.md b/cookbooks/windows/CHANGELOG.md index e9f7941..d88694c 100644 --- a/cookbooks/windows/CHANGELOG.md +++ b/cookbooks/windows/CHANGELOG.md @@ -2,6 +2,25 @@ This file is used to list changes made in each version of the windows cookbook. +## 6.0.0 (2019-04-25) + +### Breaking Changes + +- This cookbook now requires Chef 14 or later. As of April 2019 Chef 13 is EOL. If you are still running Chef 13 we highly suggest you begin your migration. Chef 14 provides a greatly improved Windows experience with built in resources for Windows clients. +- Resources that are built into Chef 14 and later have been removed from this cookbook: + - windows_auto_run + - windows_feature + - windows_font + - windows_pagefile + - windows_printer_port + - windows_printer + - windows_shortcut + +## 5.3.1 (2019-04-25) + +- Resolved failures on Chef 14.11 or later +- Removed OS detectio support in the helpers for Windows 2003 + ## 5.3.0 (2019-03-06) - Expanded certificate testing to cover more scenarios - [@Xorima](https://github.com/Xorima) diff --git a/cookbooks/windows/README.md b/cookbooks/windows/README.md index a6ca85e..b849fbf 100644 --- a/cookbooks/windows/README.md +++ b/cookbooks/windows/README.md @@ -16,44 +16,14 @@ Provides a set of Windows-specific resources to aid in the creation of cookbooks ### Chef -- Chef 13.4+ +- Chef 14+ ## Resources ### Deprecated Resources Note -As of Chef Client 14.0+ the auto_run, feature, feature_dism, feature_powershell, font, pagefile, printer_port, printer, and shortcut resources are now included in the Chef Client. If you are running Chef 14+ the resources in Chef client will take precedence over the resources in this cookbook. In April 2019 we will release a new major version of this cookbook that removes these resources. - As of Chef 14.7+ the windows_share and windows_certificate resources are now included in the Chef Client. If you are running Chef 14.7+ the resources in Chef client will take precedence over the resources in this cookbook. In November 2019 we will release a new major version of this cookbook that removes these resources. -### windows_auto_run - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -#### Actions - -- `:create` - Create an item to be run at login -- `:remove` - Remove an item that was previously setup to run at login - -#### Properties - -- `program_name` - Name property. The name of the value to be stored in the registry -- `path` - The program to be run at login. This property was previous named `program`. Cookbooks using the `program` property will continue to function, but should be updated. -- `args` - The arguments for the program -- `root` - The registry root key to put the entry under--`:machine` (default) or `:user` - -#### Examples - -Run BGInfo at login - -```ruby -windows_auto_run 'BGINFO' do - program 'C:/Sysinternals/bginfo.exe' - args '\'C:/Sysinternals/Config.bgi\' /NOLICPROMPT /TIMER:0' - action :create -end -``` - ### windows_certificate `Note`: This resource is now included in Chef 14.7 and later. There is no need to depend on the Windows cookbook for this resource. @@ -207,132 +177,6 @@ windows_dns "myservice.chef.test" do end ``` -### windows_feature - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -**BREAKING CHANGE - Version 3.0.0** - -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`. - -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'. - -This resource allows you to manage these 'features' in an unattended, idempotent way. - -There are two underlying resources that power `windows_feature` which map to the available installation systems on supported releases of Windows: [Deployment Image Servicing and Management (DISM)](http://msdn.microsoft.com/en-us/library/dd371719%28v=vs.85%29.aspx) and [PowerShell](https://technet.microsoft.com/en-us/library/cc731774(v=ws.11).aspx). Chef will set the default method to `:windows_feature_dism` if `dism.exe` is present on the system being configured and otherwise use `:windows_feature_powershell`. - -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: - -For Dism: - -```text -dism /online /Get-Features -``` - -For PowerShell: - -```text -get-windowsfeature -``` - -#### Actions - -- `:install` - install a Windows role/feature -- `:remove` - remove a Windows role/feature -- `:delete` - remove a Windows role/feature from the image - -#### Properties - -- `feature_name` - name of the feature/role(s) to install. The same feature may have different names depending on the underlying resource being used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS). -- `all` - Boolean. Optional. Default: false. For DISM this is the equivalent of specifying the /All switch to dism.exe, forcing all parent dependencies to be installed. With the PowerShell install method, the `-InstallAllSubFeatures` switch is applied. Note that these two methods may not produce identical results. -- `management_tools` - Boolean. Optional. Default: false. PowerShell only. Includes the `-IncludeManagementTools` switch. Installs all applicable management tools of the roles, role services, or features specified by the feature name. -- `source` - String. Optional. Uses local repository for feature install. -- `timeout` - Integer. Optional. Default: 600\. Specifies a timeout (in seconds) for feature install. -- `install_method` - Symbol. Optional. If not supplied, Chef will determine which method to use (in the order of `:windows_feature_dism`, `:windows_feature_servercmd`, `:windows_feature_powershell`) - -#### Examples - -Install the DHCP Server feature - -```ruby -windows_feature 'DHCPServer' do - action :install -end -``` - -Install the .Net 3.5.1 feature on Server 2012 using repository files on DVD and install all dependencies with a timeout of 900 seconds - -```ruby -windows_feature "NetFx3" do - action :install - all true - source "d:\sources\sxs" - timeout 900 -end -``` - -Remove Telnet Server and Client features - -```ruby -windows_feature ['TelnetServer', 'TelnetClient'] do - action :remove -end -``` - -Add the SMTP Server feature using the PowerShell provider - -```ruby -windows_feature "smtp-server" do - action :install - all true - install_method :windows_feature_powershell -end -``` - -Install multiple features using one resource with the PowerShell provider - -```ruby -windows_feature ['Web-Asp-Net45', 'Web-Net-Ext45'] do - action :install - install_method :windows_feature_powershell -end -``` - -Install the Network Policy and Access Service feature, including the management tools. Which, for this example, will automatically install `RSAT-NPAS` as well. - -```ruby -windows_feature 'NPAS' do - action :install - management_tools true - install_method :windows_feature_powershell -end -``` - -### windows_font - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -Installs font files. Sources the font by default from the cookbook, but a URI source can be specified as well. - -#### Actions - -- `:install` - install a font to the system fonts directory. - -#### Properties - -- `font_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. -- `source` - A local filesystem path or URI to source the font file from.. - -#### Examples - -```ruby -windows_font 'Code New Roman.otf' - -windows_font 'Custom.otf' do - source "https://example.com/Custom.otf" -end -``` - ### windows_http_acl Sets the Access Control List for an http URL to grant non-admin accounts permission to open HTTP endpoints. @@ -369,127 +213,6 @@ windows_http_acl 'http://+:50051/' do end ``` -### windows_pagefile - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -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. - -#### Actions - -- `:set` - configures the default pagefile, creating if it doesn't exist. -- `:delete` - deletes the specified pagefile. - -#### Properties - -- `path` - the path to the pagefile, String, name_property: true -- `system_managed` - configures whether the system manages the pagefile size. [true, false] -- `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 -- `initial_size` - initial size of the pagefile in megbytes. Integer -- `maximum_size` - maximum size of the pagefile in megbytes. Integer - -### windows_printer_port - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -Create and delete TCP/IPv4 printer ports. - -#### Actions - -- `:create` - Create a TCIP/IPv4 printer port. This is the default action. -- `:delete` - Delete a TCIP/IPv4 printer port - -#### Properties - -- `ipv4_address` - Name attribute. Required. IPv4 address, e.g. '10.0.24.34' -- `port_name` - Port name. Optional. Defaults to 'IP_' + `ipv4_address` -- `port_number` - Port number. Optional. Defaults to 9100. -- `port_description` - Port description. Optional. -- `snmp_enabled` - Boolean. Optional. Defaults to false. -- `port_protocol` - Port protocol, 1 (RAW), or 2 (LPR). Optional. Defaults to 1. - -#### Examples - -Create a TCP/IP printer port named 'IP_10.4.64.37' with all defaults - -```ruby -windows_printer_port '10.4.64.37' do - action :create -end -``` - -Delete a printer port - -```ruby -windows_printer_port '10.4.64.37' do - action :delete -end -``` - -Delete a port with a custom port_name - -```ruby -windows_printer_port '10.4.64.38' do - port_name 'My awesome port' - action :delete -end -``` - -Create a port with more options - -```ruby -windows_printer_port '10.4.64.39' do - port_name 'My awesome port' - snmp_enabled true - port_protocol 2 -end -``` - -### windows_printer - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -Create Windows printer. Note that this doesn't currently install a printer driver. You must already have the driver installed on the system. - -The Windows Printer resource 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` resource before creating the printer. - -#### Actions - -- `:create` - Create a new printer -- `:delete` - Delete an existing printer - -#### Properties - -- `device_id` - Printer queue name, e.g. 'HP LJ 5200 in fifth floor copy room'. Name property. -- `comment` - Optional string describing the printer queue. -- `default` - Boolean. Optional. Defaults to false. Note that Windows sets the first printer defined to the default printer regardless of this setting. -- `driver_name` - String. Required. Exact name of printer driver. Note that the printer driver must already be installed on the node. -- `location` - Printer location, e.g. 'Fifth floor copy room', or 'US/NYC/Floor42/Room4207' -- `shared` - Boolean. Defaults to false. -- `share_name` - Printer share name. -- `ipv4_address` - Printer's IPv4 address, e.g. '10.4.64.23'. You don't have to be able to ping the IP address to set it. Required. - -An error of "Set-WmiInstance : Generic failure" is most likely due to the printer driver name not matching or not being installed. - -#### Examples - -Create a printer - -```ruby -windows_printer 'HP LaserJet 5th Floor' do - driver_name 'HP LaserJet 4100 Series PCL6' - ipv4_address '10.4.64.38' -end -``` - -Delete a printer. Note: this doesn't delete the associated printer port. See `windows_printer_port` above for how to delete the port. - -```ruby -windows_printer 'HP LaserJet 5th Floor' do - action :delete -end -``` - ### windows_share `Note`: This resource is now included in Chef 14.7 and later. There is no need to depend on the Windows cookbook for this resource. @@ -537,69 +260,6 @@ windows_share "foo" do end ``` -### windows_shortcut - -`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource. - -Creates and modifies Windows shortcuts. - -#### Actions - -- `:create` - create or modify a windows shortcut - -#### Properties - -- `shortcut_name` - The name for the shortcut if it differs from the resource name. Name property -- `target` - Where the shortcut links to. -- `arguments` - arguments to pass to the target when the shortcut is executed -- `description` - description of the shortcut -- `cwd` - Working directory to use when the target is executed -- `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)) - -#### Examples - -Add a shortcut to all users desktop: - -```ruby -require 'win32ole' -all_users_desktop = WIN32OLE.new("WScript.Shell").SpecialFolders("AllUsersDesktop") - -windows_shortcut "#{all_users_desktop}/Notepad.lnk" do - target "C:\\Windows\\notepad.exe" - description "Launch Notepad" - iconlocation "C:\\Windows\\notepad.exe,0" -end -``` - -### windows_path - -#### Actions - -- `:add` - Add an item to the system path -- `:remove` - Remove an item from the system path - -#### Properties - -- `path` - Name attribute. The name of the value to add to the system path - -#### Examples - -Add Sysinternals to the system path - -```ruby -windows_path 'C:\Sysinternals' do - action :add -end -``` - -Remove 7-Zip from the system path - -```ruby -windows_path 'C:\7-Zip' do - action :remove -end -``` - ### windows_user_privilege Adds the `principal` (User/Group) to the specified privileges (such as `Logon as a batch job` or `Logon as a Service`). diff --git a/cookbooks/windows/libraries/version.rb b/cookbooks/windows/libraries/version.rb index a353451..48ff13f 100644 --- a/cookbooks/windows/libraries/version.rb +++ b/cookbooks/windows/libraries/version.rb @@ -20,7 +20,6 @@ if RUBY_PLATFORM =~ /mswin|mingw32|windows/ require_relative 'wmi_helper' - require 'Win32API' end module Windows @@ -30,10 +29,6 @@ class Version # Suite Masks # Microsoft BackOffice components are installed. VER_SUITE_BACKOFFICE = 0x00000004 unless defined?(VER_SUITE_BACKOFFICE) - # Windows Server 2003, Web Edition is installed. - VER_SUITE_BLADE = 0x00000400 unless defined?(VER_SUITE_BLADE) - # Windows Server 2003, Compute Cluster Edition is installed. - VER_SUITE_COMPUTE_SERVER = 0x00004000 unless defined?(VER_SUITE_COMPUTE_SERVER) # Windows Server 2008 Datacenter, Windows Server 2003, Datacenter Edition, or Windows 2000 Datacenter Server is installed. VER_SUITE_DATACENTER = 0x00000080 unless defined?(VER_SUITE_DATACENTER) # Windows Server 2008 Enterprise, Windows Server 2003, Enterprise Edition, or Windows 2000 Advanced Server is installed. Refer to the Remarks section for more information about this bit flag. @@ -48,8 +43,6 @@ class Version VER_SUITE_SMALLBUSINESS = 0x00000001 unless defined?(VER_SUITE_SMALLBUSINESS) # Microsoft Small Business Server is installed with the restrictive client license in force. Refer to the Remarks section for more information about this bit flag. VER_SUITE_SMALLBUSINESS_RESTRICTED = 0x00000020 unless defined?(VER_SUITE_SMALLBUSINESS_RESTRICTED) - # Windows Storage Server 2003 R2 or Windows Storage Server 2003is installed. - VER_SUITE_STORAGE_SERVER = 0x00002000 unless defined?(VER_SUITE_STORAGE_SERVER) # Terminal Services is installed. This value is always set. # If VER_SUITE_TERMINAL is set but VER_SUITE_SINGLEUSERTS is not set, the system is running in application server mode. VER_SUITE_TERMINAL = 0x00000010 unless defined?(VER_SUITE_TERMINAL) @@ -65,10 +58,6 @@ class Version # The operating system is Windows 7, Windows Vista, Windows XP Professional, Windows XP Home Edition, or Windows 2000 Professional. VER_NT_WORKSTATION = 0x0000001 unless defined?(VER_NT_WORKSTATION) - # GetSystemMetrics - # The build number if the system is Windows Server 2003 R2; otherwise, 0. - SM_SERVERR2 = 89 unless defined?(SM_SERVERR2) - # http://msdn.microsoft.com/en-us/library/ms724358(v=vs.85).aspx SKU = { 0x00000006 => { ms_const: 'PRODUCT_BUSINESS', name: 'Business' }, @@ -147,9 +136,7 @@ def initialize 'Windows Server 2008 R2' => { major: 6, minor: 1, callable: -> { @product_type != VER_NT_WORKSTATION } }, 'Windows Server 2008' => { major: 6, minor: 0, callable: -> { @product_type != VER_NT_WORKSTATION } }, 'Windows Vista' => { major: 6, minor: 0, callable: -> { @product_type == VER_NT_WORKSTATION } }, - 'Windows Server 2003 R2' => { major: 5, minor: 2, callable: -> { Win32API.new('user32', 'GetSystemMetrics', 'I', 'I').call(SM_SERVERR2) != 0 } }, 'Windows Home Server' => { major: 5, minor: 2, callable: -> { (@product_suite & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER } }, - 'Windows Server 2003' => { major: 5, minor: 2, callable: -> { Win32API.new('user32', 'GetSystemMetrics', 'I', 'I').call(SM_SERVERR2) == 0 } }, 'Windows XP' => { major: 5, minor: 1 }, 'Windows 2000' => { major: 5, minor: 0 }, }.freeze unless defined?(WIN_VERSIONS) @@ -186,12 +173,6 @@ def initialize private - # Win32API call to GetSystemMetrics(SM_SERVERR2) - # returns: The build number if the system is Windows Server 2003 R2; otherwise, 0. - def sm_serverr2 - @sm_serverr2 ||= Win32API.new('user32', 'GetSystemMetrics', 'I', 'I').call(SM_SERVERR2) - end - # query WMI Win32_OperatingSystem for required OS info def get_os_info cols = %w( Version ProductType OSProductSuite OperatingSystemSKU ServicePackMajorVersion ServicePackMinorVersion ) diff --git a/cookbooks/windows/libraries/windows_helper.rb b/cookbooks/windows/libraries/windows_helper.rb index edc2d42..97ec431 100644 --- a/cookbooks/windows/libraries/windows_helper.rb +++ b/cookbooks/windows/libraries/windows_helper.rb @@ -18,17 +18,17 @@ # limitations under the License. require 'uri' -require 'Win32API' if Chef::Platform.windows? require 'chef/exceptions' require 'openssl' require 'chef/mixin/powershell_out' +require 'chef/mixin/windows_env_helper' require 'chef/util/path_helper' module Windows module Helper AUTO_RUN_KEY = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'.freeze unless defined?(AUTO_RUN_KEY) ENV_KEY = 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'.freeze unless defined?(ENV_KEY) - ExpandEnvironmentStrings = Win32API.new('kernel32', 'ExpandEnvironmentStrings', %w(P P L), 'L') if Chef::Platform.windows? && !defined?(ExpandEnvironmentStrings) + include Chef::Mixin::WindowsEnvHelper # returns windows friendly version of the provided path, # ensures backslashes are used everywhere @@ -88,13 +88,10 @@ def cached_file(source, checksum = nil, windows_path = true) # Expands the environment variables def expand_env_vars(path) - # We pick 32k because that is the largest it could be: - # http://msdn.microsoft.com/en-us/library/windows/desktop/ms724265%28v=vs.85%29.aspx - buf = 0.chr * 32 * 1024 # 32k - if ExpandEnvironmentStrings.call(path.dup, buf, buf.length) == 0 - raise Chef::Exceptions::Win32APIError, 'Failed calling ExpandEnvironmentStrings (received 0)' - end - buf.strip + # The windows Env provider does not correctly expand variables in + # the PATH environment variable. Ruby expects these to be expanded. + # Using Chef::Mixin::WindowsEnvHelper + expand_path(path) end def is_package_installed?(package_name) # rubocop:disable Naming/PredicateName diff --git a/cookbooks/windows/metadata.json b/cookbooks/windows/metadata.json index 46a3073..33a7cfd 100644 --- a/cookbooks/windows/metadata.json +++ b/cookbooks/windows/metadata.json @@ -1 +1 @@ -{"name":"windows","version":"5.3.0","description":"Provides a set of useful Windows-specific primitives.","long_description":"# Windows Cookbook\n\n[![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)\n\nProvides a set of Windows-specific resources to aid in the creation of cookbooks/recipes targeting the Windows platform.\n\n## Requirements\n\n### Platforms\n\n- Windows 7\n- Windows Server 2008 R2\n- Windows 8, 8.1\n- Windows Server 2012 (R1, R2)\n- Windows Server 2016\n\n### Chef\n\n- Chef 13.4+\n\n## Resources\n\n### Deprecated Resources Note\n\nAs of Chef Client 14.0+ the auto_run, feature, feature_dism, feature_powershell, font, pagefile, printer_port, printer, and shortcut resources are now included in the Chef Client. If you are running Chef 14+ the resources in Chef client will take precedence over the resources in this cookbook. In April 2019 we will release a new major version of this cookbook that removes these resources.\n\nAs of Chef 14.7+ the windows_share and windows_certificate resources are now included in the Chef Client. If you are running Chef 14.7+ the resources in Chef client will take precedence over the resources in this cookbook. In November 2019 we will release a new major version of this cookbook that removes these resources.\n\n### windows_auto_run\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\n#### Actions\n\n- `:create` - Create an item to be run at login\n- `:remove` - Remove an item that was previously setup to run at login\n\n#### Properties\n\n- `program_name` - Name property. The name of the value to be stored in the registry\n- `path` - The program to be run at login. This property was previous named `program`. Cookbooks using the `program` property will continue to function, but should be updated.\n- `args` - The arguments for the program\n- `root` - The registry root key to put the entry under--`:machine` (default) or `:user`\n\n#### Examples\n\nRun BGInfo at login\n\n```ruby\nwindows_auto_run 'BGINFO' do\n program 'C:/Sysinternals/bginfo.exe'\n args '\\'C:/Sysinternals/Config.bgi\\' /NOLICPROMPT /TIMER:0'\n action :create\nend\n```\n\n### windows_certificate\n\n`Note`: This resource is now included in Chef 14.7 and later. There is no need to depend on the Windows cookbook for this resource.\n\nInstalls 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.\n\n#### Actions\n\n- `:create` - creates or updates a certificate.\n- `:delete` - deletes a certificate.\n- `:acl_add` - adds read-only entries to a certificate's private key ACL.\n- `:verify` - logs whether or not a certificate is valid\n\n#### Properties\n\n- `source` - name attribute. The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete).\n- `pfx_password` - the password to access the source if it is a pfx file.\n- `private_key_acl` - array of 'domain\\account' entries to be granted read-only access to the certificate's private key. This is not idempotent.\n- `store_name` - the certificate store to manipulate. One of:\n - MY (Personal)\n - CA (Intermediate Certification Authorities)\n - ROOT (Trusted Root Certification Authorities)\n - TRUSTEDPUBLISHER (Trusted Publishers)\n - CLIENTAUTHISSUER (Client Authentication Issuers)\n - REMOTE DESKTOP (Remote Desktop)\n - TRUSTEDDEVICES (Trusted Devices)\n - WEBHOSTING (Web Hosting)\n - AUTHROOT (Third-Party Root Certification Authorities)\n - TRUSTEDPEOPLE (Trusted People)\n - SMARTCARDROOT (Smart Card Trusted Roots)\n - TRUST (Enterprise Trust)\n - DISALLOWED (Untrusted Certificates)\n- `user_store` - if false (default) then use the local machine store; if true then use the current user's store.\n\n#### Examples\n\n```ruby\n# Add PFX cert to local machine personal store and grant accounts read-only access to private key\nwindows_certificate \"c:/test/mycert.pfx\" do\n pfx_password \"password\"\n private_key_acl [\"acme\\fred\", \"pc\\jane\"]\nend\n```\n\n```ruby\n# Add cert to trusted intermediate store\nwindows_certificate \"c:/test/mycert.cer\" do\n store_name \"CA\"\nend\n```\n\n```ruby\n# Remove all certificates matching the subject\nwindows_certificate \"me.acme.com\" do\n action :delete\nend\n```\n\n### windows_certificate_binding\n\nBinds a certificate to an HTTP port in order to enable TLS communication.\n\n#### Actions\n\n- `:create` - creates or updates a binding.\n- `:delete` - deletes a binding.\n\n#### Properties\n\n- `cert_name` - name attribute. The thumbprint(hash) or subject that identifies the certificate to be bound.\n- `name_kind` - indicates the type of cert_name. One of :subject (default) or :hash.\n- `address` - the address to bind against. Default is 0.0.0.0 (all IP addresses). One of:\n - IP v4 address `1.2.3.4`\n - IP v6 address `[::1]`\n - Host name `www.foo.com`\n- `port` - the port to bind against. Default is 443.\n- `app_id` - the GUID that defines the application that owns the binding. Default is the values used by IIS.\n- `store_name` - the store to locate the certificate in. One of:\n - MY (Personal)\n - CA (Intermediate Certification Authorities)\n - ROOT (Trusted Root Certification Authorities)\n - TRUSTEDPUBLISHER (Trusted Publishers)\n - CLIENTAUTHISSUER (Client Authentication Issuers)\n - REMOTE DESKTOP (Remote Desktop)\n - TRUSTEDDEVICES (Trusted Devices)\n - WEBHOSTING (Web Hosting)\n - AUTHROOT (Third-Party Root Certification Authorities)\n - TRUSTEDPEOPLE (Trusted People)\n - SMARTCARDROOT (Smart Card Trusted Roots)\n - TRUST (Enterprise Trust)\n\n#### Examples\n\n```ruby\n# Bind the first certificate matching the subject to the default TLS port\nwindows_certificate_binding \"me.acme.com\" do\nend\n```\n\n```ruby\n# Bind a cert from the CA store with the given hash to port 4334\nwindows_certificate_binding \"me.acme.com\" do\n cert_name \"d234567890a23f567c901e345bc8901d34567890\"\n name_kind :hash\n store_name \"CA\"\n port 4334\nend\n```\n\n### windows_dns\n\nConfigures A and CNAME records in Windows DNS. This requires the DNSCMD to be installed, which is done by adding the DNS role to the server or installing the Remote Server Admin Tools.\n\n#### Actions\n\n- :create: creates/updates the DNS entry\n- :delete: deletes the DNS entry\n\n#### Properties\n\n- host_name: name attribute. FQDN of the entry to act on.\n- dns_server: the DNS server to update. Default is local machine (.)\n- record_type: the type of record to create. One of A (default) or CNAME\n- target: for A records an array of IP addresses to associate with the host; for CNAME records the FQDN of the host to alias\n- ttl: if > 0 then set the time to live of the record\n\n#### Examples\n\n```ruby\n# Create A record linked to 2 addresses with a 10 minute ttl\nwindows_dns \"m1.chef.test\" do\n target ['10.9.8.7', '1.2.3.4']\n ttl 600\nend\n```\n\n```ruby\n# Delete records. target is mandatory although not used\nwindows_dns \"m1.chef.test\" do\n action :delete\n target []\nend\n```\n\n```ruby\n# Set an alias against the node in a role\nnodes = search( :node, \"role:my_service\" )\nwindows_dns \"myservice.chef.test\" do\n record_type 'CNAME'\n target nodes[0]['fqdn']\nend\n```\n\n### windows_feature\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\n**BREAKING CHANGE - Version 3.0.0**\n\nThis 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`.\n\nWindows 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'.\n\nThis resource allows you to manage these 'features' in an unattended, idempotent way.\n\nThere are two underlying resources that power `windows_feature` which map to the available installation systems on supported releases of Windows: [Deployment Image Servicing and Management (DISM)](http://msdn.microsoft.com/en-us/library/dd371719%28v=vs.85%29.aspx) and [PowerShell](https://technet.microsoft.com/en-us/library/cc731774(v=ws.11).aspx). Chef will set the default method to `:windows_feature_dism` if `dism.exe` is present on the system being configured and otherwise use `:windows_feature_powershell`.\n\nFor 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:\n\nFor Dism:\n\n```text\ndism /online /Get-Features\n```\n\nFor PowerShell:\n\n```text\nget-windowsfeature\n```\n\n#### Actions\n\n- `:install` - install a Windows role/feature\n- `:remove` - remove a Windows role/feature\n- `:delete` - remove a Windows role/feature from the image\n\n#### Properties\n\n- `feature_name` - name of the feature/role(s) to install. The same feature may have different names depending on the underlying resource being used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS).\n- `all` - Boolean. Optional. Default: false. For DISM this is the equivalent of specifying the /All switch to dism.exe, forcing all parent dependencies to be installed. With the PowerShell install method, the `-InstallAllSubFeatures` switch is applied. Note that these two methods may not produce identical results.\n- `management_tools` - Boolean. Optional. Default: false. PowerShell only. Includes the `-IncludeManagementTools` switch. Installs all applicable management tools of the roles, role services, or features specified by the feature name.\n- `source` - String. Optional. Uses local repository for feature install.\n- `timeout` - Integer. Optional. Default: 600\\. Specifies a timeout (in seconds) for feature install.\n- `install_method` - Symbol. Optional. If not supplied, Chef will determine which method to use (in the order of `:windows_feature_dism`, `:windows_feature_servercmd`, `:windows_feature_powershell`)\n\n#### Examples\n\nInstall the DHCP Server feature\n\n```ruby\nwindows_feature 'DHCPServer' do\n action :install\nend\n```\n\nInstall the .Net 3.5.1 feature on Server 2012 using repository files on DVD and install all dependencies with a timeout of 900 seconds\n\n```ruby\nwindows_feature \"NetFx3\" do\n action :install\n all true\n source \"d:\\sources\\sxs\"\n timeout 900\nend\n```\n\nRemove Telnet Server and Client features\n\n```ruby\nwindows_feature ['TelnetServer', 'TelnetClient'] do\n action :remove\nend\n```\n\nAdd the SMTP Server feature using the PowerShell provider\n\n```ruby\nwindows_feature \"smtp-server\" do\n action :install\n all true\n install_method :windows_feature_powershell\nend\n```\n\nInstall multiple features using one resource with the PowerShell provider\n\n```ruby\nwindows_feature ['Web-Asp-Net45', 'Web-Net-Ext45'] do\n action :install\n install_method :windows_feature_powershell\nend\n```\n\nInstall the Network Policy and Access Service feature, including the management tools. Which, for this example, will automatically install `RSAT-NPAS` as well.\n\n```ruby\nwindows_feature 'NPAS' do\n action :install\n management_tools true\n install_method :windows_feature_powershell\nend\n```\n\n### windows_font\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\nInstalls font files. Sources the font by default from the cookbook, but a URI source can be specified as well.\n\n#### Actions\n\n- `:install` - install a font to the system fonts directory.\n\n#### Properties\n\n- `font_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.\n- `source` - A local filesystem path or URI to source the font file from..\n\n#### Examples\n\n```ruby\nwindows_font 'Code New Roman.otf'\n\nwindows_font 'Custom.otf' do\n source \"https://example.com/Custom.otf\"\nend\n```\n\n### windows_http_acl\n\nSets the Access Control List for an http URL to grant non-admin accounts permission to open HTTP endpoints.\n\n#### Actions\n\n- `:create` - creates or updates the ACL for a URL.\n- `:delete` - deletes the ACL from a URL.\n\n#### Properties\n\n- `url` - the name of the url to be created/deleted.\n- `sddl` - the DACL string configuring all permissions to URL. Mandatory for create if user is not provided. Can't be use with `user`.\n- `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. If you receive a parameter error your user may not exist.\n\n#### Examples\n\n```ruby\nwindows_http_acl 'http://+:50051/' do\n user 'pc\\\\fred'\nend\n```\n\n```ruby\n# Grant access to users \"NT SERVICE\\WinRM\" and \"NT SERVICE\\Wecsvc\" via sddl\nwindows_http_acl 'http://+:5985/' do\n sddl 'D:(A;;GX;;;S-1-5-80-569256582-2953403351-2909559716-1301513147-412116970)(A;;GX;;;S-1-5-80-4059739203-877974739-1245631912-527174227-2996563517)'\nend\n```\n\n```ruby\nwindows_http_acl 'http://+:50051/' do\n action :delete\nend\n```\n\n### windows_pagefile\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\nConfigures 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.\n\n#### Actions\n\n- `:set` - configures the default pagefile, creating if it doesn't exist.\n- `:delete` - deletes the specified pagefile.\n\n#### Properties\n\n- `path` - the path to the pagefile, String, name_property: true\n- `system_managed` - configures whether the system manages the pagefile size. [true, false]\n- `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\n- `initial_size` - initial size of the pagefile in megbytes. Integer\n- `maximum_size` - maximum size of the pagefile in megbytes. Integer\n\n### windows_printer_port\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\nCreate and delete TCP/IPv4 printer ports.\n\n#### Actions\n\n- `:create` - Create a TCIP/IPv4 printer port. This is the default action.\n- `:delete` - Delete a TCIP/IPv4 printer port\n\n#### Properties\n\n- `ipv4_address` - Name attribute. Required. IPv4 address, e.g. '10.0.24.34'\n- `port_name` - Port name. Optional. Defaults to 'IP_' + `ipv4_address`\n- `port_number` - Port number. Optional. Defaults to 9100.\n- `port_description` - Port description. Optional.\n- `snmp_enabled` - Boolean. Optional. Defaults to false.\n- `port_protocol` - Port protocol, 1 (RAW), or 2 (LPR). Optional. Defaults to 1.\n\n#### Examples\n\nCreate a TCP/IP printer port named 'IP_10.4.64.37' with all defaults\n\n```ruby\nwindows_printer_port '10.4.64.37' do\n action :create\nend\n```\n\nDelete a printer port\n\n```ruby\nwindows_printer_port '10.4.64.37' do\n action :delete\nend\n```\n\nDelete a port with a custom port_name\n\n```ruby\nwindows_printer_port '10.4.64.38' do\n port_name 'My awesome port'\n action :delete\nend\n```\n\nCreate a port with more options\n\n```ruby\nwindows_printer_port '10.4.64.39' do\n port_name 'My awesome port'\n snmp_enabled true\n port_protocol 2\nend\n```\n\n### windows_printer\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\nCreate Windows printer. Note that this doesn't currently install a printer driver. You must already have the driver installed on the system.\n\nThe Windows Printer resource 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` resource before creating the printer.\n\n#### Actions\n\n- `:create` - Create a new printer\n- `:delete` - Delete an existing printer\n\n#### Properties\n\n- `device_id` - Printer queue name, e.g. 'HP LJ 5200 in fifth floor copy room'. Name property.\n- `comment` - Optional string describing the printer queue.\n- `default` - Boolean. Optional. Defaults to false. Note that Windows sets the first printer defined to the default printer regardless of this setting.\n- `driver_name` - String. Required. Exact name of printer driver. Note that the printer driver must already be installed on the node.\n- `location` - Printer location, e.g. 'Fifth floor copy room', or 'US/NYC/Floor42/Room4207'\n- `shared` - Boolean. Defaults to false.\n- `share_name` - Printer share name.\n- `ipv4_address` - Printer's IPv4 address, e.g. '10.4.64.23'. You don't have to be able to ping the IP address to set it. Required.\n\nAn error of \"Set-WmiInstance : Generic failure\" is most likely due to the printer driver name not matching or not being installed.\n\n#### Examples\n\nCreate a printer\n\n```ruby\nwindows_printer 'HP LaserJet 5th Floor' do\n driver_name 'HP LaserJet 4100 Series PCL6'\n ipv4_address '10.4.64.38'\nend\n```\n\nDelete a printer. Note: this doesn't delete the associated printer port. See `windows_printer_port` above for how to delete the port.\n\n```ruby\nwindows_printer 'HP LaserJet 5th Floor' do\n action :delete\nend\n```\n\n### windows_share\n\n`Note`: This resource is now included in Chef 14.7 and later. There is no need to depend on the Windows cookbook for this resource.\n\nCreates, modifies and removes Windows shares. All properties are idempotent.\n\n`Note`: This resource uses PowerShell cmdlets introduced in Windows 2012/8.\n\n#### Actions\n\n- `:create`: creates/modifies a share\n- `:delete`: deletes a share\n\n#### Properties\n\nproperty | type | default | description\n------------------------ | ---------- | ------------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------\n`share_name` | String | resource name | the share to assign to the share\n`path` | String | | The path of the location of the folder to share. Required when creating. If the share already exists on a different path then it is deleted and re-created.\n`description` | String | | description to be applied to the share\n`full_users` | Array | [] | users which should have \"Full control\" permissions\n`change_users` | Array | [] | Users are granted modify permission to access the share.\n`read_users` | Array | [] | users which should have \"Read\" permissions\n`temporary` | True/False | false | The lifetime of the new SMB share. A temporary share does not persist beyond the next restart of the computer\n`scope_name` | String | '*' | The scope name of the share.\n`ca_timeout` | Integer | 0 | The continuous availability time-out for the share.\n`continuously_available` | True/False | false | Indicates that the share is continuously available.\n`concurrent_user_limit` | Integer | 0 (unlimited) | The maximum number of concurrently connected users the share can accommodate\n`encrypt_data` | True/False | false | Indicates that the share is encrypted.\n\n#### Examples\n\n```ruby\nwindows_share \"foo\" do\n action :create\n path \"C:\\\\foo\"\n full_users [\"DOMAIN_A\\\\some_user\", \"DOMAIN_B\\\\some_other_user\"]\n read_users [\"DOMAIN_C\\\\Domain users\"]\nend\n```\n\n```ruby\nwindows_share \"foo\" do\n action :delete\nend\n```\n\n### windows_shortcut\n\n`Note`: This resource is now included in Chef 14 and later. There is no need to depend on the Windows cookbook for this resource.\n\nCreates and modifies Windows shortcuts.\n\n#### Actions\n\n- `:create` - create or modify a windows shortcut\n\n#### Properties\n\n- `shortcut_name` - The name for the shortcut if it differs from the resource name. Name property\n- `target` - Where the shortcut links to.\n- `arguments` - arguments to pass to the target when the shortcut is executed\n- `description` - description of the shortcut\n- `cwd` - Working directory to use when the target is executed\n- `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))\n\n#### Examples\n\nAdd a shortcut to all users desktop:\n\n```ruby\nrequire 'win32ole'\nall_users_desktop = WIN32OLE.new(\"WScript.Shell\").SpecialFolders(\"AllUsersDesktop\")\n\nwindows_shortcut \"#{all_users_desktop}/Notepad.lnk\" do\n target \"C:\\\\Windows\\\\notepad.exe\"\n description \"Launch Notepad\"\n iconlocation \"C:\\\\Windows\\\\notepad.exe,0\"\nend\n```\n\n### windows_path\n\n#### Actions\n\n- `:add` - Add an item to the system path\n- `:remove` - Remove an item from the system path\n\n#### Properties\n\n- `path` - Name attribute. The name of the value to add to the system path\n\n#### Examples\n\nAdd Sysinternals to the system path\n\n```ruby\nwindows_path 'C:\\Sysinternals' do\n action :add\nend\n```\n\nRemove 7-Zip from the system path\n\n```ruby\nwindows_path 'C:\\7-Zip' do\n action :remove\nend\n```\n\n### windows_user_privilege\n\nAdds the `principal` (User/Group) to the specified privileges (such as `Logon as a batch job` or `Logon as a Service`).\n\n#### Actions\n\n- `:add` - add the specified privileges to the `principal`\n- `:remove` - remove the specified privilege of the `principal`\n\n#### Properties\n\n- `principal` - Name attribute, Required, String. The user or group to be granted privileges.\n- `privilege` - Required, String/Array. The privilege(s) to be granted.\n\n#### Examples\n\nGrant the Administrator user the `Logon as a batch job` and `Logon as a service` privilege.\n\n```ruby\nwindows_user_privilege 'Administrator' do\n privilege %w(SeBatchLogonRight SeServiceLogonRight)\nend\n```\n\nRemove `Logon as a batch job` privilege of Administrator.\n\n```ruby\nwindows_user_privilege 'Administrator' do\n privilege %w(SeBatchLogonRight)\n action :remove\nend\n```\n\n#### Available Privileges\n\n```\nSeTrustedCredManAccessPrivilege Access Credential Manager as a trusted caller\nSeNetworkLogonRight Access this computer from the network\nSeTcbPrivilege Act as part of the operating system\nSeMachineAccountPrivilege Add workstations to domain\nSeIncreaseQuotaPrivilege Adjust memory quotas for a process\nSeInteractiveLogonRight Allow log on locally\nSeRemoteInteractiveLogonRight Allow log on through Remote Desktop Services\nSeBackupPrivilege Back up files and directories\nSeChangeNotifyPrivilege Bypass traverse checking\nSeSystemtimePrivilege Change the system time\nSeTimeZonePrivilege Change the time zone\nSeCreatePagefilePrivilege Create a pagefile\nSeCreateTokenPrivilege Create a token object\nSeCreateGlobalPrivilege Create global objects\nSeCreatePermanentPrivilege Create permanent shared objects\nSeCreateSymbolicLinkPrivilege Create symbolic links\nSeDebugPrivilege Debug programs\nSeDenyNetworkLogonRight Deny access this computer from the network\nSeDenyBatchLogonRight Deny log on as a batch job\nSeDenyServiceLogonRight Deny log on as a service\nSeDenyInteractiveLogonRight Deny log on locally\nSeDenyRemoteInteractiveLogonRight Deny log on through Remote Desktop Services\nSeEnableDelegationPrivilege Enable computer and user accounts to be trusted for delegation\nSeRemoteShutdownPrivilege Force shutdown from a remote system\nSeAuditPrivilege Generate security audits\nSeImpersonatePrivilege Impersonate a client after authentication\nSeIncreaseWorkingSetPrivilege Increase a process working set\nSeIncreaseBasePriorityPrivilege Increase scheduling priority\nSeLoadDriverPrivilege Load and unload device drivers\nSeLockMemoryPrivilege Lock pages in memory\nSeBatchLogonRight Log on as a batch job\nSeServiceLogonRight Log on as a service\nSeSecurityPrivilege Manage auditing and security log\nSeRelabelPrivilege Modify an object label\nSeSystemEnvironmentPrivilege Modify firmware environment values\nSeManageVolumePrivilege Perform volume maintenance tasks\nSeProfileSingleProcessPrivilege Profile single process\nSeSystemProfilePrivilege Profile system performance\nSeUnsolicitedInputPrivilege \"Read unsolicited input from a terminal device\"\nSeUndockPrivilege Remove computer from docking station\nSeAssignPrimaryTokenPrivilege Replace a process level token\nSeRestorePrivilege Restore files and directories\nSeShutdownPrivilege Shut down the system\nSeSyncAgentPrivilege Synchronize directory service data\nSeTakeOwnershipPrivilege Take ownership of files or other objects\n```\n\n### windows_zipfile\n\nMost 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.\n\n#### Actions\n\n- `:unzip` - unzip a compressed file\n- `:zip` - zip a directory (recursively)\n\n#### Properties\n\n- `path` - name attribute. The path where files will be (un)zipped to.\n- `source` - source of the zip file (either a URI or local path) for :unzip, or directory to be zipped for :zip.\n- `overwrite` - force an overwrite of the files if they already exist.\n- `checksum` - for :unzip, useful if source is remote, if the local file matches the SHA-256 checksum, Chef will not download it.\n\n#### Examples\n\nUnzip a remote zip file locally\n\n```ruby\nwindows_zipfile 'c:/bin' do\n source 'http://download.sysinternals.com/Files/SysinternalsSuite.zip'\n action :unzip\n not_if {::File.exists?('c:/bin/PsExec.exe')}\nend\n```\n\nUnzip a local zipfile\n\n```ruby\nwindows_zipfile 'c:/the_codez' do\n source 'c:/foo/baz/the_codez.zip'\n action :unzip\nend\n```\n\nCreate a local zipfile\n\n```ruby\nwindows_zipfile 'c:/foo/baz/the_codez.zip' do\n source 'c:/the_codez'\n action :zip\nend\n```\n\n## Libraries\n\n### WindowsHelper\n\nHelper that allows you to use helpful functions in windows\n\n#### installed_packages\n\nReturns a hash of all DisplayNames installed\n\n```ruby\n# usage in a recipe\n::Chef::Recipe.send(:include, Windows::Helper)\nhash_of_installed_packages = installed_packages\n```\n\n#### is_package_installed?\n\n- `package_name` - The name of the package you want to query to see if it is installed\n- `returns` - true if the package is installed, false if it the package is not installed\n\nDownload a file if a package isn't installed\n\n```ruby\n# usage in a recipe to not download a file if package is already installed\n::Chef::Recipe.send(:include, Windows::Helper)\nis_win_sdk_installed = is_package_installed?('Windows Software Development Kit')\n\nremote_file 'C:\\windows\\temp\\windows_sdk.zip' do\n source 'http://url_to_download/windows_sdk.zip'\n action :create_if_missing\n not_if {is_win_sdk_installed}\nend\n```\n\nDo something if a package is installed\n\n```ruby\n# usage in a provider\ninclude Windows::Helper\nif is_package_installed?('Windows Software Development Kit')\n # do something if package is installed\nend\n```\n\n### Windows::VersionHelper\n\nHelper 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.\n\n#### core_version?\n\nDetermines whether given node is running on a windows Core.\n\n```ruby\nif ::Windows::VersionHelper.core_version? node\n fail 'Windows Core is not supported'\nend\n```\n\n#### workstation_version?\n\nDetermines whether given node is a windows workstation version (XP, Vista, 7, 8, 8.1, 10)\n\n```ruby\nif ::Windows::VersionHelper.workstation_version? node\n fail 'Only server version of windows are supported'\nend\n```\n\n#### server_version?\n\nDetermines whether given node is a windows server version (Server 2003, Server 2008, Server 2012, Server 2016)\n\n```ruby\nif ::Windows::VersionHelper.server_version? node\n puts 'Server version of windows are cool'\nend\n```\n\n#### nt_version\n\nDetermines NT version of the given node\n\n```ruby\ncase ::Windows::VersionHelper.nt_version node\n when '6.0' then 'Windows vista or Server 2008'\n when '6.1' then 'Windows 7 or Server 2008R2'\n when '6.2' then 'Windows 8 or Server 2012'\n when '6.3' then 'Windows 8.1 or Server 2012R2'\n when '10.0' then 'Windows 10'\nend\n```\n\n## Usage\n\nPlace 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.\n\n```ruby\ndepends 'windows'\n```\n\n## License & Authors\n\n- Author:: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io))\n- Author:: Doug MacEachern ([dougm@vmware.com](mailto:dougm@vmware.com))\n- Author:: Paul Morton ([pmorton@biaprotect.com](mailto:pmorton@biaprotect.com))\n- Author:: Doug Ireton ([doug.ireton@nordstrom.com](mailto:doug.ireton@nordstrom.com))\n\n```text\nCopyright 2011-2018, Chef Software, Inc.\nCopyright 2010, VMware, Inc.\nCopyright 2011, Business Intelligence Associates, Inc\nCopyright 2012, Nordstrom, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"windows":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/windows","issues_url":"https://github.com/chef-cookbooks/windows/issues","chef_version":[[">= 13.4"]],"ohai_version":[]} \ No newline at end of file +{"name":"windows","version":"6.0.0","description":"Provides a set of useful Windows-specific primitives.","long_description":"# Windows Cookbook\n\n[![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)\n\nProvides a set of Windows-specific resources to aid in the creation of cookbooks/recipes targeting the Windows platform.\n\n## Requirements\n\n### Platforms\n\n- Windows 7\n- Windows Server 2008 R2\n- Windows 8, 8.1\n- Windows Server 2012 (R1, R2)\n- Windows Server 2016\n\n### Chef\n\n- Chef 14+\n\n## Resources\n\n### Deprecated Resources Note\n\nAs of Chef 14.7+ the windows_share and windows_certificate resources are now included in the Chef Client. If you are running Chef 14.7+ the resources in Chef client will take precedence over the resources in this cookbook. In November 2019 we will release a new major version of this cookbook that removes these resources.\n\n### windows_certificate\n\n`Note`: This resource is now included in Chef 14.7 and later. There is no need to depend on the Windows cookbook for this resource.\n\nInstalls 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.\n\n#### Actions\n\n- `:create` - creates or updates a certificate.\n- `:delete` - deletes a certificate.\n- `:acl_add` - adds read-only entries to a certificate's private key ACL.\n- `:verify` - logs whether or not a certificate is valid\n\n#### Properties\n\n- `source` - name attribute. The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete).\n- `pfx_password` - the password to access the source if it is a pfx file.\n- `private_key_acl` - array of 'domain\\account' entries to be granted read-only access to the certificate's private key. This is not idempotent.\n- `store_name` - the certificate store to manipulate. One of:\n - MY (Personal)\n - CA (Intermediate Certification Authorities)\n - ROOT (Trusted Root Certification Authorities)\n - TRUSTEDPUBLISHER (Trusted Publishers)\n - CLIENTAUTHISSUER (Client Authentication Issuers)\n - REMOTE DESKTOP (Remote Desktop)\n - TRUSTEDDEVICES (Trusted Devices)\n - WEBHOSTING (Web Hosting)\n - AUTHROOT (Third-Party Root Certification Authorities)\n - TRUSTEDPEOPLE (Trusted People)\n - SMARTCARDROOT (Smart Card Trusted Roots)\n - TRUST (Enterprise Trust)\n - DISALLOWED (Untrusted Certificates)\n- `user_store` - if false (default) then use the local machine store; if true then use the current user's store.\n\n#### Examples\n\n```ruby\n# Add PFX cert to local machine personal store and grant accounts read-only access to private key\nwindows_certificate \"c:/test/mycert.pfx\" do\n pfx_password \"password\"\n private_key_acl [\"acme\\fred\", \"pc\\jane\"]\nend\n```\n\n```ruby\n# Add cert to trusted intermediate store\nwindows_certificate \"c:/test/mycert.cer\" do\n store_name \"CA\"\nend\n```\n\n```ruby\n# Remove all certificates matching the subject\nwindows_certificate \"me.acme.com\" do\n action :delete\nend\n```\n\n### windows_certificate_binding\n\nBinds a certificate to an HTTP port in order to enable TLS communication.\n\n#### Actions\n\n- `:create` - creates or updates a binding.\n- `:delete` - deletes a binding.\n\n#### Properties\n\n- `cert_name` - name attribute. The thumbprint(hash) or subject that identifies the certificate to be bound.\n- `name_kind` - indicates the type of cert_name. One of :subject (default) or :hash.\n- `address` - the address to bind against. Default is 0.0.0.0 (all IP addresses). One of:\n - IP v4 address `1.2.3.4`\n - IP v6 address `[::1]`\n - Host name `www.foo.com`\n- `port` - the port to bind against. Default is 443.\n- `app_id` - the GUID that defines the application that owns the binding. Default is the values used by IIS.\n- `store_name` - the store to locate the certificate in. One of:\n - MY (Personal)\n - CA (Intermediate Certification Authorities)\n - ROOT (Trusted Root Certification Authorities)\n - TRUSTEDPUBLISHER (Trusted Publishers)\n - CLIENTAUTHISSUER (Client Authentication Issuers)\n - REMOTE DESKTOP (Remote Desktop)\n - TRUSTEDDEVICES (Trusted Devices)\n - WEBHOSTING (Web Hosting)\n - AUTHROOT (Third-Party Root Certification Authorities)\n - TRUSTEDPEOPLE (Trusted People)\n - SMARTCARDROOT (Smart Card Trusted Roots)\n - TRUST (Enterprise Trust)\n\n#### Examples\n\n```ruby\n# Bind the first certificate matching the subject to the default TLS port\nwindows_certificate_binding \"me.acme.com\" do\nend\n```\n\n```ruby\n# Bind a cert from the CA store with the given hash to port 4334\nwindows_certificate_binding \"me.acme.com\" do\n cert_name \"d234567890a23f567c901e345bc8901d34567890\"\n name_kind :hash\n store_name \"CA\"\n port 4334\nend\n```\n\n### windows_dns\n\nConfigures A and CNAME records in Windows DNS. This requires the DNSCMD to be installed, which is done by adding the DNS role to the server or installing the Remote Server Admin Tools.\n\n#### Actions\n\n- :create: creates/updates the DNS entry\n- :delete: deletes the DNS entry\n\n#### Properties\n\n- host_name: name attribute. FQDN of the entry to act on.\n- dns_server: the DNS server to update. Default is local machine (.)\n- record_type: the type of record to create. One of A (default) or CNAME\n- target: for A records an array of IP addresses to associate with the host; for CNAME records the FQDN of the host to alias\n- ttl: if > 0 then set the time to live of the record\n\n#### Examples\n\n```ruby\n# Create A record linked to 2 addresses with a 10 minute ttl\nwindows_dns \"m1.chef.test\" do\n target ['10.9.8.7', '1.2.3.4']\n ttl 600\nend\n```\n\n```ruby\n# Delete records. target is mandatory although not used\nwindows_dns \"m1.chef.test\" do\n action :delete\n target []\nend\n```\n\n```ruby\n# Set an alias against the node in a role\nnodes = search( :node, \"role:my_service\" )\nwindows_dns \"myservice.chef.test\" do\n record_type 'CNAME'\n target nodes[0]['fqdn']\nend\n```\n\n### windows_http_acl\n\nSets the Access Control List for an http URL to grant non-admin accounts permission to open HTTP endpoints.\n\n#### Actions\n\n- `:create` - creates or updates the ACL for a URL.\n- `:delete` - deletes the ACL from a URL.\n\n#### Properties\n\n- `url` - the name of the url to be created/deleted.\n- `sddl` - the DACL string configuring all permissions to URL. Mandatory for create if user is not provided. Can't be use with `user`.\n- `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. If you receive a parameter error your user may not exist.\n\n#### Examples\n\n```ruby\nwindows_http_acl 'http://+:50051/' do\n user 'pc\\\\fred'\nend\n```\n\n```ruby\n# Grant access to users \"NT SERVICE\\WinRM\" and \"NT SERVICE\\Wecsvc\" via sddl\nwindows_http_acl 'http://+:5985/' do\n sddl 'D:(A;;GX;;;S-1-5-80-569256582-2953403351-2909559716-1301513147-412116970)(A;;GX;;;S-1-5-80-4059739203-877974739-1245631912-527174227-2996563517)'\nend\n```\n\n```ruby\nwindows_http_acl 'http://+:50051/' do\n action :delete\nend\n```\n\n### windows_share\n\n`Note`: This resource is now included in Chef 14.7 and later. There is no need to depend on the Windows cookbook for this resource.\n\nCreates, modifies and removes Windows shares. All properties are idempotent.\n\n`Note`: This resource uses PowerShell cmdlets introduced in Windows 2012/8.\n\n#### Actions\n\n- `:create`: creates/modifies a share\n- `:delete`: deletes a share\n\n#### Properties\n\nproperty | type | default | description\n------------------------ | ---------- | ------------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------\n`share_name` | String | resource name | the share to assign to the share\n`path` | String | | The path of the location of the folder to share. Required when creating. If the share already exists on a different path then it is deleted and re-created.\n`description` | String | | description to be applied to the share\n`full_users` | Array | [] | users which should have \"Full control\" permissions\n`change_users` | Array | [] | Users are granted modify permission to access the share.\n`read_users` | Array | [] | users which should have \"Read\" permissions\n`temporary` | True/False | false | The lifetime of the new SMB share. A temporary share does not persist beyond the next restart of the computer\n`scope_name` | String | '*' | The scope name of the share.\n`ca_timeout` | Integer | 0 | The continuous availability time-out for the share.\n`continuously_available` | True/False | false | Indicates that the share is continuously available.\n`concurrent_user_limit` | Integer | 0 (unlimited) | The maximum number of concurrently connected users the share can accommodate\n`encrypt_data` | True/False | false | Indicates that the share is encrypted.\n\n#### Examples\n\n```ruby\nwindows_share \"foo\" do\n action :create\n path \"C:\\\\foo\"\n full_users [\"DOMAIN_A\\\\some_user\", \"DOMAIN_B\\\\some_other_user\"]\n read_users [\"DOMAIN_C\\\\Domain users\"]\nend\n```\n\n```ruby\nwindows_share \"foo\" do\n action :delete\nend\n```\n\n### windows_user_privilege\n\nAdds the `principal` (User/Group) to the specified privileges (such as `Logon as a batch job` or `Logon as a Service`).\n\n#### Actions\n\n- `:add` - add the specified privileges to the `principal`\n- `:remove` - remove the specified privilege of the `principal`\n\n#### Properties\n\n- `principal` - Name attribute, Required, String. The user or group to be granted privileges.\n- `privilege` - Required, String/Array. The privilege(s) to be granted.\n\n#### Examples\n\nGrant the Administrator user the `Logon as a batch job` and `Logon as a service` privilege.\n\n```ruby\nwindows_user_privilege 'Administrator' do\n privilege %w(SeBatchLogonRight SeServiceLogonRight)\nend\n```\n\nRemove `Logon as a batch job` privilege of Administrator.\n\n```ruby\nwindows_user_privilege 'Administrator' do\n privilege %w(SeBatchLogonRight)\n action :remove\nend\n```\n\n#### Available Privileges\n\n```\nSeTrustedCredManAccessPrivilege Access Credential Manager as a trusted caller\nSeNetworkLogonRight Access this computer from the network\nSeTcbPrivilege Act as part of the operating system\nSeMachineAccountPrivilege Add workstations to domain\nSeIncreaseQuotaPrivilege Adjust memory quotas for a process\nSeInteractiveLogonRight Allow log on locally\nSeRemoteInteractiveLogonRight Allow log on through Remote Desktop Services\nSeBackupPrivilege Back up files and directories\nSeChangeNotifyPrivilege Bypass traverse checking\nSeSystemtimePrivilege Change the system time\nSeTimeZonePrivilege Change the time zone\nSeCreatePagefilePrivilege Create a pagefile\nSeCreateTokenPrivilege Create a token object\nSeCreateGlobalPrivilege Create global objects\nSeCreatePermanentPrivilege Create permanent shared objects\nSeCreateSymbolicLinkPrivilege Create symbolic links\nSeDebugPrivilege Debug programs\nSeDenyNetworkLogonRight Deny access this computer from the network\nSeDenyBatchLogonRight Deny log on as a batch job\nSeDenyServiceLogonRight Deny log on as a service\nSeDenyInteractiveLogonRight Deny log on locally\nSeDenyRemoteInteractiveLogonRight Deny log on through Remote Desktop Services\nSeEnableDelegationPrivilege Enable computer and user accounts to be trusted for delegation\nSeRemoteShutdownPrivilege Force shutdown from a remote system\nSeAuditPrivilege Generate security audits\nSeImpersonatePrivilege Impersonate a client after authentication\nSeIncreaseWorkingSetPrivilege Increase a process working set\nSeIncreaseBasePriorityPrivilege Increase scheduling priority\nSeLoadDriverPrivilege Load and unload device drivers\nSeLockMemoryPrivilege Lock pages in memory\nSeBatchLogonRight Log on as a batch job\nSeServiceLogonRight Log on as a service\nSeSecurityPrivilege Manage auditing and security log\nSeRelabelPrivilege Modify an object label\nSeSystemEnvironmentPrivilege Modify firmware environment values\nSeManageVolumePrivilege Perform volume maintenance tasks\nSeProfileSingleProcessPrivilege Profile single process\nSeSystemProfilePrivilege Profile system performance\nSeUnsolicitedInputPrivilege \"Read unsolicited input from a terminal device\"\nSeUndockPrivilege Remove computer from docking station\nSeAssignPrimaryTokenPrivilege Replace a process level token\nSeRestorePrivilege Restore files and directories\nSeShutdownPrivilege Shut down the system\nSeSyncAgentPrivilege Synchronize directory service data\nSeTakeOwnershipPrivilege Take ownership of files or other objects\n```\n\n### windows_zipfile\n\nMost 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.\n\n#### Actions\n\n- `:unzip` - unzip a compressed file\n- `:zip` - zip a directory (recursively)\n\n#### Properties\n\n- `path` - name attribute. The path where files will be (un)zipped to.\n- `source` - source of the zip file (either a URI or local path) for :unzip, or directory to be zipped for :zip.\n- `overwrite` - force an overwrite of the files if they already exist.\n- `checksum` - for :unzip, useful if source is remote, if the local file matches the SHA-256 checksum, Chef will not download it.\n\n#### Examples\n\nUnzip a remote zip file locally\n\n```ruby\nwindows_zipfile 'c:/bin' do\n source 'http://download.sysinternals.com/Files/SysinternalsSuite.zip'\n action :unzip\n not_if {::File.exists?('c:/bin/PsExec.exe')}\nend\n```\n\nUnzip a local zipfile\n\n```ruby\nwindows_zipfile 'c:/the_codez' do\n source 'c:/foo/baz/the_codez.zip'\n action :unzip\nend\n```\n\nCreate a local zipfile\n\n```ruby\nwindows_zipfile 'c:/foo/baz/the_codez.zip' do\n source 'c:/the_codez'\n action :zip\nend\n```\n\n## Libraries\n\n### WindowsHelper\n\nHelper that allows you to use helpful functions in windows\n\n#### installed_packages\n\nReturns a hash of all DisplayNames installed\n\n```ruby\n# usage in a recipe\n::Chef::Recipe.send(:include, Windows::Helper)\nhash_of_installed_packages = installed_packages\n```\n\n#### is_package_installed?\n\n- `package_name` - The name of the package you want to query to see if it is installed\n- `returns` - true if the package is installed, false if it the package is not installed\n\nDownload a file if a package isn't installed\n\n```ruby\n# usage in a recipe to not download a file if package is already installed\n::Chef::Recipe.send(:include, Windows::Helper)\nis_win_sdk_installed = is_package_installed?('Windows Software Development Kit')\n\nremote_file 'C:\\windows\\temp\\windows_sdk.zip' do\n source 'http://url_to_download/windows_sdk.zip'\n action :create_if_missing\n not_if {is_win_sdk_installed}\nend\n```\n\nDo something if a package is installed\n\n```ruby\n# usage in a provider\ninclude Windows::Helper\nif is_package_installed?('Windows Software Development Kit')\n # do something if package is installed\nend\n```\n\n### Windows::VersionHelper\n\nHelper 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.\n\n#### core_version?\n\nDetermines whether given node is running on a windows Core.\n\n```ruby\nif ::Windows::VersionHelper.core_version? node\n fail 'Windows Core is not supported'\nend\n```\n\n#### workstation_version?\n\nDetermines whether given node is a windows workstation version (XP, Vista, 7, 8, 8.1, 10)\n\n```ruby\nif ::Windows::VersionHelper.workstation_version? node\n fail 'Only server version of windows are supported'\nend\n```\n\n#### server_version?\n\nDetermines whether given node is a windows server version (Server 2003, Server 2008, Server 2012, Server 2016)\n\n```ruby\nif ::Windows::VersionHelper.server_version? node\n puts 'Server version of windows are cool'\nend\n```\n\n#### nt_version\n\nDetermines NT version of the given node\n\n```ruby\ncase ::Windows::VersionHelper.nt_version node\n when '6.0' then 'Windows vista or Server 2008'\n when '6.1' then 'Windows 7 or Server 2008R2'\n when '6.2' then 'Windows 8 or Server 2012'\n when '6.3' then 'Windows 8.1 or Server 2012R2'\n when '10.0' then 'Windows 10'\nend\n```\n\n## Usage\n\nPlace 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.\n\n```ruby\ndepends 'windows'\n```\n\n## License & Authors\n\n- Author:: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io))\n- Author:: Doug MacEachern ([dougm@vmware.com](mailto:dougm@vmware.com))\n- Author:: Paul Morton ([pmorton@biaprotect.com](mailto:pmorton@biaprotect.com))\n- Author:: Doug Ireton ([doug.ireton@nordstrom.com](mailto:doug.ireton@nordstrom.com))\n\n```text\nCopyright 2011-2018, Chef Software, Inc.\nCopyright 2010, VMware, Inc.\nCopyright 2011, Business Intelligence Associates, Inc\nCopyright 2012, Nordstrom, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"windows":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/windows","issues_url":"https://github.com/chef-cookbooks/windows/issues","chef_version":[[">= 14"]],"ohai_version":[]} \ No newline at end of file diff --git a/cookbooks/windows/metadata.rb b/cookbooks/windows/metadata.rb index 61c0255..f65f147 100644 --- a/cookbooks/windows/metadata.rb +++ b/cookbooks/windows/metadata.rb @@ -4,8 +4,8 @@ license 'Apache-2.0' description 'Provides a set of useful Windows-specific primitives.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '5.3.0' +version '6.0.0' supports 'windows' source_url 'https://github.com/chef-cookbooks/windows' issues_url 'https://github.com/chef-cookbooks/windows/issues' -chef_version '>= 13.4' +chef_version '>= 14'