diff --git a/.gitignore b/.gitignore index e079c64..9467afc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ bin/* .kitchen.local.*.yml .delivery/cli.toml + +.vscode diff --git a/.kitchen.yml b/.kitchen.yml index 828f1a7..fc17453 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -21,9 +21,10 @@ provisioner: - 35 # 35 is the exit code signaling that the node is rebooting - 259 # WinRM error during kitchen test when rebooting after installing .NET 4.5.2 max_retries: 2 + wait_for_retry: 120 client_rb: exit_status: :enabled # Opt-in to the standardized exit codes - client_fork: false # Forked instances don't return the real exit code + client_fork: false # Forked instances don't return the real exit code verifier: name: inspec @@ -44,19 +45,19 @@ suites: - recipe[veeam::catalog] verifier: inspec_tests: - - test/inspec/9.5.0.711/catalog + - test/inspec/10.0.0.4461/catalog attributes: veeam: - version: '9.5' + version: "10.0" - name: console run_list: - recipe[veeam::console] verifier: inspec_tests: - - test/inspec/9.5.0.711/console + - test/inspec/10.0.0.4461/console attributes: veeam: - version: '9.5' + version: "10.0" console: accept_eula: true - name: server @@ -64,10 +65,10 @@ suites: - recipe[veeam::server] verifier: inspec_tests: - - test/inspec/9.5.0.711/server + - test/inspec/10.0.0.4461/server attributes: veeam: - version: '9.5' + version: "10.0" server: accept_eula: true - name: server_with_console @@ -75,11 +76,11 @@ suites: - recipe[veeam::server_with_console] verifier: inspec_tests: - - test/inspec/9.5.0.711/server - - test/inspec/9.5.0.711/console + - test/inspec/10.0.0.4461/server + - test/inspec/10.0.0.4461/console attributes: veeam: - version: '9.5' + version: "10.0" server: accept_eula: true console: @@ -89,11 +90,11 @@ suites: - recipe[veeam::server_with_catalog] verifier: inspec_tests: - - test/inspec/9.5.0.711/catalog - - test/inspec/9.5.0.711/server + - test/inspec/10.0.0.4461/catalog + - test/inspec/10.0.0.4461/server attributes: veeam: - version: '9.5' + version: "10.0" server: accept_eula: true - name: standalone_complete @@ -101,12 +102,12 @@ suites: - recipe[veeam::standalone_complete] verifier: inspec_tests: - - test/inspec/9.5.0.711/catalog - - test/inspec/9.5.0.711/server - - test/inspec/9.5.0.711/console + - test/inspec/10.0.0.4461/catalog + - test/inspec/10.0.0.4461/server + - test/inspec/10.0.0.4461/console attributes: veeam: - version: '9.5' + version: "10.0" server: accept_eula: true console: @@ -116,10 +117,10 @@ suites: - recipe[veeam::proxy_server] verifier: inspec_tests: - - test/inspec/9.5.0.711/console + - test/inspec/10.0.0.4461/console attributes: veeam: - version: '9.5' + version: "10.0" console: accept_eula: true proxy: @@ -129,10 +130,10 @@ suites: - recipe[veeam::proxy_remove] verifier: inspec_tests: - - test/inspec/9.5.0.711/console + - test/inspec/10.0.0.4461/console attributes: veeam: - version: '9.5' + version: "10.0" console: accept_eula: true proxy: @@ -143,10 +144,10 @@ suites: - recipe[veeam::upgrade] verifier: inspec_tests: - - test/inspec/9.5.0.711/server + - test/inspec/10.0.0.4461/server attributes: veeam: - version: '9.5.0.1536' + version: "10.0.0.4461" server: accept_eula: true console: diff --git a/.rubocop.yml b/.rubocop.yml index a75cf18..02880fd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,10 +4,12 @@ Metrics/LineLength: Max: 120 Style/FrozenStringLiteralComment: Enabled: false -Style/TrailingCommaInLiteral: - # ChefAutomate will throw an error due to chages in protocol after - # Rubocop 0.39.0. +Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: no_comma +# Style/TrailingCommaInLiteral: +# # ChefAutomate will throw an error due to chages in protocol after +# # Rubocop 0.39.0. +# EnforcedStyleForMultiline: no_comma EndOfLine: # This is an unnecessary test and will cause issues with testing on Windows. Enabled: false diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ff45a1a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "workbench.colorTheme": "Solarized Dark" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 82eb37a..ca01729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # Change log information for Veeam Cookbook +## Version 4.0.3 +2020-08-14 + +UPDATE: Library::Helper to include 10.0.1.4854 (10.0a) installation +UPDATE: Resource::Console to correct product version to look at individual solution +UPDATE: Resource::Catalog to correct product version to look at individual solution + +## Version 4.0.2 +2020-08-12 + +Updated - Changed SQL authentication mode from "Mixed" to "Windows" +Updated the upgrade process to handle incremental upgrades and setting the correct build_version based on the package_url + +## Version 4.0.1 +2020-08-6 + +Added support for Veeam 9.5.4b + +## Version 4.0.0 +2020-07-15 + +Major update to include support for Veeam 10.0.0 including changes to the method for installation of SQL Express and supported .NET Framework + +### Included: + +- UPDATE: Libraries::Helper to support v10.0+ +- UPDATE: Resources::Prerequisites to handle new library methods to look up dotnet and sqlexpress versions +- UPDATE: Templates::sql_build_script to pass sqlexpress media path from helper +- ADD: Inspec::10.0.0.4461 tests +- UPDATE: Spec::lwrps/veeam_prerequisites_spec to support Chef 13+ +- UPDATE: Resources::Host to add script marker comments for stubs +- UPDATE: Resources::Proxy to add script marker comments for stubs +- UPDATE: Unit tests with new shell_out_compacted method for command stubbing +- UPDATE: all files to support updated rubcop and foodcritic standards +- UPDATE: Helpers::ExtractInstaller to use archive_file resource +- UPDATE: CHANGELOG.md +- UPDATE: README.md +- BUMP: Metadata 4.0.0 + ## Version 3.0.2 2020-07-24 @@ -10,6 +49,42 @@ Minor fix update for SQL Express installation on domain joined computer. Minor fix update to include `delay_min 1` to all reboot resources to cover a chef bug that lets some test-kitchen environments crash. +## Version 3.0.0 +2019-01-22 + +Major update to include support for Veeam 9.5.4 including changes to the method for installation and upgrades + +### Included: + +- UPDATE: Kitchen.yml typo +- UPDATE: Libraries::Helper to enhance prerequisites versions +- UPDATE: Libraries::Helper to include support to ignore_errors in validate_cmd method when called from method find_current_veeam_version +- UPDATE: Libraries::Helper to include version information for explorers and win_clean_path helper +- UPDATE: Libraries::Helper to include links for 9.5.4 + +- UPDATE: Recipes::Catalog to include calling veeam_upgrade by default +- UPDATE: Recipes::Console to include veaam_upgrade +- UPDATE: Recipes::HostMgmt to support 9.5.4 +- ADD: Recipes::Prerequisites +- UPDATE: Recipes::ProxyServer to support 9.5.4 +- UPDATE: Recipes::Server to support 9.5.4 +- UPDATE: Recipes::ServerWithConsole to include upgrades and build version handling +- UPDATE: Recipes::StandaloneComplete to support 9.5.4 + +- UPDATE: Resources to use win_clean_path instead of win_friendly_path from Windows Cookbook +- UPDATE: Resources::Catalog to handle installation of 9.5.4 media and upgrades of the current version from 9.5.0 to 9.5.4 when version is selected +- UPDATE: Resources::Console to support upgrading and installing 9.5.4 +- UPDATE: Resources::Explorer to support 9.5.4 version upgrades +- UPDATE: Resources::Prerequisites to support new version of SQL Express installation based on the build_version +- UPDATE: Resources::Server to enable support for upgrading the version to 9.5.4 +- UPDATE: Resources::Upgrade to initiate an upgrade when the Veeam Backup Catalog version does not match the requested build version + +- UPDATE: Templates::SqlBuildScript to handle installation of SQL Express 2016 when performing a new installation of 9.5 Update 4 +- ADD: Test::Inspec/9.5.4 + +- UPDATE: README +- BUMP: Metadata to Version 3.0.0 + ## Version 2.1.1 2018-08-25 diff --git a/README.md b/README.md index 2398c92..9f96d32 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ The installation of SQL Express requires that a temporary Scheduled Task be crea ### Chef -- Chef 12.5+ +- Chef 16.2+ ### Cookbooks @@ -88,7 +88,7 @@ The installation of SQL Express requires that a temporary Scheduled Task be crea ### Installation Media | Attribute | Type | Description | Default Value | Mandatory | | --- | --- | --- | --- | --- | -| `node['veeam']['version']` | String. | Base version of Veeam to install and used to download the appropriate ISO. Supported versions are '9.0' and '9.5' | '9.5' | | +| `node['veeam']['version']` | String. | Base version of Veeam to install and used to download the appropriate ISO. Supported versions are '9.0', '9.5' and '10.0 | '10.0' | | | `node['veeam']['installer']['package_url']` | String. | Custom URL for the Veeam Backup and Replication ISO. If not provided, then the ISO will be downloaded directly from Veeam | nil | | | `node['veeam']['installer']['package_checksum']` | String. | Sha256 hash of the remote ISO file. Required when setting the `node['veeam']['installer']['package_url']`| nil | | | `node['veeam']['license_url']` | String. | URL for downloading the license filed used by this server. If not provided, the [license data_bag](#veeam-backup-and-replication-license-file) will be checked or the software will be installed in evaluation mode. | nil | | @@ -130,7 +130,6 @@ The installation of SQL Express requires that a temporary Scheduled Task be crea | `node['veeam']['server']['vbr_sqlserver_password']` | String | This parameter must be used if you have specified the `VBR_SQLSERVER_AUTHENTICATION` parameter. Specifies a password to connect to the Microsoft SQL Server in the SQL Server authentication mode. | nil | | | `node['veeam']['server']['pf_ad_nfsdatastore']` | String | Specifies the vPower NFS root folder to which Instant VM Recovery cache will be stored. | C:\ProgramData\Veeam\Backup\NfsDatastore\ | | | `node['veeam']['server']['keep_media']` | TrueFalse | Determines if the recipe should keep the media at the end of the installation. | false | | -| `node['sql_server']['server_sa_password']` | String | Configures the SQL Admin password for the SQLExpress instance. | 'Veeam1234' | | | `node['veeam']['server']['explorers']` | Array. List of Veeam Explorers to install. | 'ActiveDirectory','Exchange','SQL','Oracle','SharePoint' | | ### Console @@ -183,18 +182,26 @@ The attribute `node['veeam']['version']` is used to evaluate the ISO download pa | **9.5.0.1536** | [VeeamBackup&Replication_9.5.0.1536.Update3.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.iso) | 5020ef015e4d9ff7070d43cf477511a2b562d8044975552fd08f82bdcf556a43 | | **9.5.0.1922** | [VeeamBackup&Replication_9.5.0.1922.Update3a.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.iso) | 9a6fa7d857396c058b2e65f20968de56f96bc293e0e8fd9f1a848c7d71534134 | | **9.5.4.2615** | [VeeamBackup&Replication_9.5.4.2615.Update4.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso) | 8a594cec74059f9929ea765ac5e70a49da6fc93803b567cbb9d74fbb1a49a6cc | +| **9.5.4.2866** | [VeeamBackup&Replication_9.5.4.2866.Update4b_20191210.iso](https://download2.veeam.com/VeeamBackup&Replication_9.5.4.2866.Update4b_20191210.iso) | cfc41596154563f60b74320634589721fd1110c87e04632068bc5234aada342e | +| **10.0** | [VeeamBackup&Replication_10.0.0.4461.iso](http://download.veeam.com/VeeamBackup&Replication_10.0.0.4461.iso) | 26ddcc3df046af1ca1458b3040fc9024b4361ae1e51e1cf4516afe53fb024650 | +| **10.0.0.4461** | [VeeamBackup&Replication_10.0.0.4461.iso](http://download.veeam.com/VeeamBackup&Replication_10.0.0.4461.iso) | 26ddcc3df046af1ca1458b3040fc9024b4361ae1e51e1cf4516afe53fb024650 | ### Veeam Backup and Replication Update Zip files The attribute `node['veeam']['build']` is used to evaluate the Zip download path and checksum for the installation media. When provided, the build selected will be downloaded based on the value found in `libraries/helper.rb`. This media path can be overridden by providing the appropriate installation media attributes - `node['veeam']['installer']['update_url']` and `node['veeam']['installer']['update_checksum']`. By default, these attributes are matching their corresponding `node['veeam']['installer']['package_url']` and `node['veeam']['installer']['package_checksum']` values and the system will download the Zip every time. +_Note: As of 9.5 Update 4, ISO based upgrades must be done using the `package_url` method and not using the `update_url` process to ensure that prerequisites are installed completely._ + | Version | ISO URL | SHA256 | | ------------- |-------------|-------------| -| **Update 1** | [VeeamBackup&Replication_9.5.0.823_Update1.zip](https://download.veeam.com/VeeamBackup&Replication_9.5.0.823_Update1.zip) | c07bdfb3b90cc609d21ba94584ba19d8eaba16faa31f74ad80814ec9288df492 | -| **Update 2** | [VeeamBackup&Replication_9.5.0.1038.Update2.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.zip) | d800bf5414f1bde95fba5fddbd86146c75a5a2414b967404792cc32841cb4ffb | -| **Update 3** | [VeeamBackup&Replication_9.5.0.1536.Update3.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.zip) | 38ed6a30aa271989477684fdfe7b98895affc19df7e1272ee646bb50a059addc | -| **Update 3a** | [VeeamBackup&Replication_9.5.0.1922.Update3a.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.zip) | f6b3fc0963b09362c535ef49691c51d368266cc91d6833c80c70342161bb7123 | -| **Update 4** | [VeeamBackup&Replication_9.5.4.2615.Update4.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso) | 8a594cec74059f9929ea765ac5e70a49da6fc93803b567cbb9d74fbb1a49a6cc | +| **9.5 Update 1** | [VeeamBackup&Replication_9.5.0.823_Update1.zip](https://download.veeam.com/VeeamBackup&Replication_9.5.0.823_Update1.zip) | c07bdfb3b90cc609d21ba94584ba19d8eaba16faa31f74ad80814ec9288df492 | +| **9.5 Update 2** | [VeeamBackup&Replication_9.5.0.1038.Update2.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.zip) | d800bf5414f1bde95fba5fddbd86146c75a5a2414b967404792cc32841cb4ffb | +| **9.5 Update 3** | [VeeamBackup&Replication_9.5.0.1536.Update3.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.zip) | 38ed6a30aa271989477684fdfe7b98895affc19df7e1272ee646bb50a059addc | +| **9.5 Update 3a** | [VeeamBackup&Replication_9.5.0.1922.Update3a.zip](http://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.zip) | f6b3fc0963b09362c535ef49691c51d368266cc91d6833c80c70342161bb7123 | +| **9.5 Update 4** | [VeeamBackup&Replication_9.5.4.2615.Update4.iso](http://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso) | 8a594cec74059f9929ea765ac5e70a49da6fc93803b567cbb9d74fbb1a49a6cc | +| **9.5 Update 4b** | [VeeamBackup&Replication_9.5.4.2866.Update4b_20191210.zip](https://download.veeam.com/VeeamBackup&Replication_9.5.4.2866.Update4b_20191210.zip) | e0b29d2585ba2adb0914976bf83d7f0e11c2db7365af9ff43a33cb36b23425c2 | + + ### Veeam Backup and Replication License file The server must be licensed to unlock the full potential of the application. The attribute `node['veeam']['server']['evaluation']` should be configured as `false`. To license, choose one of the below options. @@ -214,6 +221,9 @@ The process to perform upgrades requires that the appropriate installation media > As of Update 4, the upgrade process has changed. The update to version 9.5.4+ will be automatically applied if the installer media leverages Update4. Due to the nature of the process, a reboot is required. The Automatic Reboot will occur at the end of the convergance unless the attribute `nde['veeam']['reboot_on_upgrade']` equals false ### Configuring the Updates + +_Note: As of 9.5 Update 4, ISO based upgrades must be done using the `package_url` method and not using the `update_url` process to ensure that prerequisites are installed completely._ + Updates are identified by passing one of the following to the attributes for the server: 1. `node['veeam']['installer']['update_url']` attribute should contain either the full installation ISO or the update ZIP link. The file name must include the full build name like such: - VeeamBackup&Replication_9.5.0.1536.Update3.iso @@ -227,6 +237,9 @@ Updates are identified by passing one of the following to the attributes for the - 9.5.0.1536 (Update3) - 9.5.0.1922 (Update3a) - 9.5.4.2615 (Update4) + - 9.5.4.2866 (Update4b) + - 10.0 (defaults to GA) + - 10.0.0.4461 (GA) ### Upgrade Process and Warnings *Warning* diff --git a/attributes/catalog.rb b/attributes/catalog.rb index 2d6d6cf..02944b3 100644 --- a/attributes/catalog.rb +++ b/attributes/catalog.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Attributes:: catalog # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. default['veeam']['catalog']['install_dir'] = 'C:\\Program Files\\Veeam\\Backup and Replication\\' default['veeam']['catalog']['vm_catalogpath'] = nil diff --git a/attributes/console.rb b/attributes/console.rb index 8b2d017..ee2f37c 100644 --- a/attributes/console.rb +++ b/attributes/console.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Attributes:: console # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. default['veeam']['console']['accept_eula'] = false default['veeam']['console']['install_dir'] = 'C:\\Program Files\\Veeam\\Backup and Replication\\' diff --git a/attributes/default.rb b/attributes/default.rb index 5a0f2c9..6219187 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,10 +1,10 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Attributes:: default # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. -default['veeam']['version'] = '9.5' +default['veeam']['version'] = '10.0' default['veeam']['installer']['package_url'] = nil # Local or custom URL location for ISO default['veeam']['installer']['package_checksum'] = nil # Sha256 checksum of ISO default['veeam']['license_url'] = nil @@ -15,8 +15,10 @@ node['veeam']['version'] elsif node['veeam']['installer']['update_url'] == node['veeam']['installer']['package_url'] /(\d+.\d+.\d+.\d+)/.match(node['veeam']['installer']['package_url'].split('/')[-1]).captures[0] + elsif !node['veeam']['installer']['package_url'].nil? + /(\d+.\d+.\d+.\d+)/.match(node['veeam']['installer']['package_url'].split('/')[-1]).captures[0] else - /(\d+.\d+.\d+.\d+)/.match(node['veeam']['installer']['update_url'].split('/')[-1]).captures[0] + node['veeam']['version'] end default['veeam']['reboot_on_upgrade'] = true default['veeam']['upgrade']['keep_media'] = false diff --git a/attributes/host.rb b/attributes/host.rb index 920572d..8f11398 100644 --- a/attributes/host.rb +++ b/attributes/host.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Attributes:: host # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. default['veeam']['host']['vbr_server'] = nil default['veeam']['host']['vbr_port'] = 9392 diff --git a/attributes/proxy.rb b/attributes/proxy.rb index fac5262..f08a54b 100644 --- a/attributes/proxy.rb +++ b/attributes/proxy.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Attributes:: proxy # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. default['veeam']['proxy']['vbr_server'] = nil default['veeam']['proxy']['vbr_port'] = 9392 diff --git a/attributes/server.rb b/attributes/server.rb index db8f233..e0b9053 100644 --- a/attributes/server.rb +++ b/attributes/server.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Attributes:: server # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. default['veeam']['server']['accept_eula'] = false default['veeam']['server']['install_dir'] = 'C:\\Program Files\\Veeam\\Backup and Replication\\' @@ -23,7 +23,5 @@ default['veeam']['server']['pf_ad_nfsdatastore'] = nil default['veeam']['server']['keep_media'] = false -default['sql_server']['server_sa_password'] = 'Veeam1234' - # Install all of the explorers by default. New explorers shoudl be included in the libraries/helper.rb file default['veeam']['server']['explorers'] = %w(ActiveDirectory Exchange SQL Oracle SharePoint) diff --git a/libraries/helper.rb b/libraries/helper.rb index 0a4312d..2eff8c3 100644 --- a/libraries/helper.rb +++ b/libraries/helper.rb @@ -1,4 +1,4 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Library:: helper # # Author:: Jeremy Goodrum @@ -7,7 +7,7 @@ # Version:: 0.1.0 # Date:: 2017-02-07 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,33 +44,49 @@ def find_package_checksum(version) def package_list(version) case version.to_s # to_s to make sure someone didn't pass us an int when '9.0' then { - 'package_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.0.0.902.iso', + 'package_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.0.0.902.iso', 'package_checksum' => '21f9d2c318911e668511990b8bbd2800141a7764cc97a8b78d4c2200c1225c88' } when '9.5' then { - 'package_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', + 'package_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', 'package_checksum' => 'af3e3f6db9cb4a711256443894e6fb56da35d48c0b2c32d051960c52c5bc2f00' } when '9.5.0.711' then { - 'package_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', + 'package_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', 'package_checksum' => 'af3e3f6db9cb4a711256443894e6fb56da35d48c0b2c32d051960c52c5bc2f00' } when '9.5.0.1038' then { - 'package_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.iso', + 'package_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.iso', 'package_checksum' => '180b142c1092c89001ba840fc97158cc9d3a37d6c7b25c93a311115b33454977' } when '9.5.0.1536' then { - 'package_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.iso', + 'package_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.iso', 'package_checksum' => '5020ef015e4d9ff7070d43cf477511a2b562d8044975552fd08f82bdcf556a43' } when '9.5.0.1922' then { - 'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.iso', + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.iso', 'package_checksum' => '9a6fa7d857396c058b2e65f20968de56f96bc293e0e8fd9f1a848c7d71534134' } when '9.5.4.2615' then { - 'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso', + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso', 'package_checksum' => 'ecc27bbcf49104861566782701dca42375b324b4710e2fa79b5f8068c31c4494' } + when '9.5.4.2866' then { + 'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.4.2866.Update4b_20191210.iso', + 'package_checksum' => 'cfc41596154563f60b74320634589721fd1110c87e04632068bc5234aada342e' + } + when '10.0' then { + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_10.0.0.4461.iso', + 'package_checksum' => '26ddcc3df046af1ca1458b3040fc9024b4361ae1e51e1cf4516afe53fb024650' + } + when '10.0.0.4461' then { + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_10.0.0.4461.iso', + 'package_checksum' => '26ddcc3df046af1ca1458b3040fc9024b4361ae1e51e1cf4516afe53fb024650' + } + when '10.0.1.4854' then { + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_10.0.1.4854_20200723.iso', + 'package_checksum' => '378ae6a95ca683a12d9872eec7596bf2b17848c880812484e6e9e1dd55ec2dad' + } end end @@ -85,37 +101,49 @@ def find_update_checksum(version) def update_list(version) case version.to_s # to_s to make sure someone didn't pass us an int when '9.0' then { - 'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.0.0.902.iso', + 'update_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.0.0.902.iso', 'update_checksum' => '21f9d2c318911e668511990b8bbd2800141a7764cc97a8b78d4c2200c1225c88' } when '9.5' then { - 'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', + 'update_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', 'update_checksum' => 'af3e3f6db9cb4a711256443894e6fb56da35d48c0b2c32d051960c52c5bc2f00' } when '9.5.0.711' then { - 'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', + 'update_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.711.iso', 'update_checksum' => 'af3e3f6db9cb4a711256443894e6fb56da35d48c0b2c32d051960c52c5bc2f00' } when '9.5.0.823' then { - 'update_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.0.823_Update1.zip', + 'update_url' => 'https://download.veeam.com/VeeamBackup&Replication_9.5.0.823_Update1.zip', 'update_checksum' => 'c07bdfb3b90cc609d21ba94584ba19d8eaba16faa31f74ad80814ec9288df492' } when '9.5.0.1038' then { - 'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.zip', + 'update_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.1038.Update2.zip', 'update_checksum' => 'd800bf5414f1bde95fba5fddbd86146c75a5a2414b967404792cc32841cb4ffb' } when '9.5.0.1536' then { - 'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.zip', + 'update_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.1536.Update3.zip', 'update_checksum' => '38ed6a30aa271989477684fdfe7b98895affc19df7e1272ee646bb50a059addc' } when '9.5.0.1922' then { - 'update_url' => 'http://download2.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.zip', + 'update_url' => 'http://download.veeam.com/VeeamBackup&Replication_9.5.0.1922.Update3a.zip', 'update_checksum' => 'f6b3fc0963b09362c535ef49691c51d368266cc91d6833c80c70342161bb7123' } when '9.5.4.2615' then { - 'package_url' => 'https://download2.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso', + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_9.5.4.2615.Update4.iso', 'package_checksum' => 'ecc27bbcf49104861566782701dca42375b324b4710e2fa79b5f8068c31c4494' } + when '9.5.4.2866' then { + 'update_url' => 'https://download.veeam.com/VeeamBackup&Replication_9.5.4.2866.Update4b_20191210.zip', + 'update_checksum' => 'e0b29d2585ba2adb0914976bf83d7f0e11c2db7365af9ff43a33cb36b23425c2' + } + when '10.0.0.4461' then { + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_10.0.0.4461.iso', + 'package_checksum' => '26ddcc3df046af1ca1458b3040fc9024b4361ae1e51e1cf4516afe53fb024650' + } + when '10.0.1.4854' then { + 'package_url' => 'https://download.veeam.com/VeeamBackup&Replication_10.0.1.4854_20200723.iso', + 'package_checksum' => '378ae6a95ca683a12d9872eec7596bf2b17848c880812484e6e9e1dd55ec2dad' + } end end @@ -124,60 +152,108 @@ def prerequisites_list(version) when '9.0' then { '0' => { 'Microsoft System CLR Types for SQL Server 2012 (x64)' => 'SQLSysClrTypes.msi' }, '1' => { 'Microsoft SQL Server 2012 Management Objects (x64)' => 'SharedManagementObjects.msi' }, - 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' } + 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SqlExpress\SQLEXPR_x64_ENU.exe' } } when /9.0.0.\d+/ then { '0' => { 'Microsoft System CLR Types for SQL Server 2012 (x64)' => 'SQLSysClrTypes.msi' }, '1' => { 'Microsoft SQL Server 2012 Management Objects (x64)' => 'SharedManagementObjects.msi' }, - 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' } + 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SqlExpress\SQLEXPR_x64_ENU.exe' } } when '9.5' then { '0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' }, '1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' }, - 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' } + 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SqlExpress\SQLEXPR_x64_ENU.exe' } } when /9.5.0.\d+/ then { '0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' }, '1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' }, - 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SQLEXPR_x64_ENU.exe' } + 'SQL' => { 'Microsoft SQL Server 2012 (64-bit)' => 'SqlExpress\SQLEXPR_x64_ENU.exe' } } when /9.5.4.\d+/ then { '0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' }, '1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' }, - 'SQL' => { 'Microsoft SQL Server 2016 (64-bit)' => 'SQLEXPR_x64_ENU.exe' } + '2' => { 'Microsoft Report Viewer 2015 Runtime' => '..\\ReportViewer.msi' }, + 'SQL' => { 'Microsoft SQL Server 2016 (64-bit)' => 'SqlExpress\2016SP2\SQLEXPR_x64_ENU.exe' } + } + when '10.0' then { + '0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' }, + '1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' }, + 'SQL' => { 'Microsoft SQL Server 2016 (64-bit)' => 'SqlExpress\2016SP2\SQLEXPR_x64_ENU.exe' } + } + when /10.0.\d+/ then { + '0' => { 'Microsoft System CLR Types for SQL Server 2014' => 'SQLSysClrTypes.msi' }, + '1' => { 'Microsoft SQL Server 2014 Management Objects (x64)' => 'SharedManagementObjects.msi' }, + 'SQL' => { 'Microsoft SQL Server 2016 (64-bit)' => 'SqlExpress\2016SP2\SQLEXPR_x64_ENU.exe' } } end end - def explorers_list(version) + def dotnet_list(version) + case version.to_s # to_s to make sure someone didn't pass us an int + when '9.0' then { + # Microsoft .NET Framework 4.5.2 + '379893' => 'NDP452-KB2901907-x86-x64-AllOS-ENU.exe' + } + when /9.\d+/ then { + '379893' => 'NDP452-KB2901907-x86-x64-AllOS-ENU.exe' + } + when '10.0' then { + '461814' => 'NDP472-KB4054530-x86-x64-AllOS-ENU.exe' + } + when /10.\d+/ then { + '461814' => 'NDP472-KB4054530-x86-x64-AllOS-ENU.exe' + } + end + end + + def sqlexpress_list(version) case version.to_s # to_s to make sure someone didn't pass us an int when '9.0' then { - 'ActiveDirectory' => 'Veeam Explorer for Microsoft Active Directory', - 'SQL' => 'Veeam Explorer for Microsoft SQL Server', - 'Exchange' => 'Veeam Explorer for Microsoft Exchange', - 'SharePoint' => 'Veeam Explorer for Microsoft SharePoint', - 'Oracle' => 'Veeam Explorer for Oracle' + 'Microsoft SQL Server 2012 (64-bit)' => { 'installer' => 'SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL11.SQLEXPRESS' } + } + when /9.0.0.\d+/ then { + 'Microsoft SQL Server 2012 (64-bit)' => { 'installer' => 'SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL11.SQLEXPRESS' } } when '9.5' then { - 'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory', version: '9.5.0.836' }, - 'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server', version: '9.5.0.836' }, - 'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange', version: '9.5.0.836' }, - 'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint', version: '9.5.0.836' }, - 'Oracle' => { name: 'Veeam Explorer for Oracle', version: '9.5.0.836' } + 'Microsoft SQL Server 2012 (64-bit)' => { 'installer' => 'SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL11.SQLEXPRESS' } + } + when /9.5.0.\d+/ then { + 'Microsoft SQL Server 2012 (64-bit)' => { 'installer' => 'SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL11.SQLEXPRESS' } } when /9.5.4.\d+/ then { - 'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory', version: '9.6.4.1053' }, - 'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server', version: '9.6.4.1053' }, - 'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange', version: '9.6.4.1053' }, - 'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint', version: '9.6.4.1053' }, - 'Oracle' => { name: 'Veeam Explorer for Oracle', version: '9.6.4.1053' } + 'Microsoft SQL Server 2016 (64-bit)' => { 'installer' => 'SqlExpress\2016SP1\SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL13.SQLEXPRESS' } } - when /9.5.0.\d+/ then { - 'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory', version: '9.5.0.836' }, - 'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server', version: '9.5.0.836' }, - 'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange', version: '9.5.0.836' }, - 'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint', version: '9.5.0.836' }, - 'Oracle' => { name: 'Veeam Explorer for Oracle', version: '9.5.0.836' } + when '10.0' then { + 'Microsoft SQL Server 2016 (64-bit)' => { 'installer' => 'SqlExpress\2016SP2\SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL13.SQLEXPRESS' } + } + when /10.0.\d+/ then { + 'Microsoft SQL Server 2016 (64-bit)' => { 'installer' => 'SqlExpress\2016SP2\SQLEXPR_x64_ENU.exe', 'reg_key' => 'MSSQL13.SQLEXPRESS' } + } + end + end + + def explorers_list(version) + case version.to_s # to_s to make sure someone didn't pass us an in + when /9.\d+/ then { + 'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory' }, + 'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server' }, + 'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange' }, + 'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint' }, + 'Oracle' => { name: 'Veeam Explorer for Oracle' } + } + when '10.0' then { + 'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory' }, + 'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server' }, + 'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange' }, + 'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint' }, + 'Oracle' => { name: 'Veeam Explorer for Oracle' } + } + when /10.0.\d+/ then { + 'ActiveDirectory' => { name: 'Veeam Explorer for Microsoft Active Directory' }, + 'SQL' => { name: 'Veeam Explorer for Microsoft SQL Server' }, + 'Exchange' => { name: 'Veeam Explorer for Microsoft Exchange' }, + 'SharePoint' => { name: 'Veeam Explorer for Microsoft SharePoint' }, + 'Oracle' => { name: 'Veeam Explorer for Oracle' } } end end @@ -259,7 +335,6 @@ def iso_installer(downloaded_file_name, new_resource) Mount-DiskImage -ImagePath "#{downloaded_file_name}" EOH action :run - guard_interpreter :powershell_script not_if "[boolean] (Get-DiskImage -ImagePath '#{downloaded_file_name}').DevicePath" end end @@ -278,9 +353,10 @@ def extract_installer(downloaded_file_name, new_resource) not_if { ::File.exist?(update_path) } end - windows_zipfile win_clean_path(::File.join(install_media_path, '/Updates')) do - source downloaded_file_name - action :unzip + archive_file win_clean_path(::File.join(install_media_path, '/Updates')) do + destination win_clean_path(::File.join(install_media_path, '/Updates')) + path downloaded_file_name + action :extract not_if { ::File.exist?(update_path) } end @@ -294,7 +370,6 @@ def unmount_installer(downloaded_file_name) Dismount-DiskImage -ImagePath "#{downloaded_file_name}" EOH action :run - guard_interpreter :powershell_script only_if "[boolean] (Get-DiskImage -ImagePath '#{downloaded_file_name}').DevicePath" end end diff --git a/libraries/matchers.rb b/libraries/matchers.rb deleted file mode 100644 index 40b7231..0000000 --- a/libraries/matchers.rb +++ /dev/null @@ -1,50 +0,0 @@ -if defined?(ChefSpec) - # DefineMatcher allow us to expose the concept of the method to chef_run during testing. - ChefSpec.define_matcher(:veeam_catalog) - ChefSpec.define_matcher(:veeam_console) - ChefSpec.define_matcher(:veeam_server) - ChefSpec.define_matcher(:veeam_prerequisites) - ChefSpec.define_matcher(:veeam_proxy) - ChefSpec.define_matcher(:veeam_upgrade) - - def install_veeam_catalog(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_catalog, :install, resource_name) - end - - def install_veeam_console(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_console, :install, resource_name) - end - - def install_veeam_server(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_server, :install, resource_name) - end - - def install_veeam_prerequisites(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_prerequisites, :install, resource_name) - end - - def install_veeam_explorer(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_explorer, :install, resource_name) - end - - def install_veeam_upgrade(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_upgrade, :install, resource_name) - end - - def add_veeam_proxy(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_proxy, :add, resource_name) - end - - def remove_veeam_proxy(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_proxy, :remove, resource_name) - end - - def add_veeam_host(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_host, :add, resource_name) - end - - def remove_veeam_host(resource_name) - ChefSpec::Matchers::ResourceMatcher.new(:veeam_host, :remove, resource_name) - end - -end diff --git a/metadata.rb b/metadata.rb index 620513a..3499ffe 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,9 +3,8 @@ maintainer_email 'chef@exospheredata.com' license 'Apache-2.0' description 'Installs/Configures Veeam Backup and Recovery' -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.0.2' -chef_version '>= 12.5' if respond_to?(:chef_version) +version '4.0.3' +chef_version '>= 13.0' supports 'windows' @@ -13,8 +12,8 @@ # If you upload to Supermarket you should set this so your cookbook # gets a `View Issues` link -issues_url 'https://github.com/exospheredata/veeam/issues' if respond_to?(:issues_url) +issues_url 'https://github.com/exospheredata/veeam/issues' # If you upload to Supermarket you should set this so your cookbook # gets a `View Source` link -source_url 'https://github.com/exospheredata/veeam' if respond_to?(:source_url) +source_url 'https://github.com/exospheredata/veeam' diff --git a/recipes/catalog.rb b/recipes/catalog.rb index f601b9f..ea5a072 100644 --- a/recipes/catalog.rb +++ b/recipes/catalog.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: catalog # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/console.rb b/recipes/console.rb index 20ddd67..0ce6fdb 100644 --- a/recipes/console.rb +++ b/recipes/console.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: console # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/default.rb b/recipes/default.rb index 4b30732..e765820 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,5 +1,8 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: default # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. diff --git a/recipes/host_mgmt.rb b/recipes/host_mgmt.rb index f9d6d45..f70ba5f 100644 --- a/recipes/host_mgmt.rb +++ b/recipes/host_mgmt.rb @@ -5,12 +5,12 @@ # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/prerequisites.rb b/recipes/prerequisites.rb index 50ea32a..641f7c3 100644 --- a/recipes/prerequisites.rb +++ b/recipes/prerequisites.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: prerequisites # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/proxy_remove.rb b/recipes/proxy_remove.rb index 8af1a4a..caa5a71 100644 --- a/recipes/proxy_remove.rb +++ b/recipes/proxy_remove.rb @@ -1,16 +1,16 @@ # # Cookbook:: veeam -# Recipe:: proxy_remove +# Recipe:: proxy_remote # # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/proxy_server.rb b/recipes/proxy_server.rb index df3e087..7014a14 100644 --- a/recipes/proxy_server.rb +++ b/recipes/proxy_server.rb @@ -5,12 +5,12 @@ # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/server.rb b/recipes/server.rb index f175729..d5c1a91 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: server # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/server_with_catalog.rb b/recipes/server_with_catalog.rb index 91fdcf7..6c11a26 100644 --- a/recipes/server_with_catalog.rb +++ b/recipes/server_with_catalog.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: server_with_catalog # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/server_with_console.rb b/recipes/server_with_console.rb index d5c844d..a999740 100644 --- a/recipes/server_with_console.rb +++ b/recipes/server_with_console.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: server_with_console # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/standalone_complete.rb b/recipes/standalone_complete.rb index 0b758f9..8800502 100644 --- a/recipes/standalone_complete.rb +++ b/recipes/standalone_complete.rb @@ -1,13 +1,16 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Recipe:: standalone_complete # -# Copyright (c) 2017 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/recipes/upgrade.rb b/recipes/upgrade.rb index e348602..74aa7b5 100644 --- a/recipes/upgrade.rb +++ b/recipes/upgrade.rb @@ -5,12 +5,12 @@ # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. error_message = 'This recipe requires a Windows 2012 or higher host!' # If this host is not Windows, then abort -raise ArgumentError, error_message unless node['platform'] == 'windows' +raise ArgumentError, error_message unless platform_family?('windows') # If this host is older than Windows 2012, we should abort the process for an unsupported platform raise ArgumentError, error_message if node['platform_version'].to_f < '6.2.9200'.to_f # '6.2.9200' is the numeric platform_version for Windows 2012 diff --git a/resources/catalog.rb b/resources/catalog.rb index 7b03ba4..b9dc613 100644 --- a/resources/catalog.rb +++ b/resources/catalog.rb @@ -1,13 +1,13 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: catalog # # Author:: Jeremy Goodrum # Email:: chef@exospheredata.com # -# Version:: 0.2.0 -# Date:: 2017-02-07 +# Version:: 1.0.0 +# Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ property :vbrc_service_port, Integer property :version, String, required: true -property :keep_media, [TrueClass, FalseClass], default: false +property :keep_media, [true, false], default: false # We need to include the windows helpers to keep things dry ::Chef::Provider.send(:include, Windows::Helper) @@ -48,10 +48,9 @@ # We will use the Windows Helper 'is_package_installed?' to see if the Catalog Server is installed. If it is installed, then # we should report no change back. By returning 'false', Chef will report that the resource is up-to-date. if is_package_installed?('Veeam Backup Catalog') - installed_version = installed_packages['Veeam Backup Catalog'][:version] # => If the build version and the installed version match then return up-to-date - return false if Gem::Version.new(new_resource.version) == Gem::Version.new(installed_version) + return false if Gem::Version.new(new_resource.version) <= Gem::Version.new(find_current_veeam_version('Veeam Backup Catalog')) # => Previous versions are upgraded through update files and therefore, this is up-to-date return false if Gem::Version.new(new_resource.version) <= Gem::Version.new('9.5.3.0') @@ -118,10 +117,6 @@ end action_class do - def whyrun_supported? - true - end - def perform_catalog_install(install_media_path) Chef::Log.debug 'Installing Veeam Backup Catalog service... begin' # In this case, we have many possible combinations of extra arugments that would need to be passed to the installer. diff --git a/resources/console.rb b/resources/console.rb index 7e3832d..36d748e 100644 --- a/resources/console.rb +++ b/resources/console.rb @@ -1,14 +1,13 @@ - -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: console # # Author:: Jeremy Goodrum # Email:: chef@exospheredata.com # -# Version:: 0.2.0 -# Date:: 2017-02-07 +# Version:: 1.0.0 +# Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,11 +29,11 @@ property :package_url, String property :package_checksum, String -property :accept_eula, [TrueClass, FalseClass], default: false, required: true +property :accept_eula, [true, false], required: true property :install_dir, String property :version, String, required: true -property :keep_media, [TrueClass, FalseClass], default: false +property :keep_media, [true, false], default: false # We need to include the windows helpers to keep things dry ::Chef::Provider.send(:include, Windows::Helper) @@ -46,10 +45,9 @@ # We will use the Windows Helper 'is_package_installed?' to see if the Console is installed. If it is installed, then # we should report no change back. By returning 'false', Chef will report that the resource is up-to-date. if is_package_installed?('Veeam Backup & Replication Console') - installed_version = installed_packages['Veeam Backup & Replication Console'][:version] # => If the build version and the installed version match then return up-to-date - return false if Gem::Version.new(new_resource.version) == Gem::Version.new(installed_version) + return false if Gem::Version.new(new_resource.version) <= Gem::Version.new(find_current_veeam_version('Veeam Backup & Replication Console')) # => Previous versions are upgraded through update files and therefore, this is up-to-date return false if Gem::Version.new(new_resource.version) <= Gem::Version.new('9.5.3.0') @@ -117,10 +115,6 @@ end action_class do - def whyrun_supported? - true - end - def perform_console_install(install_media_path) Chef::Log.debug 'Installing Veeam Backup console service... begin' # In this case, we have many possible combinations of extra arugments that would need to be passed to the installer. diff --git a/resources/explorer.rb b/resources/explorer.rb index f920e9b..f555270 100644 --- a/resources/explorer.rb +++ b/resources/explorer.rb @@ -1,13 +1,13 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: explorer # # Author:: Jeremy Goodrum # Email:: chef@exospheredata.com # -# Version:: 0.1.0 -# Date:: 2017-02-07 +# Version:: 1.0.0 +# Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ property :package_checksum, String property :version, String, required: true -property :keep_media, [TrueClass, FalseClass], default: false +property :keep_media, [true, false], default: false property :explorers, Array, required: true @@ -61,14 +61,12 @@ new_resource.explorers.each do |explorer| package_name = explorers_hash[explorer][:name] - package_version = explorers_hash[explorer][:version] + # 2020-07-13 + # If the explorer is installed, the upgrade process will handle the version changes + # and we should skip further processing. Otherwise, we need to install this + # package next unless is_package_installed?(package_name) - installed_version = installed_packages[package_name][:version] - if installed_version == package_version - installed_explorers.push(explorer) - else - Chef::Log.info("The package #{package_name} is installed with version #{installed_version} but should be upgraded to #{package_version}") - end + installed_explorers.push(explorer) end # return false @@ -99,16 +97,17 @@ install_media_path = get_media_installer_location(installer_file_name) veeam_explorer_root = "#{install_media_path}\\Explorers" - new_resource.explorers.each do |explorer| - Chef::Log.debug "Installing Veeam Explorer for #{explorers_hash[explorer][:name]}... begin" - windows_package explorers_hash[explorer][:name] do + (new_resource.explorers - installed_explorers).each do |explorer| + package_name = explorers_hash[explorer][:name] + Chef::Log.debug "Installing Veeam Explorer for #{package_name}... begin" + windows_package package_name do provider Chef::Provider::Package::Windows source "#{veeam_explorer_root}\\VeeamExplorerFor#{explorer}.msi" options 'ACCEPT_THIRDPARTY_LICENSES="1" ACCEPT_EULA="1"' installer_type :msi action :install end - Chef::Log.debug "Installing Veeam Explorer for #{explorers_hash[explorer][:name]}... success" + Chef::Log.debug "Installing Veeam Explorer for #{package_name}... success" end end end @@ -126,9 +125,3 @@ action :delete end end - -action_class do - def whyrun_supported? - true - end -end diff --git a/resources/host.rb b/resources/host.rb index fb451ee..6e02b88 100644 --- a/resources/host.rb +++ b/resources/host.rb @@ -1,13 +1,13 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: host # # Author:: Jeremy Goodrum # Email:: chef@exospheredata.com # # Version:: 1.0.0 -# Date:: 2018-08-23 +# Date:: 2018-04-29 # -# Copyright (c) 2018 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ default_action :add -property :hostname, String, name_property: true, required: true +property :hostname, String, name_property: true # VBR Server Connection Properties property :vbr_server, String, required: true @@ -52,19 +52,20 @@ no_console_error = 'This resource requires that the Veeam Backup & Replication Console be installed on this host' raise ArgumentError, no_console_error unless is_package_installed?('Veeam Backup & Replication Console') - return false if server_currently_registered + return false if currently_registered? raise ArgumentError, 'The Host Username is a required attribute' if new_resource.host_username.nil? raise ArgumentError, 'The Host Password is a required attribute' if new_resource.host_password.nil? powershell_script 'Register Host Server' do code <<-EOH + # Register Host to VBR Add-PSSnapin VeeamPSSnapin try { Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop @@ -75,7 +76,7 @@ if (!$VbrCredentials){ $VbrCredentials = (Add-VBRCredentials ` -User #{new_resource.host_username} ` - -Password #{new_resource.host_password} ` + -Password "#{new_resource.host_password}" ` -Description "ADDED BY CHEF: #{new_resource.host_type.upcase} Server Credentials" ` -Type Windows) } @@ -83,19 +84,21 @@ $VbrServer = Get-VBRServer -Name #{new_resource.hostname} if(!$VbrServer) { $arguments = " -Name #{new_resource.hostname}" - $arguments += " -Port #{new_resource.host_port}" $arguments += " -Description '#{new_resource.description ? "ADDED by CHEF: #{new_resource.description}" : "ADDED by CHEF: #{new_resource.host_type.upcase} Server"}'" $arguments += " -Credentials $VbrCredentials" switch("#{new_resource.host_type}"){ "vmware" { $command = "Add-VBRvCenter" + $arguments += " -Port #{new_resource.host_port}" } "esxi" { $command = "Add-VBRESXi" + $arguments += " -Port #{new_resource.host_port}" } "esx_legacy" { $command = "Add-VBRESX" + $arguments += " -Port #{new_resource.host_port}" } "hyperv" { $command = "Add-VBRHvHost" @@ -132,7 +135,6 @@ } EOH action :run - not_if { server_currently_registered } end end @@ -143,16 +145,17 @@ no_console_error = 'This resource requires that the Veeam Backup & Replication Console be installed on this host' raise ArgumentError, no_console_error unless is_package_installed?('Veeam Backup & Replication Console') - return false unless server_currently_registered + return false unless currently_registered? powershell_script 'Remove Host Server' do code <<-EOH + # Unregister Host to VBR Add-PSSnapin VeeamPSSnapin try { Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop @@ -167,16 +170,11 @@ } EOH action :run - only_if { server_currently_registered } end end action_class do - def whyrun_supported? - true - end - - def server_currently_registered + def currently_registered? cmd_str = <<-EOH # Check if Host is registered Add-PSSnapin VeeamPSSnapin @@ -184,7 +182,7 @@ def server_currently_registered Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop $VbrServer = Get-VBRServer -Name "#{new_resource.name}" -ErrorAction SilentlyContinue diff --git a/resources/prerequisites.rb b/resources/prerequisites.rb index ed1555f..dc5f11f 100644 --- a/resources/prerequisites.rb +++ b/resources/prerequisites.rb @@ -1,13 +1,13 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: prerequisites # # Author:: Jeremy Goodrum # Email:: chef@exospheredata.com # -# Version:: 0.2.0 -# Date:: 2017-02-13 +# Version:: 1.0.0 +# Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ property :package_checksum, String property :version, String, required: true -property :install_sql, [TrueClass, FalseClass], default: false +property :install_sql, [true, false], default: false # We need to include the windows helpers to keep things dry ::Chef::Provider.send(:include, Windows::Helper) @@ -49,26 +49,37 @@ # Halt this process now. There is no URL for the package. raise ArgumentError, 'You must provide a package URL or choose a valid version' unless new_resource.package_url - base_version = /(\d+.\d+)/.match(new_resource.version).captures[0] - [base_version, new_resource.version].each do |test_version| - # Determine if all of the Veeam pre-requisites are installed and if so, then skip the processing. - prerequisites_required = [] - installed_prerequisites = [] - prerequisites_hash = prerequisites_list(test_version) - - prerequisites_hash.each do |item, prerequisites| - package_name = prerequisites.map { |k, _v| k }.join(',') - unless item == 'SQL' && new_resource.install_sql == false - prerequisites_required.push(package_name) - installed_prerequisites.push(package_name) if is_package_installed?(package_name) + is_sql_installed = false + prerequisites_required = [] + installed_prerequisites = [] + # Determine if all of the Veeam pre-requisites are installed and if so, then skip the processing. + prerequisites_hash = prerequisites_list(new_resource.version) + prerequisites_hash.each do |item, prerequisites| + package_name = prerequisites.map { |k, _v| k }.join(',') + prerequisites_required.push(package_name) + if item == 'SQL' + base_version = new_resource.version.match(/(^\d+.\d+)/).captures[0] + versions = [new_resource.version, base_version] + # If the system has been upgraded from 9.5 then we need to load that as part of the check + versions.push('9.5') if Gem::Version.new(base_version) > Gem::Version.new('9.5') + versions.each do |version| + _sql_version, sql_configurations = sqlexpress_list(version).first + installed_version_reg_key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\#{sql_configurations['reg_key']}\\MSSQLServer\\CurrentVersion" + next unless registry_key_exists?(installed_version_reg_key, :machine) + installed_prerequisites.push(package_name) + is_sql_installed = true + break end + elsif is_package_installed?(package_name) + installed_prerequisites.push(package_name) end - - # Compare the required Prerequisites with those installed. If all are installed, then - # we should report no change back. By returning 'false', Chef will report that the resource is up-to-date. - return false if (prerequisites_required - installed_prerequisites).empty? && find_current_dotnet >= 379893 end + # Compare the required Prerequisites with those installed. If all are installed, then + # we should report no change back. By returning 'false', Chef will report that the resource is up-to-date. + dotnet_version, _dotnet_installer = dotnet_list(new_resource.version).first + return false if (prerequisites_required - installed_prerequisites).empty? && find_current_dotnet >= dotnet_version.to_i + package_save_dir = win_clean_path(::File.join(::Chef::Config[:file_cache_path], 'package')) # This will only create the directory if it does not exist which is likely the case if we have @@ -88,7 +99,7 @@ install_dotnet(installer_file_name) install_sql_tools(installer_file_name) - install_sql_express(installer_file_name) if new_resource.install_sql + install_sql_express(installer_file_name) if new_resource.install_sql && !is_sql_installed # Dismount the ISO if it is mounted unmount_installer(installer_file_name) @@ -98,24 +109,21 @@ end action_class do - def whyrun_supported? - true - end - def install_dotnet(downloaded_file_name) - return 'Already installed' if find_current_dotnet >= 379893 + dotnet_version, dotnet_installer = dotnet_list(new_resource.version).first + return 'Already installed' if find_current_dotnet >= dotnet_version.to_i reboot 'DotNet Install Complete' do delay_mins 1 reason 'Reboot required after an installation of .NET Framework' action :nothing end - ruby_block 'Install the .NET 4.5.2' do + ruby_block 'Install the .NET' do block do install_media_path = get_media_installer_location(downloaded_file_name) - windows_package 'Microsoft .NET Framework 4.5.2' do + windows_package 'Microsoft .NET Framework' do provider Chef::Provider::Package::Windows - source "#{install_media_path}\\Redistr\\NDP452-KB2901907-x86-x64-AllOS-ENU.exe" + source "#{install_media_path}\\Redistr\\#{dotnet_installer}" installer_type :custom options '/norestart /passive' action :install @@ -155,14 +163,13 @@ def install_sql_tools(downloaded_file_name) end def install_sql_express(downloaded_file_name) - installed_version_reg_key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\\MSSQL11.SQLEXPRESS\MSSQLServer\CurrentVersion' - return 'Already Installed' if registry_key_exists?(installed_version_reg_key, :machine) + _sql_version, sql_configurations = sqlexpress_list(new_resource.version).first config_file_path = win_clean_path(::File.join(::Chef::Config[:file_cache_path], 'ConfigurationFile.ini')) output_file = win_clean_path(::File.join(Chef::Config[:file_cache_path], 'sql_install.log')) sql_build_script = win_clean_path(::File.join(Chef::Config[:file_cache_path], 'sql_build_script.ps1')) - sql_sys_admin_list = "NT AUTHORITY\\SYSTEM\" \"#{node['hostname']}\\#{ENV['USERNAME']}" - sql_sys_admin_list = "NT AUTHORITY\\SYSTEM\" \"#{ENV['USERDOMAIN']}\\#{ENV['USERNAME']}" if node['kernel']['cs_info']['part_of_domain'] + sql_sys_admin_list = "NT AUTHORITY\\SYSTEM\" \"BUILTIN\\Administrators\" \"#{node['hostname']}\\#{ENV['USERNAME']}" + sql_sys_admin_list = "NT AUTHORITY\\SYSTEM\" \"BUILTIN\\Administrators\" \"#{ENV['USERDOMAIN']}\\#{ENV['USERNAME']}" if node['kernel']['cs_info']['part_of_domain'] sql_sys_admin_list = node['veeam']['server']['vbr_service_user'] if node['veeam']['server']['vbr_service_user'] template config_file_path do @@ -183,7 +190,7 @@ def install_sql_express(downloaded_file_name) sensitive true source ::File.join('sql_server', 'sql_build_script.ps1.erb') variables( - sql_install_media: "#{install_media_path}\\Redistr\\x64", + sql_install_media: "#{install_media_path}\\Redistr\\x64\\#{sql_configurations['installer']}", sql_build_command: "/q /ConfigurationFile=#{config_file_path}", outputFilePath: output_file ) diff --git a/resources/proxy.rb b/resources/proxy.rb index 191b927..7f98b34 100644 --- a/resources/proxy.rb +++ b/resources/proxy.rb @@ -1,4 +1,4 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: proxy # # Author:: Jeremy Goodrum @@ -7,7 +7,7 @@ # Version:: 1.0.0 # Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ default_action :add -property :hostname, String, name_property: true, required: true +property :hostname, String, name_property: true # VBR Server Connection Properties property :vbr_server, String, required: true @@ -55,10 +55,10 @@ # => Indicates if the backup proxy must fail over to the Network transport mode if it fails # => to transport data in the Direct storage access or Virtual appliance transport mode. -property :enable_failover_to_ndb, [TrueClass, FalseClass], default: false +property :enable_failover_to_ndb, [true, false], default: false # => Indicates if VM data must be transported over an encrypted SSL connection in the Network transport mode. -property :host_encryption, [TrueClass, FalseClass], default: false +property :host_encryption, [true, false], default: false # ************************* # We need to include the windows helpers to keep things dry @@ -72,19 +72,20 @@ no_console_error = 'This resource requires that the Veeam Backup & Replication Console be installed on this host' raise ArgumentError, no_console_error unless is_package_installed?('Veeam Backup & Replication Console') - return false if proxy_currently_registered && server_currently_registered + return false if proxy_registered? && currently_registered? raise ArgumentError, 'The Proxy Username is a required attribute' if new_resource.proxy_username.nil? raise ArgumentError, 'The Proxy Password is a required attribute' if new_resource.proxy_password.nil? powershell_script 'Register Windows Server' do code <<-EOH + # Register Windows Server to VBR Add-PSSnapin VeeamPSSnapin try { Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop @@ -95,7 +96,7 @@ if (!$VbrCredentials){ $VbrCredentials = (Add-VBRCredentials ` -User #{new_resource.proxy_username} ` - -Password #{new_resource.proxy_password} ` + -Password "#{new_resource.proxy_password}" ` -Description "ADDED BY CHEF: Proxy Server Credentials" ` -Type Windows) } @@ -113,17 +114,18 @@ } EOH action :run - not_if { server_currently_registered } + not_if { currently_registered? } end powershell_script 'Register Veeam Proxy' do code <<-EOH + # Register Veeam Proxy to VBR Add-PSSnapin VeeamPSSnapin try { Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop @@ -162,7 +164,7 @@ } EOH action :run - not_if { proxy_currently_registered } + not_if { proxy_registered? } end end @@ -173,16 +175,17 @@ no_console_error = 'This resource requires that the Veeam Backup & Replication Console be installed on this host' raise ArgumentError, no_console_error unless is_package_installed?('Veeam Backup & Replication Console') - return false if !proxy_currently_registered && !server_currently_registered + return false if !proxy_registered? && !currently_registered? powershell_script 'Remove Veeam Proxy' do code <<-EOH + # Unregister Veeam Proxy from VBR Add-PSSnapin VeeamPSSnapin try { Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop @@ -208,17 +211,18 @@ } EOH action :run - only_if { proxy_currently_registered } + only_if { proxy_registered? } end powershell_script 'Remove Windows Server' do code <<-EOH + # Unregister Windows Server from VBR Add-PSSnapin VeeamPSSnapin try { Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop @@ -233,16 +237,12 @@ } EOH action :run - only_if { server_currently_registered } + only_if { currently_registered? } end end action_class do - def whyrun_supported? - true - end - - def server_currently_registered + def currently_registered? cmd_str = <<-EOH # Check if Host is registered Add-PSSnapin VeeamPSSnapin @@ -250,7 +250,7 @@ def server_currently_registered Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop $VbrServer = Get-VBRServer -Name "#{new_resource.name}" -ErrorAction SilentlyContinue @@ -269,7 +269,7 @@ def server_currently_registered true end - def proxy_currently_registered + def proxy_registered? cmd_str = <<-EOH # Check if Proxy is registered Add-PSSnapin VeeamPSSnapin @@ -277,7 +277,7 @@ def proxy_currently_registered Connect-VBRServer ` -Server #{new_resource.vbr_server} ` -User #{new_resource.vbr_username} ` - -Password #{new_resource.vbr_password} ` + -Password "#{new_resource.vbr_password}" ` -Port #{new_resource.vbr_server_port} ` -ErrorAction Stop diff --git a/resources/server.rb b/resources/server.rb index 9e8f7a7..00e8c69 100644 --- a/resources/server.rb +++ b/resources/server.rb @@ -1,13 +1,13 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: server # # Author:: Jeremy Goodrum # Email:: chef@exospheredata.com # -# Version:: 0.2.0 -# Date:: 2017-02-13 +# Version:: 1.0.0 +# Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,9 +29,9 @@ property :package_url, String property :package_checksum, String -property :accept_eula, [TrueClass, FalseClass], default: false, required: true +property :accept_eula, [true, false], required: true property :install_dir, String -property :evaluation, [TrueClass, FalseClass], default: true +property :evaluation, [true, false], default: true property :vbr_license_file, String property :vbr_check_updates, [Integer, TrueClass, FalseClass] @@ -52,8 +52,8 @@ property :pf_ad_nfsdatastore, String property :version, String, required: true -property :keep_media, [TrueClass, FalseClass], default: false -property :auto_reboot, [TrueClass, FalseClass], default: true +property :keep_media, [true, false], default: false +property :auto_reboot, [true, false], default: true # We need to include the windows helpers to keep things dry ::Chef::Provider.send(:include, Windows::Helper) @@ -65,10 +65,9 @@ # We will use the Windows Helper 'is_package_installed?' to see if the Server is installed. If it is installed, then # we should report no change back. By returning 'false', Chef will report that the resource is up-to-date. if is_package_installed?('Veeam Backup & Replication Server') - installed_version = installed_packages['Veeam Backup & Replication Server'][:version] # => If the build version and the installed version match then return up-to-date - return false if Gem::Version.new(new_resource.version) == Gem::Version.new(installed_version) + return false if Gem::Version.new(new_resource.version) <= Gem::Version.new(find_current_veeam_version('Veeam Backup & Replication Server')) # => Previous versions are upgraded through update files and therefore, this is up-to-date return false if Gem::Version.new(new_resource.version) <= Gem::Version.new('9.5.3.0') @@ -137,10 +136,6 @@ end action_class do - def whyrun_supported? - true - end - def find_vbr_license license_file = win_clean_path(::File.join(Chef::Config[:file_cache_path], 'Veeam-license-file.lic')) diff --git a/resources/upgrade.rb b/resources/upgrade.rb index 59589f8..4602107 100644 --- a/resources/upgrade.rb +++ b/resources/upgrade.rb @@ -1,4 +1,4 @@ -# Cookbook Name:: veeam +# Cookbook:: veeam # Resource:: upgrade # # Author:: Jeremy Goodrum @@ -7,7 +7,7 @@ # Version:: 1.0.0 # Date:: 2018-04-29 # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# Copyright:: (c) 2020 Exosphere Data LLC, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ property :package_checksum, String property :version, String -property :keep_media, [TrueClass, FalseClass], default: false -property :auto_reboot, [TrueClass, FalseClass], default: true +property :keep_media, [true, false], default: false +property :auto_reboot, [true, false], default: true property :package_name, String # Future Property property :share_path, String # Future Property @@ -58,7 +58,12 @@ # => So without a build we will have a hard time determining how to upgrade. Since we have the update url # => we can extract the build from this. - new_resource.build = /(\d+.\d+.\d+.\d+)/.match(new_resource.package_url.split('/')[-1]).captures[0] unless new_resource.build + # => 2020-08-05: If we pass a ZIP then alway use that version for the upgrade + + if /(.zip)/.match(new_resource.package_url.split('/')[-1]) || !new_resource.build + new_resource.build = /(\d+.\d+.\d+.\d+)/.match(new_resource.package_url.split('/')[-1]).captures[0] + Chef::Log.info("Looking for: #{new_resource.build}") + end # => We need to determine the actual build of installed Veeam Software. Since there are three main packages # => we will need to iterate through their possible locations. @@ -128,10 +133,6 @@ end action_class do - def whyrun_supported? - true - end - def perform_server_upgrade(install_media_path) Chef::Log.debug 'Upgrading Veeam Backup server service... begin' # VBR Service Configuration diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b7af5f0..b5a897b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,4 +2,4 @@ require 'chefspec/berkshelf' require_relative 'windows_helper.rb' -at_exit { ChefSpec::Coverage.report! } +# at_exit { ChefSpec::Coverage.report! } diff --git a/spec/unit/lwrps/veeam_catalog_spec.rb b/spec/unit/lwrps/veeam_catalog_spec.rb index 3906a5c..39ab699 100644 --- a/spec/unit/lwrps/veeam_catalog_spec.rb +++ b/spec/unit/lwrps/veeam_catalog_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: catalog # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -35,7 +38,7 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_10.0.0.4461.iso')) } it 'converges successfully' do expect(chef_run).to install_veeam_prerequisites('Install Veeam Prerequisites') diff --git a/spec/unit/lwrps/veeam_console_spec.rb b/spec/unit/lwrps/veeam_console_spec.rb index 0ba8e0b..d869368 100644 --- a/spec/unit/lwrps/veeam_console_spec.rb +++ b/spec/unit/lwrps/veeam_console_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: console # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -23,7 +26,7 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['console']['accept_eula'] = true + node.override['veeam']['console']['accept_eula'] = true # Need to set a valid .NET Framework version allow_any_instance_of(Chef::DSL::RegistryHelper) .to receive(:registry_get_values) @@ -36,7 +39,7 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_10.0.0.4461.iso')) } it 'converges successfully' do expect(chef_run).to install_veeam_prerequisites('Install Veeam Prerequisites') @@ -44,7 +47,7 @@ expect { chef_run }.not_to raise_error end it 'Step into LWRP - veeam_console' do - node.normal['veeam']['console']['accept_eula'] = true + node.override['veeam']['console']['accept_eula'] = true expect { chef_run }.not_to raise_error expect(chef_run).to create_directory(package_save_dir) expect(chef_run).to create_remote_file(downloaded_file_name) @@ -57,11 +60,11 @@ expect(chef_run).to run_powershell_script('Dismount Veeam media') end it 'should not remove the media if keep_media is True' do - node.normal['veeam']['console']['keep_media'] = true + node.override['veeam']['console']['keep_media'] = true expect(chef_run).not_to delete_file(downloaded_file_name) end it 'returns NO error when install_dir supplied' do - node.normal['veeam']['console']['install_dir'] = 'C:\\Veeam\\Backupconsole' + node.override['veeam']['console']['install_dir'] = 'C:\\Veeam\\Backupconsole' expect { chef_run }.not_to raise_error end it 'raises an error about .NET Framework' do @@ -71,7 +74,7 @@ expect { chef_run }.to raise_error(RuntimeError, /Microsoft .NET Framework 4.5.2 or higher be installed/) end it 'raises an error when EULA not accepted' do - node.normal['veeam']['console']['accept_eula'] = false + node.override['veeam']['console']['accept_eula'] = false # Need to set a valid .NET Framework version expect { chef_run }.to raise_error(ArgumentError, /The Veeam Backup and Recovery EULA must be accepted/) end diff --git a/spec/unit/lwrps/veeam_explorer_spec.rb b/spec/unit/lwrps/veeam_explorer_spec.rb index 674e4bd..dcc1c68 100644 --- a/spec/unit/lwrps/veeam_explorer_spec.rb +++ b/spec/unit/lwrps/veeam_explorer_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: explorer # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -32,8 +35,8 @@ allow_any_instance_of(Chef::DSL::RegistryHelper) .to receive(:registry_get_values) .and_return([{}, {}, {}, {}, {}, {}, { name: 'Release', data: 379893 }]) - node.normal['veeam']['server']['accept_eula'] = true - node.normal['veeam']['server']['explorers'] = %w(ActiveDirectory Exchange) + node.override['veeam']['server']['accept_eula'] = true + node.override['veeam']['server']['explorers'] = %w(ActiveDirectory Exchange) shellout = double(run_command: nil, error!: nil, stdout: output, stderr: double(empty?: true), exitstatus: 0, live_stream: nil) allow(Mixlib::ShellOut).to receive(:new).and_return(shellout) allow(shellout).to receive(:live_stream=).and_return(nil) @@ -47,7 +50,7 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_10.0.0.4461.iso')) } it 'converges successfully' do expect { chef_run }.not_to raise_error diff --git a/spec/unit/lwrps/veeam_host_spec.rb b/spec/unit/lwrps/veeam_host_spec.rb index fe7eebf..7faeb7c 100644 --- a/spec/unit/lwrps/veeam_host_spec.rb +++ b/spec/unit/lwrps/veeam_host_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: host # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -30,15 +33,15 @@ before do Fauxhai.mock(platform: platform, version: version) allow(Mixlib::ShellOut).to receive(:new).and_return(shellout) - node.normal['veeam']['host']['vbr_server'] = 'veeam' - node.normal['veeam']['host']['vbr_username'] = 'admin' - node.normal['veeam']['host']['vbr_password'] = 'password' - node.normal['veeam']['host']['host_username'] = 'admin' - node.normal['veeam']['host']['host_password'] = 'password' - node.normal['veeam']['build'] = '9.5.0.1536' - node.normal['veeam']['host']['server'] = 'vc1' - node.normal['veeam']['host']['type'] = 'vmware' - node.normal['veeam']['host']['action'] = nil + node.override['veeam']['host']['vbr_server'] = 'veeam' + node.override['veeam']['host']['vbr_username'] = 'admin' + node.override['veeam']['host']['vbr_password'] = 'password' + node.override['veeam']['host']['host_username'] = 'admin' + node.override['veeam']['host']['host_password'] = 'password' + node.override['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['host']['server'] = 'vc1' + node.override['veeam']['host']['type'] = 'vmware' + node.override['veeam']['host']['action'] = 'add' end let(:shellout) do # Creating a double allows us to stub out the response from Mixlib::ShellOut @@ -65,9 +68,13 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_friendly_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_friendly_path(::File.join(package_save_dir, 'VeeamBackup_Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_friendly_path(::File.join(package_save_dir, 'VeeamBackup_Replication_10.0.0.4461.iso')) } it 'converges successfully' do + allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(false_shell) + stubs_for_provider('veeam_host[vc1]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(false_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to install_veeam_prerequisites('Install Veeam Prerequisites') expect(chef_run).to install_veeam_console('Install Veeam Backup console') @@ -75,13 +82,19 @@ expect(chef_run).to add_veeam_host(node['veeam']['host']['server']) end it 'Step into LWRP - veeam_host' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(false_shell) + stubs_for_provider('veeam_host[vc1]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Host to VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to run_powershell_script('Register Host Server') expect(chef_run).to_not run_powershell_script('Remove Host Server') end it 'Should not register the host if already done' do allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) + stubs_for_provider('veeam_host[vc1]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to_not run_powershell_script('Register Host Server') expect(chef_run).to_not run_powershell_script('Remove Host Server') @@ -93,15 +106,17 @@ expect { chef_run }.to raise_error(ArgumentError, /This resource requires that the Veeam Backup & Replication Console be installed on this host/) end it 'Should remove Host Server if action set to :remove' do - node.normal['veeam']['host']['action'] = 'remove' - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(true_shell) + node.override['veeam']['host']['action'] = 'remove' + stubs_for_provider('veeam_host[vc1]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Unregister Host to VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to remove_veeam_host(node['veeam']['host']['server']) expect(chef_run).to run_powershell_script('Remove Host Server') end it 'Should raise an error if action invalid' do - node.normal['veeam']['host']['action'] = 'delete' + node.override['veeam']['host']['action'] = 'delete' expect { chef_run }.to raise_error(ArgumentError, /Invalid value assigned to attribute \(node\['veeam'\]\['host'\]\['action'\]\): #{node['veeam']['host']['action']}/) end end diff --git a/spec/unit/lwrps/veeam_prerequisites_spec.rb b/spec/unit/lwrps/veeam_prerequisites_spec.rb index ba08d40..8a03be4 100644 --- a/spec/unit/lwrps/veeam_prerequisites_spec.rb +++ b/spec/unit/lwrps/veeam_prerequisites_spec.rb @@ -1,12 +1,15 @@ # -# Cookbook Name:: veeam -# Spec:: server +# Cookbook:: veeam +# Spec:: prerequisites # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' -describe 'veeam::server' do +describe 'veeam::prerequisites' do before do mock_windows_system_framework # Windows Framework Helper from 'spec/windows_helper.rb' stub_command('sc.exe query W3SVC').and_return 1 @@ -31,18 +34,17 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_10.0.0.4461.iso')) } it 'converges successfully' do expect(chef_run).to install_veeam_prerequisites('Install Veeam Prerequisites') - expect(chef_run).to install_veeam_server('Install Veeam Backup Server') expect { chef_run }.not_to raise_error end it 'Step into LWRP - veeam_prerequisites' do expect(chef_run).to create_directory(package_save_dir) expect(chef_run).to create_remote_file(downloaded_file_name) expect(chef_run).to run_powershell_script('Load Veeam media') - expect(chef_run).to run_ruby_block('Install the .NET 4.5.2') + expect(chef_run).to run_ruby_block('Install the .NET') expect(chef_run).to run_ruby_block('Install the SQL Management Tools') expect(chef_run).to create_template(win_clean_path(::File.join(Chef::Config[:file_cache_path], 'ConfigurationFile.ini'))) expect(chef_run).to run_ruby_block('Install the SQL Express') @@ -61,9 +63,11 @@ it 'should skip processing if everything is installed' do allow_any_instance_of(Chef::Provider).to receive(:is_package_installed?) .and_return(true) + allow_any_instance_of(Chef::DSL::RegistryHelper).to receive(:registry_key_exists?) + .and_return(true) allow_any_instance_of(Chef::DSL::RegistryHelper) .to receive(:registry_get_values) - .and_return([{}, {}, {}, {}, {}, {}, { name: 'Release', data: 379893 }]) + .and_return([{}, {}, {}, {}, {}, {}, { name: 'Release', data: 461814 }]) expect(chef_run).not_to create_directory(package_save_dir) end it 'returns an Argument error when invalid Veeam version supplied' do diff --git a/spec/unit/lwrps/veeam_proxy_add_spec.rb b/spec/unit/lwrps/veeam_proxy_add_spec.rb index 1ae6208..68137ec 100644 --- a/spec/unit/lwrps/veeam_proxy_add_spec.rb +++ b/spec/unit/lwrps/veeam_proxy_add_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam -# Spec:: proxy +# Cookbook:: veeam +# Spec:: proxy_add # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -21,7 +24,8 @@ context 'Install Veeam Backup and Recovery Console' do platforms = { 'windows' => { - 'versions' => %w(2012 2012R2 2016) + # 'versions' => %w(2012 2012R2 2016) + 'versions' => %w(2016) } } platforms.each do |platform, components| @@ -30,12 +34,12 @@ before do Fauxhai.mock(platform: platform, version: version) allow(Mixlib::ShellOut).to receive(:new).and_return(shellout) - node.normal['veeam']['proxy']['vbr_server'] = 'veeam' - node.normal['veeam']['proxy']['vbr_username'] = 'admin' - node.normal['veeam']['proxy']['vbr_password'] = 'password' - node.normal['veeam']['proxy']['proxy_username'] = 'admin' - node.normal['veeam']['proxy']['proxy_password'] = 'password' - node.normal['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['proxy']['vbr_server'] = 'veeam' + node.override['veeam']['proxy']['vbr_username'] = 'admin' + node.override['veeam']['proxy']['vbr_password'] = 'password' + node.override['veeam']['proxy']['proxy_username'] = 'admin' + node.override['veeam']['proxy']['proxy_password'] = 'password' + node.override['veeam']['build'] = '9.5.0.1536' end let(:shellout) do # Creating a double allows us to stub out the response from Mixlib::ShellOut @@ -62,9 +66,15 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup_Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup_Replication_10.0.0.4461.iso')) } it 'converges successfully' do + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Windows Host to VBR/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Veeam Proxy to VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to install_windows_feature('FS-FileServer') expect(chef_run).to install_windows_feature('Print-Server') @@ -74,22 +84,34 @@ expect(chef_run).to add_veeam_proxy(node['hostname']) end it 'Step into LWRP - veeam_proxy' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(false_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(false_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Windows Host to VBR/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Veeam Proxy to VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to run_powershell_script('Register Windows Server') expect(chef_run).to run_powershell_script('Register Veeam Proxy') end it 'Should not register the host if already done' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(true_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Windows Host to VBR/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Veeam Proxy to VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to_not run_powershell_script('Register Windows Server') expect(chef_run).to_not run_powershell_script('Register Veeam Proxy') end it 'Should not register the host as Proxy if Registration disabled' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(true_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Windows Host to VBR/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Register Veeam Proxy to VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to_not run_powershell_script('Register Windows Server') expect(chef_run).to_not run_powershell_script('Register Veeam Proxy') diff --git a/spec/unit/lwrps/veeam_proxy_remove_spec.rb b/spec/unit/lwrps/veeam_proxy_remove_spec.rb index 5a2f44b..12cf1f5 100644 --- a/spec/unit/lwrps/veeam_proxy_remove_spec.rb +++ b/spec/unit/lwrps/veeam_proxy_remove_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam -# Spec:: proxy +# Cookbook:: veeam +# Spec:: proxy_remove # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -29,9 +32,9 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['proxy']['vbr_server'] = 'veeam' - node.normal['veeam']['proxy']['vbr_username'] = 'admin' - node.normal['veeam']['proxy']['vbr_password'] = 'password' + node.override['veeam']['proxy']['vbr_server'] = 'veeam' + node.override['veeam']['proxy']['vbr_username'] = 'admin' + node.override['veeam']['proxy']['vbr_password'] = 'password' end let(:shellout) do # Creating a double allows us to stub out the response from Mixlib::ShellOut @@ -58,38 +61,53 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup_Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup_Replication_10.0.0.4461.iso')) } it 'converges successfully' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(true_shell) - expect { chef_run }.not_to raise_error + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Unregister Windows Host from VBR/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Unregister Veeam Proxy from VBR/).and_return(true_shell) + end + # expect { chef_run }.not_to raise_error expect(chef_run).to remove_veeam_proxy(node['hostname']) end it 'Step into LWRP - veeam_proxy' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(true_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Unregister Windows Host from VBR/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Unregister Veeam Proxy from VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to run_powershell_script('Remove Veeam Proxy') expect(chef_run).to run_powershell_script('Remove Windows Server') end it 'Should not unregister the host if not found in Veeam' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(false_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(false_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(false_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to_not run_powershell_script('Remove Veeam Proxy') expect(chef_run).to_not run_powershell_script('Remove Windows Server') end it 'Should unregister the host but skip the Proxy if not configured' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(true_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(false_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(false_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to_not run_powershell_script('Remove Veeam Proxy') expect(chef_run).to run_powershell_script('Remove Windows Server') end it 'Should remove the Proxy but skip Host if not configured' do - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Host is registered/, environment_var).and_return(false_shell) - allow(Mixlib::ShellOut).to receive(:new).with(/Check if Proxy is registered/, environment_var).and_return(true_shell) + stubs_for_provider('veeam_proxy[Fauxhai]') do |provider| + allow(provider).to receive(:shell_out_compacted).with(/Check if Host is registered/).and_return(false_shell) + allow(provider).to receive(:shell_out_compacted).with(/Check if Proxy is registered/).and_return(true_shell) + allow(provider).to receive(:shell_out_compacted).with(/Unregister Veeam Proxy from VBR/).and_return(true_shell) + end expect { chef_run }.not_to raise_error expect(chef_run).to run_powershell_script('Remove Veeam Proxy') expect(chef_run).to_not run_powershell_script('Remove Windows Server') diff --git a/spec/unit/lwrps/veeam_server_spec.rb b/spec/unit/lwrps/veeam_server_spec.rb index 7ef6643..dff51f8 100644 --- a/spec/unit/lwrps/veeam_server_spec.rb +++ b/spec/unit/lwrps/veeam_server_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: server # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -28,7 +31,7 @@ allow_any_instance_of(Chef::DSL::RegistryHelper) .to receive(:registry_get_values) .and_return([{}, {}, {}, {}, {}, {}, { name: 'Release', data: 379893 }]) - node.normal['veeam']['server']['accept_eula'] = true + node.override['veeam']['server']['accept_eula'] = true end let(:runner) do @@ -37,7 +40,7 @@ let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:package_save_dir) { win_clean_path(::File.join(Chef::Config[:file_cache_path], 'package')) } - let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_9.5.0.711.iso')) } + let(:downloaded_file_name) { win_clean_path(::File.join(package_save_dir, 'VeeamBackup&Replication_10.0.0.4461.iso')) } it 'converges successfully' do expect(chef_run).to install_veeam_prerequisites('Install Veeam Prerequisites') @@ -75,7 +78,7 @@ expect { chef_run }.to raise_error(RuntimeError, /Microsoft .NET Framework 4.5.2 or higher be installed/) end it 'raises an error when EULA not accepted' do - node.normal['veeam']['server']['accept_eula'] = false + node.override['veeam']['server']['accept_eula'] = false # Need to set a valid .NET Framework version expect { chef_run }.to raise_error(ArgumentError, /The Veeam Backup and Replication EULA must be accepted/) end diff --git a/spec/unit/lwrps/veeam_upgrade_spec.rb b/spec/unit/lwrps/veeam_upgrade_spec.rb index 64a191b..3692141 100644 --- a/spec/unit/lwrps/veeam_upgrade_spec.rb +++ b/spec/unit/lwrps/veeam_upgrade_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: upgrade # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -30,7 +33,7 @@ allow_any_instance_of(Chef::Provider) .to receive(:find_current_veeam_version) .and_return('9.5') - node.normal['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['build'] = '9.5.0.1536' end let(:runner) do @@ -54,7 +57,7 @@ expect(chef_run).to_not run_ruby_block('Perform Upgrade Procedure') end it 'Step into LWRP - veeam_upgrade' do - node.normal['veeam']['installer']['update_url'] = 'http://download/VeeamBackup&Replication_9.5.0.1536.Update3.iso' + node.override['veeam']['installer']['update_url'] = 'http://download/VeeamBackup&Replication_9.5.0.1536.Update3.iso' expect { chef_run }.not_to raise_error expect(chef_run).to create_directory(package_save_dir) expect(chef_run).to create_remote_file(downloaded_file_name) @@ -67,11 +70,11 @@ expect(chef_run).to run_powershell_script('Dismount Veeam media') end it 'should extract the media from a zip' do - node.normal['veeam']['installer']['update_url'] = 'http://download/VeeamBackup&Replication_9.5.0.1536.Update3.zip' + node.override['veeam']['installer']['update_url'] = 'http://download/VeeamBackup&Replication_9.5.0.1536.Update3.zip' downloaded_file_name = win_clean_path(::File.join(package_save_dir, 'VeeamBackup_Replication_9.5.0.1536.Update3.zip')) installer_path = win_clean_path(::File.join(::Chef::Config[:file_cache_path], 'Veeam/VeeamBackup_Replication_9.5.0.1536.Update3/Updates')) expect(chef_run).to create_remote_file(downloaded_file_name) - expect(chef_run).to unzip_windows_zipfile(installer_path) + expect(chef_run).to extract_archive_file(installer_path) expect(chef_run).to delete_file(downloaded_file_name) end it 'raises an error about .NET Framework' do @@ -81,7 +84,7 @@ expect { chef_run }.to raise_error(RuntimeError, /Microsoft .NET Framework 4.5.2 or higher be installed/) end it 'returns an Argument error when invalid Veeam version supplied' do - node.normal['veeam']['build'] = '1.0' + node.override['veeam']['build'] = '1.0' expect { chef_run }.to raise_error(ArgumentError, /You must provide a package URL or choose a valid build/) end end diff --git a/spec/unit/recipes/catalog_spec.rb b/spec/unit/recipes/catalog_spec.rb index 3c12fc2..b38b250 100644 --- a/spec/unit/recipes/catalog_spec.rb +++ b/spec/unit/recipes/catalog_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: catalog # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' diff --git a/spec/unit/recipes/console_spec.rb b/spec/unit/recipes/console_spec.rb index 380af3c..f99caf4 100644 --- a/spec/unit/recipes/console_spec.rb +++ b/spec/unit/recipes/console_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: console # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' diff --git a/spec/unit/recipes/host_mgmt_spec.rb b/spec/unit/recipes/host_mgmt_spec.rb index 8ebf107..8761765 100644 --- a/spec/unit/recipes/host_mgmt_spec.rb +++ b/spec/unit/recipes/host_mgmt_spec.rb @@ -1,11 +1,11 @@ # # Cookbook:: veeam -# Spec:: host_mgmt_spec +# Spec:: host_mgmt # # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -25,15 +25,15 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['host']['vbr_server'] = 'veeam' - node.normal['veeam']['host']['vbr_username'] = 'admin' - node.normal['veeam']['host']['vbr_password'] = 'password' - node.normal['veeam']['host']['host_username'] = 'admin' - node.normal['veeam']['host']['host_password'] = 'password' - node.normal['veeam']['build'] = '9.5.0.1536' - node.normal['veeam']['host']['server'] = 'vc1' - node.normal['veeam']['host']['type'] = 'vmware' - node.normal['veeam']['host']['action'] = nil + node.override['veeam']['host']['vbr_server'] = 'veeam' + node.override['veeam']['host']['vbr_username'] = 'admin' + node.override['veeam']['host']['vbr_password'] = 'password' + node.override['veeam']['host']['host_username'] = 'admin' + node.override['veeam']['host']['host_password'] = 'password' + node.override['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['host']['server'] = 'vc1' + node.override['veeam']['host']['type'] = 'vmware' + node.override['veeam']['host']['action'] = 'add' end let(:runner) do ChefSpec::SoloRunner.new(platform: platform, version: version, file_cache_path: '/tmp/cache') @@ -50,7 +50,7 @@ end it 'removes the Veeam Host Server' do - node.normal['veeam']['host']['action'] = 'remove' + node.override['veeam']['host']['action'] = 'remove' expect { chef_run }.not_to raise_error expect(chef_run).to install_veeam_prerequisites('Install Veeam Prerequisites') expect(chef_run).to install_veeam_console('Install Veeam Backup console') diff --git a/spec/unit/recipes/proxy_remove_spec.rb b/spec/unit/recipes/proxy_remove_spec.rb index 7ed0d47..fb29611 100644 --- a/spec/unit/recipes/proxy_remove_spec.rb +++ b/spec/unit/recipes/proxy_remove_spec.rb @@ -1,11 +1,11 @@ # # Cookbook:: veeam -# Spec:: proxy_remove_spec +# Spec:: proxy_remove # # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -25,9 +25,9 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['proxy']['vbr_server'] = 'veeam' - node.normal['veeam']['proxy']['vbr_username'] = 'admin' - node.normal['veeam']['proxy']['vbr_password'] = 'password' + node.override['veeam']['proxy']['vbr_server'] = 'veeam' + node.override['veeam']['proxy']['vbr_username'] = 'admin' + node.override['veeam']['proxy']['vbr_password'] = 'password' end let(:runner) do ChefSpec::SoloRunner.new(platform: platform, version: version, file_cache_path: '/tmp/cache') @@ -40,7 +40,7 @@ end it 'register using IP Address' do - node.normal['veeam']['proxy']['use_ip_address'] = true + node.override['veeam']['proxy']['use_ip_address'] = true expect(chef_run).to remove_veeam_proxy(node['ipaddress']) end end diff --git a/spec/unit/recipes/proxy_server_spec.rb b/spec/unit/recipes/proxy_server_spec.rb index 4162d89..06b7589 100644 --- a/spec/unit/recipes/proxy_server_spec.rb +++ b/spec/unit/recipes/proxy_server_spec.rb @@ -1,11 +1,11 @@ # # Cookbook:: veeam -# Spec:: proxy_server_spec +# Spec:: proxy_server # # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -25,12 +25,12 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['proxy']['vbr_server'] = 'veeam' - node.normal['veeam']['proxy']['vbr_username'] = 'admin' - node.normal['veeam']['proxy']['vbr_password'] = 'password' - node.normal['veeam']['proxy']['proxy_username'] = 'admin' - node.normal['veeam']['proxy']['proxy_password'] = 'password' - node.normal['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['proxy']['vbr_server'] = 'veeam' + node.override['veeam']['proxy']['vbr_username'] = 'admin' + node.override['veeam']['proxy']['vbr_password'] = 'password' + node.override['veeam']['proxy']['proxy_username'] = 'admin' + node.override['veeam']['proxy']['proxy_password'] = 'password' + node.override['veeam']['build'] = '9.5.0.1536' end let(:runner) do ChefSpec::SoloRunner.new(platform: platform, version: version, file_cache_path: '/tmp/cache') @@ -49,12 +49,12 @@ end it 'register using IP Address' do - node.normal['veeam']['proxy']['use_ip_address'] = true + node.override['veeam']['proxy']['use_ip_address'] = true expect(chef_run).to add_veeam_proxy(node['ipaddress']) end it 'does not register if attribute configured to false' do - node.normal['veeam']['proxy']['register'] = false + node.override['veeam']['proxy']['register'] = false expect(chef_run).to_not add_veeam_proxy(node['hostname']) end end diff --git a/spec/unit/recipes/server_spec.rb b/spec/unit/recipes/server_spec.rb index b240015..85097e9 100644 --- a/spec/unit/recipes/server_spec.rb +++ b/spec/unit/recipes/server_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: server # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' diff --git a/spec/unit/recipes/server_with_catalog_spec.rb b/spec/unit/recipes/server_with_catalog_spec.rb index c7a366f..5965434 100644 --- a/spec/unit/recipes/server_with_catalog_spec.rb +++ b/spec/unit/recipes/server_with_catalog_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: server_with_catalog # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' diff --git a/spec/unit/recipes/server_with_console_spec.rb b/spec/unit/recipes/server_with_console_spec.rb index 6e9d026..1ff9f0b 100644 --- a/spec/unit/recipes/server_with_console_spec.rb +++ b/spec/unit/recipes/server_with_console_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: server_with_console # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' diff --git a/spec/unit/recipes/standalone_complete_spec.rb b/spec/unit/recipes/standalone_complete_spec.rb index 76c5c33..2885646 100644 --- a/spec/unit/recipes/standalone_complete_spec.rb +++ b/spec/unit/recipes/standalone_complete_spec.rb @@ -1,8 +1,11 @@ # -# Cookbook Name:: veeam +# Cookbook:: veeam # Spec:: standalone_complete # -# Copyright (c) 2016 Exosphere Data LLC, All Rights Reserved. +# maintainer:: Exosphere Data, LLC +# maintainer_email:: chef@exospheredata.com +# +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -23,7 +26,7 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['build'] = '9.5.0.1536' end let(:runner) do ChefSpec::SoloRunner.new(platform: platform, version: version, file_cache_path: '/tmp/cache') diff --git a/spec/unit/recipes/upgrade_spec.rb b/spec/unit/recipes/upgrade_spec.rb index b8bdb09..70c6852 100644 --- a/spec/unit/recipes/upgrade_spec.rb +++ b/spec/unit/recipes/upgrade_spec.rb @@ -1,11 +1,11 @@ # # Cookbook:: veeam -# Spec:: upgrade_spec +# Spec:: upgrade # # maintainer:: Exosphere Data, LLC # maintainer_email:: chef@exospheredata.com # -# Copyright:: 2018, Exosphere Data, LLC, All Rights Reserved. +# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved. require 'spec_helper' @@ -25,7 +25,7 @@ context "On #{platform} #{version}" do before do Fauxhai.mock(platform: platform, version: version) - node.normal['veeam']['build'] = '9.5.0.1536' + node.override['veeam']['build'] = '9.5.0.1536' end let(:runner) do ChefSpec::SoloRunner.new(platform: platform, version: version, file_cache_path: '/tmp/cache') diff --git a/spec/windows_helper.rb b/spec/windows_helper.rb index 090abde..7e9b920 100644 --- a/spec/windows_helper.rb +++ b/spec/windows_helper.rb @@ -44,6 +44,11 @@ def mock_windows_system_framework allow_any_instance_of(Chef::Provider) .to receive(:is_package_installed?) .and_return(false) + # Resolves issue with testing on *Nix based systems + # https://github.com/chefspec/chefspec/issues/952#issuecomment-534982612 + stubs_for_resource('windows_task') do |res| + allow(res).to receive(:user).and_return(nil) + end end def win_clean_path(path) diff --git a/templates/sql_server/ConfigurationFile.ini.erb b/templates/sql_server/ConfigurationFile.ini.erb index 94dd380..d9d4e66 100644 --- a/templates/sql_server/ConfigurationFile.ini.erb +++ b/templates/sql_server/ConfigurationFile.ini.erb @@ -8,8 +8,7 @@ IACCEPTSQLSERVERLICENSETERMS="True" ; The default is Windows Authentication. Use "SQL" for Mixed Mode Authentication. -SECURITYMODE="SQL" -SAPWD="<%= node['sql_server']['server_sa_password'] %>" +; SECURITYMODE="SQL" ; Specify whether SQL Server Setup should discover and include product updates. The valid values are True and False or 1 and 0. By default SQL Server Setup will include updates that are found. diff --git a/templates/sql_server/sql_build_script.ps1.erb b/templates/sql_server/sql_build_script.ps1.erb index f743e6f..9afbcd2 100644 --- a/templates/sql_server/sql_build_script.ps1.erb +++ b/templates/sql_server/sql_build_script.ps1.erb @@ -1,9 +1,10 @@ # Install SQL Server -if (Test-Path -Path <%= @sql_install_media %>\SQLEXPR_x64_ENU.exe){ - $installer_path = "<%= @sql_install_media %>\SQLEXPR_x64_ENU.exe" +if (Test-Path -Path <%= @sql_install_media %>){ + $installer_path = "<%= @sql_install_media %>" } else { - $installer_path = "<%= @sql_install_media %>\SqlExpress\2016SP1\SQLEXPR_x64_ENU.exe" + Set-Content -Path <%= @outputFilePath %> -Value "Failed to find the correct SQL installation media path: <%= @sql_install_media %>" + throw "Failed to find the correct SQL installation media path: <%= @sql_install_media %>" } & $installer_path <%= @sql_build_command %> | Out-File <%= @outputFilePath %> diff --git a/test/inspec/9.5.4.2399/catalog/README.md b/test/inspec/10.0.0.4461/catalog/README.md similarity index 100% rename from test/inspec/9.5.4.2399/catalog/README.md rename to test/inspec/10.0.0.4461/catalog/README.md diff --git a/test/inspec/10.0.0.4461/catalog/controls/catalog.rb b/test/inspec/10.0.0.4461/catalog/controls/catalog.rb new file mode 100644 index 0000000..475db27 --- /dev/null +++ b/test/inspec/10.0.0.4461/catalog/controls/catalog.rb @@ -0,0 +1,19 @@ +control 'catalog-feature-installed' do + impact 1.0 + title 'Verify Veeam Backup Catalog installed' + desc 'Check if the Veeam Backup Catalog instance is installed and configured' + + describe port(9393) do + it { should be_listening } + end + + describe service('VeeamCatalogSvc') do + it { should be_running } + its('startmode') { should match('Auto') } + end + + describe package('Veeam Backup Catalog') do + it { should be_installed } + its('version') { should eq '10.0.0.4461' } + end +end diff --git a/test/inspec/9.5.4.2399/catalog/inspec.yml b/test/inspec/10.0.0.4461/catalog/inspec.yml similarity index 100% rename from test/inspec/9.5.4.2399/catalog/inspec.yml rename to test/inspec/10.0.0.4461/catalog/inspec.yml diff --git a/test/inspec/9.5.4.2399/catalog/libraries/.gitkeep b/test/inspec/10.0.0.4461/catalog/libraries/.gitkeep similarity index 100% rename from test/inspec/9.5.4.2399/catalog/libraries/.gitkeep rename to test/inspec/10.0.0.4461/catalog/libraries/.gitkeep diff --git a/test/inspec/9.5.4.2399/console/README.md b/test/inspec/10.0.0.4461/console/README.md similarity index 100% rename from test/inspec/9.5.4.2399/console/README.md rename to test/inspec/10.0.0.4461/console/README.md diff --git a/test/inspec/10.0.0.4461/console/controls/console.rb b/test/inspec/10.0.0.4461/console/controls/console.rb new file mode 100644 index 0000000..b6d5055 --- /dev/null +++ b/test/inspec/10.0.0.4461/console/controls/console.rb @@ -0,0 +1,14 @@ +control 'console-feature-installed' do + impact 1.0 + title 'Verify Veeam Backup and Recovery Console installed' + desc 'Check if the Veeam Backup and Recovery Console instance is installed and configured' + + describe port(6170) do + it { should be_listening } + end + + describe package('Veeam Backup & Replication Console') do + it { should be_installed } + its('version') { should eq '10.0.0.4461' } + end +end diff --git a/test/inspec/9.5.4.2399/console/inspec.yml b/test/inspec/10.0.0.4461/console/inspec.yml similarity index 100% rename from test/inspec/9.5.4.2399/console/inspec.yml rename to test/inspec/10.0.0.4461/console/inspec.yml diff --git a/test/inspec/9.5.4.2399/console/libraries/.gitkeep b/test/inspec/10.0.0.4461/console/libraries/.gitkeep similarity index 100% rename from test/inspec/9.5.4.2399/console/libraries/.gitkeep rename to test/inspec/10.0.0.4461/console/libraries/.gitkeep diff --git a/test/inspec/9.5.4.2399/prerequisites/README.md b/test/inspec/10.0.0.4461/prerequisites/README.md similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites/README.md rename to test/inspec/10.0.0.4461/prerequisites/README.md diff --git a/test/inspec/10.0.0.4461/prerequisites/controls/prerequisites.rb b/test/inspec/10.0.0.4461/prerequisites/controls/prerequisites.rb new file mode 100644 index 0000000..ac1cdec --- /dev/null +++ b/test/inspec/10.0.0.4461/prerequisites/controls/prerequisites.rb @@ -0,0 +1,20 @@ +control 'prerequisites-feature-installed' do + impact 1.0 + title 'Verify Veeam Prerequisites installed' + desc 'Check if the Veeam Prerequisites are installed and configured' + + describe package('Microsoft System CLR Types for SQL Server 2014') do + it { should be_installed } + its('version') { should eq '12.0.2402.11' } + end + + describe package('Microsoft SQL Server 2014 Management Objects (x64)') do + it { should be_installed } + its('version') { should eq '12.0.2000.8' } + end + + describe package('SQL Server 2016 Database Engine Services') do + it { should be_installed } + its('version') { should eq '13.2.5026.0' } + end +end diff --git a/test/inspec/9.5.4.2399/prerequisites/inspec.yml b/test/inspec/10.0.0.4461/prerequisites/inspec.yml similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites/inspec.yml rename to test/inspec/10.0.0.4461/prerequisites/inspec.yml diff --git a/test/inspec/9.5.4.2399/prerequisites/libraries/.gitkeep b/test/inspec/10.0.0.4461/prerequisites/libraries/.gitkeep similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites/libraries/.gitkeep rename to test/inspec/10.0.0.4461/prerequisites/libraries/.gitkeep diff --git a/test/inspec/9.5.4.2399/prerequisites_nosql/README.md b/test/inspec/10.0.0.4461/prerequisites_nosql/README.md similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites_nosql/README.md rename to test/inspec/10.0.0.4461/prerequisites_nosql/README.md diff --git a/test/inspec/9.5.4.2399/prerequisites_nosql/controls/prerequisites.rb b/test/inspec/10.0.0.4461/prerequisites_nosql/controls/prerequisites.rb similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites_nosql/controls/prerequisites.rb rename to test/inspec/10.0.0.4461/prerequisites_nosql/controls/prerequisites.rb diff --git a/test/inspec/9.5.4.2399/prerequisites_nosql/inspec.yml b/test/inspec/10.0.0.4461/prerequisites_nosql/inspec.yml similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites_nosql/inspec.yml rename to test/inspec/10.0.0.4461/prerequisites_nosql/inspec.yml diff --git a/test/inspec/9.5.4.2399/prerequisites_nosql/libraries/.gitkeep b/test/inspec/10.0.0.4461/prerequisites_nosql/libraries/.gitkeep similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites_nosql/libraries/.gitkeep rename to test/inspec/10.0.0.4461/prerequisites_nosql/libraries/.gitkeep diff --git a/test/inspec/9.5.4.2399/server/README.md b/test/inspec/10.0.0.4461/server/README.md similarity index 100% rename from test/inspec/9.5.4.2399/server/README.md rename to test/inspec/10.0.0.4461/server/README.md diff --git a/test/inspec/10.0.0.4461/server/controls/server.rb b/test/inspec/10.0.0.4461/server/controls/server.rb new file mode 100644 index 0000000..030f1a1 --- /dev/null +++ b/test/inspec/10.0.0.4461/server/controls/server.rb @@ -0,0 +1,19 @@ +control 'Server-feature-installed' do + impact 1.0 + title 'Verify Veeam Backup Server installed' + desc 'Check if the Veeam Backup Server instance is installed and configured' + + describe port(9392) do + it { should be_listening } + end + + describe service('VeeamBackupSvc') do + it { should be_running } + its('startmode') { should match('Auto') } + end + + describe package('Veeam Backup & Replication Server') do + it { should be_installed } + its('version') { should eq '10.0.0.4461' } + end +end diff --git a/test/inspec/9.5.4.2399/server/inspec.yml b/test/inspec/10.0.0.4461/server/inspec.yml similarity index 100% rename from test/inspec/9.5.4.2399/server/inspec.yml rename to test/inspec/10.0.0.4461/server/inspec.yml diff --git a/test/inspec/9.5.4.2399/server/libraries/.gitkeep b/test/inspec/10.0.0.4461/server/libraries/.gitkeep similarity index 100% rename from test/inspec/9.5.4.2399/server/libraries/.gitkeep rename to test/inspec/10.0.0.4461/server/libraries/.gitkeep diff --git a/test/inspec/9.5.4.2615/catalog/README.md b/test/inspec/9.5.4.2615/catalog/README.md new file mode 100644 index 0000000..8e52bbc --- /dev/null +++ b/test/inspec/9.5.4.2615/catalog/README.md @@ -0,0 +1,3 @@ +# Example InSpec Profile + +This example shows the implementation of an InSpec [profile](../../docs/profiles.rst). diff --git a/test/inspec/9.5.4.2399/catalog/controls/catalog.rb b/test/inspec/9.5.4.2615/catalog/controls/catalog.rb similarity index 90% rename from test/inspec/9.5.4.2399/catalog/controls/catalog.rb rename to test/inspec/9.5.4.2615/catalog/controls/catalog.rb index 7d807fa..8edaeab 100644 --- a/test/inspec/9.5.4.2399/catalog/controls/catalog.rb +++ b/test/inspec/9.5.4.2615/catalog/controls/catalog.rb @@ -14,6 +14,6 @@ describe package('Veeam Backup Catalog') do it { should be_installed } - its('version') { should eq '9.5.4.2399' } + its('version') { should eq '9.5.4.2615' } end end diff --git a/test/inspec/9.5.4.2615/catalog/inspec.yml b/test/inspec/9.5.4.2615/catalog/inspec.yml new file mode 100644 index 0000000..318a001 --- /dev/null +++ b/test/inspec/9.5.4.2615/catalog/inspec.yml @@ -0,0 +1,8 @@ +name: backup_catalog +title: Veeam Backup Catalog Server +maintainer: 'Exosphere Data, LLC' +copyright: 'Exosphere Data, LLC' +copyright_email: chef@exospheredata.com +license: All Rights Reserved +summary: An InSpec Compliance Profile for Veeam Backup Catalog Server +version: 0.1.0 diff --git a/test/inspec/9.5.4.2615/catalog/libraries/.gitkeep b/test/inspec/9.5.4.2615/catalog/libraries/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/inspec/9.5.4.2615/console/README.md b/test/inspec/9.5.4.2615/console/README.md new file mode 100644 index 0000000..8e52bbc --- /dev/null +++ b/test/inspec/9.5.4.2615/console/README.md @@ -0,0 +1,3 @@ +# Example InSpec Profile + +This example shows the implementation of an InSpec [profile](../../docs/profiles.rst). diff --git a/test/inspec/9.5.4.2399/console/controls/console.rb b/test/inspec/9.5.4.2615/console/controls/console.rb similarity index 88% rename from test/inspec/9.5.4.2399/console/controls/console.rb rename to test/inspec/9.5.4.2615/console/controls/console.rb index ba8a109..46a2d71 100644 --- a/test/inspec/9.5.4.2399/console/controls/console.rb +++ b/test/inspec/9.5.4.2615/console/controls/console.rb @@ -9,6 +9,6 @@ describe package('Veeam Backup & Replication Console') do it { should be_installed } - its('version') { should eq '9.5.4.2399' } + its('version') { should eq '9.5.4.2615' } end end diff --git a/test/inspec/9.5.4.2615/console/inspec.yml b/test/inspec/9.5.4.2615/console/inspec.yml new file mode 100644 index 0000000..4df1405 --- /dev/null +++ b/test/inspec/9.5.4.2615/console/inspec.yml @@ -0,0 +1,8 @@ +name: veeam_vbr_console +title: Veeam Backup and Recovery Console +maintainer: 'Exosphere Data, LLC' +copyright: 'Exosphere Data, LLC' +copyright_email: chef@exospheredata.com +license: All Rights Reserved +summary: An InSpec Compliance Profile for Veeam Backup and Recovery Console +version: 0.1.0 diff --git a/test/inspec/9.5.4.2615/console/libraries/.gitkeep b/test/inspec/9.5.4.2615/console/libraries/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/inspec/9.5.4.2615/prerequisites/README.md b/test/inspec/9.5.4.2615/prerequisites/README.md new file mode 100644 index 0000000..8e52bbc --- /dev/null +++ b/test/inspec/9.5.4.2615/prerequisites/README.md @@ -0,0 +1,3 @@ +# Example InSpec Profile + +This example shows the implementation of an InSpec [profile](../../docs/profiles.rst). diff --git a/test/inspec/9.5.4.2399/prerequisites/controls/prerequisites.rb b/test/inspec/9.5.4.2615/prerequisites/controls/prerequisites.rb similarity index 100% rename from test/inspec/9.5.4.2399/prerequisites/controls/prerequisites.rb rename to test/inspec/9.5.4.2615/prerequisites/controls/prerequisites.rb diff --git a/test/inspec/9.5.4.2615/prerequisites/inspec.yml b/test/inspec/9.5.4.2615/prerequisites/inspec.yml new file mode 100644 index 0000000..fdc61b4 --- /dev/null +++ b/test/inspec/9.5.4.2615/prerequisites/inspec.yml @@ -0,0 +1,8 @@ +name: veeam_prerequisites +title: Veeam Prerequisites +maintainer: 'Exosphere Data, LLC' +copyright: 'Exosphere Data, LLC' +copyright_email: chef@exospheredata.com +license: All Rights Reserved +summary: An InSpec Compliance Profile for Veeam Prerequisites +version: 0.1.0 diff --git a/test/inspec/9.5.4.2615/prerequisites/libraries/.gitkeep b/test/inspec/9.5.4.2615/prerequisites/libraries/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/inspec/9.5.4.2615/prerequisites_nosql/README.md b/test/inspec/9.5.4.2615/prerequisites_nosql/README.md new file mode 100644 index 0000000..8e52bbc --- /dev/null +++ b/test/inspec/9.5.4.2615/prerequisites_nosql/README.md @@ -0,0 +1,3 @@ +# Example InSpec Profile + +This example shows the implementation of an InSpec [profile](../../docs/profiles.rst). diff --git a/test/inspec/9.5.4.2615/prerequisites_nosql/controls/prerequisites.rb b/test/inspec/9.5.4.2615/prerequisites_nosql/controls/prerequisites.rb new file mode 100644 index 0000000..1946d91 --- /dev/null +++ b/test/inspec/9.5.4.2615/prerequisites_nosql/controls/prerequisites.rb @@ -0,0 +1,15 @@ +control 'prerequisites-feature-installed' do + impact 1.0 + title 'Verify Veeam Prerequisites installed' + desc 'Check if the Veeam Prerequisites are installed and configured' + + describe package('Microsoft System CLR Types for SQL Server 2014') do + it { should be_installed } + its('version') { should eq '12.0.2402.11' } + end + + describe package('Microsoft SQL Server 2014 Management Objects (x64)') do + it { should be_installed } + its('version') { should eq '12.0.2000.8' } + end +end diff --git a/test/inspec/9.5.4.2615/prerequisites_nosql/inspec.yml b/test/inspec/9.5.4.2615/prerequisites_nosql/inspec.yml new file mode 100644 index 0000000..fdc61b4 --- /dev/null +++ b/test/inspec/9.5.4.2615/prerequisites_nosql/inspec.yml @@ -0,0 +1,8 @@ +name: veeam_prerequisites +title: Veeam Prerequisites +maintainer: 'Exosphere Data, LLC' +copyright: 'Exosphere Data, LLC' +copyright_email: chef@exospheredata.com +license: All Rights Reserved +summary: An InSpec Compliance Profile for Veeam Prerequisites +version: 0.1.0 diff --git a/test/inspec/9.5.4.2615/prerequisites_nosql/libraries/.gitkeep b/test/inspec/9.5.4.2615/prerequisites_nosql/libraries/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/inspec/9.5.4.2615/server/README.md b/test/inspec/9.5.4.2615/server/README.md new file mode 100644 index 0000000..8e52bbc --- /dev/null +++ b/test/inspec/9.5.4.2615/server/README.md @@ -0,0 +1,3 @@ +# Example InSpec Profile + +This example shows the implementation of an InSpec [profile](../../docs/profiles.rst). diff --git a/test/inspec/9.5.4.2399/server/controls/server.rb b/test/inspec/9.5.4.2615/server/controls/server.rb similarity index 90% rename from test/inspec/9.5.4.2399/server/controls/server.rb rename to test/inspec/9.5.4.2615/server/controls/server.rb index f362025..96af1d2 100644 --- a/test/inspec/9.5.4.2399/server/controls/server.rb +++ b/test/inspec/9.5.4.2615/server/controls/server.rb @@ -14,6 +14,6 @@ describe package('Veeam Backup & Replication Server') do it { should be_installed } - its('version') { should eq '9.5.4.2399' } + its('version') { should eq '9.5.4.2615' } end end diff --git a/test/inspec/9.5.4.2615/server/inspec.yml b/test/inspec/9.5.4.2615/server/inspec.yml new file mode 100644 index 0000000..a64fab7 --- /dev/null +++ b/test/inspec/9.5.4.2615/server/inspec.yml @@ -0,0 +1,8 @@ +name: backup_server +title: Veeam Backup and Recovery Server +maintainer: 'Exosphere Data, LLC' +copyright: 'Exosphere Data, LLC' +copyright_email: chef@exospheredata.com +license: All Rights Reserved +summary: An InSpec Compliance Profile for Veeam Backup and Recovery Server +version: 0.1.0 diff --git a/test/inspec/9.5.4.2615/server/libraries/.gitkeep b/test/inspec/9.5.4.2615/server/libraries/.gitkeep new file mode 100644 index 0000000..e69de29