diff --git a/.gitignore b/.gitignore index 8ee3f82..29435d5 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,8 @@ Thumbs.db .buildpath .vscode Servers +.chef +.vs *.class diff --git a/README.md b/README.md index af9cf54..93d806b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Included cookbooks: * [arcgis-enterprise](cookbooks/arcgis-enterprise) - installs and configures ArcGIS Server, ArcGIS Data Store, Portal for ArcGIS, ArcGIS WebAdaptor * [arcgis-geoevent](cookbooks/arcgis-geoevent) - installs and configures ArcGIS GeoEvent Server * [arcgis-notebooks](cookbooks/arcgis-notebooks) - installs and configures ArcGIS Notebook Server +* [arcgis-mission](cookbooks/arcgis-mission) - installs and configures ArcGIS Mission Server * [arcgis-insights](cookbooks/arcgis-insights) - installs and configures Insights for ArcGIS * [arcgis-desktop](cookbooks/arcgis-desktop) - installs and configures ArcGIS Desktop * [arcgis-pro](cookbooks/arcgis-pro) - installs and configures ArcGIS Pro diff --git a/cookbooks/arcgis-desktop/CHANGELOG.md b/cookbooks/arcgis-desktop/CHANGELOG.md index 8deca95..72af9ac 100644 --- a/cookbooks/arcgis-desktop/CHANGELOG.md +++ b/cookbooks/arcgis-desktop/CHANGELOG.md @@ -3,6 +3,10 @@ arcgis-desktop cookbook CHANGELOG This file is used to list changes made in each version of the arcgis-desktop cookbook. +3.6.0 +----- +- Added support for ArcGIS Desktop 10.8.1 and ArcGIS License Manager 2020.0. +- Fixed software authorization issues with single use ArcGIS Desktop licenses. 3.5.0 ----- diff --git a/cookbooks/arcgis-desktop/README.md b/cookbooks/arcgis-desktop/README.md index 3f98f76..7a15ad0 100644 --- a/cookbooks/arcgis-desktop/README.md +++ b/cookbooks/arcgis-desktop/README.md @@ -1,35 +1,43 @@ arcgis-desktop cookbook =============== -This cookbook installs and configures ArcGIS Desktop. +This cookbook installs and configures ArcGIS Desktop and ArcGIS License Manager. Requirements ------------ -### Supported ArcGIS versions -* 10.4 -* 10.4.1 -* 10.5 -* 10.5.1 -* 10.6 -* 10.6.1 -* 10.7 -* 10.7.1 -* 10.8 ### Supported ArcGIS software * ArcGIS Desktop (Windows only) + * 10.4 + * 10.4.1 + * 10.5 + * 10.5.1 + * 10.6 + * 10.6.1 + * 10.7 + * 10.7.1 + * 10.8 + * 10.8.1 + * ArcGIS License Manager + * 2018.0 + * 2018.1 + * 2019.0 + * 2019.1 + * 2019.2 + * 2020.0 ### Platforms -* Windows 7 -* Windows 8 (8.1) * Windows 10 -* Windows Server 2008 (R2) * Windows Server 2012 (R2) * Windows Server 2016 * Windows Server 2019 +* Ubuntu 16.04, 18.04 +* Rhel 6.5, 7.0 + +ArcGIS Desktop is supported only on Windows platforms. ### Dependencies The following cookbooks are required: @@ -40,19 +48,20 @@ The following cookbooks are required: Attributes ---------- -* `node['arcgis']['version']` = ArcGIS version. Default value is `10.7`. +* `node['arcgis']['version']` = ArcGIS Desktop version. Default value is `10.8.1`. * `node['arcgis']['desktop']['setup_archive']` = The location of ArcGIS Desktop setup archive. Default value depends on `node['arcgis']['version']` attribute value. -* `node['arcgis']['desktop']['setup']` = The location of ArcGIS Desktop setup executable. Default location is `%USERPROFILE#\Documents\ArcGIS10.7\Desktop\Setup.exe`. +* `node['arcgis']['desktop']['setup']` = The location of ArcGIS Desktop setup executable. Default location is `%USERPROFILE#\Documents\ArcGIS10.8.1\Desktop\Setup.exe`. * `node['arcgis']['desktop']['lp-setup']` = The location of language pack for ArcGIS Desktop. Default location is `C:\ArcGIS\DesktopLP\SetupFiles\setup.msi`. * `node['arcgis']['desktop']['install_dir']` = ArcGIS Desktop installation directory. By default, ArcGIS Desktop is installed to `%ProgramFiles(x86)%\ArcGIS`. * `node['arcgis']['desktop']['install_features']` = Comma-separated list of ArcGIS Desktop features to install. Default value is `ALL`. * `node['arcgis']['desktop']['authorization_file']` = ArcGIS Desktop authorization file path. Default location and file name are `C:\\Temp\\license.ecp`. -* `node['arcgis']['desktop']['authorization_file_version']` = ArcGIS Desktop authorization file version. Default value is `10.4`. +* `node['arcgis']['desktop']['authorization_file_version']` = ArcGIS Desktop authorization file version. Default value is `10.8`. * `node['arcgis']['desktop']['esri_license_host']` = Hostname of ArcGIS License Manager. Default hostname is `%COMPUTERNAME%`. * `node['arcgis']['desktop']['software_class']` = ArcGIS Desktop software class . Default value is `Viewer`. * `node['arcgis']['desktop']['seat_preference']` = ArcGIS Desktop license seat preference . Default value is `Fixed`. +* `node['arcgis']['licensemanager']['version']` = ArcGIS License Manager version. Default value is `2020.0`. * `node['arcgis']['licensemanager']['setup_archive']` = The location of ArcGIS License Manager setup archive. Default value depends on `node['arcgis']['version']` attribute value. -* `node['arcgis']['licensemanager']['setup']` = The location of ArcGIS License Manager setup executable. Default location is `%USERPROFILE#\Documents\ArcGIS10.7\LicenseManager\Setup.exe` on Windows, and `/opt/arcgis/10.7/licensemanager/Setup` on Linux. +* `node['arcgis']['licensemanager']['setup']` = The location of ArcGIS License Manager setup executable. Default location is `%USERPROFILE#\Documents\License Manager 2020.0\LicenseManager\Setup.exe` on Windows, and `/opt/arcgis/2020.0/LicenseManager_Linux/Setup` on Linux. * `node['arcgis']['licensemanager']['lp-setup']` = The location of language pack for ArcGIS License Manager. Default location is `C:\ArcGIS\LicenseManager\SetupFiles\setup.msi`. * `node['arcgis']['licensemanager']['install_dir']` = ArcGIS License Manager installation directory. By default, the license manager is installed to `%ProgramFiles(x86)%\ArcGIS` on Windows and `/` on Linux. @@ -85,7 +94,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2019 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-desktop/attributes/default.rb b/cookbooks/arcgis-desktop/attributes/default.rb index 9a310aa..fc27bc3 100644 --- a/cookbooks/arcgis-desktop/attributes/default.rb +++ b/cookbooks/arcgis-desktop/attributes/default.rb @@ -20,7 +20,7 @@ default['arcgis']['run_as_user'] = 'arcgis' default['arcgis']['run_as_password'] = 'Pa$$w0rdPa$$w0rd' -default['arcgis']['version'] = '10.8' +default['arcgis']['version'] = '10.8.1' case node['platform'] when 'windows' diff --git a/cookbooks/arcgis-desktop/attributes/desktop.rb b/cookbooks/arcgis-desktop/attributes/desktop.rb index dce51da..ead5b8f 100644 --- a/cookbooks/arcgis-desktop/attributes/desktop.rb +++ b/cookbooks/arcgis-desktop/attributes/desktop.rb @@ -38,6 +38,10 @@ desktop['authorization_file_version'] = node['arcgis']['version'].to_f.to_s case node['arcgis']['version'] + when '10.8.1' + desktop['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Desktop_1081_175110.exe').gsub('/', '\\') + desktop['product_code'] = '{7C4FF945-CE6A-415E-8EB9-2B61B0B35DCD}' when '10.8' desktop['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_Desktop_108_172737.exe').gsub('/', '\\') diff --git a/cookbooks/arcgis-desktop/attributes/licensemanager.rb b/cookbooks/arcgis-desktop/attributes/licensemanager.rb index a8cd868..0bc6455 100644 --- a/cookbooks/arcgis-desktop/attributes/licensemanager.rb +++ b/cookbooks/arcgis-desktop/attributes/licensemanager.rb @@ -17,48 +17,72 @@ # limitations under the License. default['arcgis']['licensemanager'].tap do |licensemanager| + licensemanager['version'] = '2020.0' + case node['platform'] when 'windows' licensemanager['setup'] = ::File.join(node['arcgis']['repository']['setups'], - 'ArcGIS ' + node['arcgis']['version'], + 'License Manager ' + node['arcgis']['licensemanager']['version'], 'LicenseManager', 'Setup.exe') licensemanager['lp-setup'] = 'C:\\ArcGIS\\LicenseManager\\SetupFiles\\setup.msi' licensemanager['install_dir'] = ENV['ProgramFiles(x86)'] + '\\ArcGIS' - case node['arcgis']['version'] - when '10.8' + case node['arcgis']['licensemanager']['version'] + when '2020.0' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Windows_2020_0_175435.exe').gsub('/', '\\') + licensemanager['product_code'] = '{F89EA66A-6AC2-401C-B8A0-E3ABDB5EDC10}' + when '2019.2' licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_License_Manager_Windows_2019_2_173083.exe').gsub('/', '\\') licensemanager['product_code'] = '{77F1D4EB-0225-4626-BB9E-7FCB4B0309E5}' - when '10.7' + when '2019.1' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Windows_2019_1_172308.exe').gsub('/', '\\') + licensemanager['product_code'] = '{BA3C546E-6FAC-405C-B2C9-30BC6E26A7A9}' + when '2019.0' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Windows_2019_0_169344.exe').gsub('/', '\\') + licensemanager['product_code'] = '{CB1E78B5-9914-45C6-8227-D55F4CD5EA6F}' + when '2018.1' licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_License_Manager_Windows_2018_1_167080.exe').gsub('/', '\\') licensemanager['product_code'] = '{E1C26E47-C6AB-4120-A3DE-2FA0F723C876}' - when '10.6.1' + when '2018.0' licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_License_Manager_Windows_2018_0_163304.exe').gsub('/', '\\') - licensemanager['product_code'] = '{1914B5D6-02C2-4CA3-9CAB-EE76358228CF}' - when '10.6' - licensemanager['product_code'] = '{D6AF20B5-825F-44A9-915D-C2868CBD59F3}' - when '10.5.1' - licensemanager['product_code'] = '{DF06C3DC-54B5-49A1-9756-B68FD65A0AD0}' - when '10.5' - licensemanager['product_code'] = '{3A024FEA-3E14-4257-87D0-8FCA03257560}' - when '10.4.1' - licensemanager['product_code'] = '{D71379AF-A72B-4B10-A7BA-64BC6AF6841B}' - when '10.4' - licensemanager['product_code'] = '{E1393226-725C-42F8-A672-4E5AC55EFBDE}' + licensemanager['product_code'] = '{CFF43ACB-9B0C-4725-B489-7F969F5B90AB}' else - Chef::Log.warn 'Unsupported ArcGIS version' + Chef::Log.warn 'Unsupported ArcGIS License Manager version' end else # node['platform'] == 'linux' licensemanager['setup'] = ::File.join(node['arcgis']['repository']['setups'], - node['arcgis']['version'], - 'licensemanager', 'Setup') + node['arcgis']['licensemanager']['version'], + 'LicenseManager_Linux', 'Setup') licensemanager['install_dir'] = '/' - licensemanager['install_subdir'] = 'arcgis/license' + node['arcgis']['version'] + licensemanager['install_subdir'] = 'arcgis/license' + node['arcgis']['licensemanager']['version'] - licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], - 'ArcGIS_License_Manager_Linux_2018_1_167092.tar.gz') + case node['arcgis']['licensemanager']['version'] + when '2020.0' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Linux_2020_0_174031.tar.gz') + when '2019.2' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Linux_2019_2_173095.tar.gz') + when '2019.1' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Linux_2019_1_172320.tar.gz') + when '2019.0' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Linux_2019_0_169356.tar.gz') + when '2018.1' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Linux_2018_1_167092.tar.gz') + when '2018.0' + licensemanager['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_License_Manager_Linux_2018_0_163516.tar.gz') + else + Chef::Log.warn 'Unsupported ArcGIS License Manager version' + end end end diff --git a/cookbooks/arcgis-desktop/metadata.rb b/cookbooks/arcgis-desktop/metadata.rb index af5c2e1..ea8656b 100644 --- a/cookbooks/arcgis-desktop/metadata.rb +++ b/cookbooks/arcgis-desktop/metadata.rb @@ -2,15 +2,16 @@ maintainer 'Esri' maintainer_email 'contracts@esri.com' license 'Apache 2.0' -description 'Installs and configures ArcGIS Desktop' +description 'Installs and configures ArcGIS Desktop and ArcGIS License Manager' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-repository', '~> 3.6' depends 'windows', '~> 5.3' depends 'limits', '~> 1.0' supports 'windows' +supports 'ubuntu' recipe 'arcgis-desktop::default', 'Installs ArcGIS Desktop' recipe 'arcgis-desktop::licensemanager', 'Installs ArcGIS License Manager' diff --git a/cookbooks/arcgis-desktop/providers/desktop.rb b/cookbooks/arcgis-desktop/providers/desktop.rb index 0b5bc2d..bbf05f1 100644 --- a/cookbooks/arcgis-desktop/providers/desktop.rb +++ b/cookbooks/arcgis-desktop/providers/desktop.rb @@ -37,11 +37,15 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + cmd = @new_resource.setup if @new_resource.seat_preference == 'Fixed' - args = "/qb ADDLOCAL=\"#{@new_resource.install_features}\" INSTALLDIR=\"#{@new_resource.install_dir}\" INSTALLDIR1=\"#{@new_resource.python_dir}\" DESKTOP_CONFIG=\"#{@new_resource.desktop_config}\" MODIFYFLEXDACL=\"#{@new_resource.modifyflexdacl}\"" + args = "/qn ADDLOCAL=\"#{@new_resource.install_features}\" INSTALLDIR=\"#{@new_resource.install_dir}\" INSTALLDIR1=\"#{@new_resource.python_dir}\" DESKTOP_CONFIG=\"#{@new_resource.desktop_config}\" MODIFYFLEXDACL=\"#{@new_resource.modifyflexdacl}\"" else - args = "/qb ADDLOCAL=\"#{@new_resource.install_features}\" INSTALLDIR=\"#{@new_resource.install_dir}\" INSTALLDIR1=\"#{@new_resource.python_dir}\" ESRI_LICENSE_HOST=\"#{@new_resource.esri_license_host}\" SOFTWARE_CLASS=\"#{@new_resource.software_class}\" SEAT_PREFERENCE=\"#{@new_resource.seat_preference}\" DESKTOP_CONFIG=\"#{@new_resource.desktop_config}\" MODIFYFLEXDACL=\"#{@new_resource.modifyflexdacl}\"" + args = "/qn ADDLOCAL=\"#{@new_resource.install_features}\" INSTALLDIR=\"#{@new_resource.install_dir}\" INSTALLDIR1=\"#{@new_resource.python_dir}\" ESRI_LICENSE_HOST=\"#{@new_resource.esri_license_host}\" SOFTWARE_CLASS=\"#{@new_resource.software_class}\" SEAT_PREFERENCE=\"#{@new_resource.seat_preference}\" DESKTOP_CONFIG=\"#{@new_resource.desktop_config}\" MODIFYFLEXDACL=\"#{@new_resource.modifyflexdacl}\"" end cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) @@ -54,7 +58,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command @@ -66,6 +70,10 @@ action :authorize do if @new_resource.seat_preference == 'Fixed' + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + cmd = node['arcgis']['desktop']['authorization_tool'] args = "/S /VER \"#{@new_resource.authorization_file_version}\" /LIF \"#{@new_resource.authorization_file}\"" diff --git a/cookbooks/arcgis-desktop/providers/licensemanager.rb b/cookbooks/arcgis-desktop/providers/licensemanager.rb index 0f876ec..7858873 100644 --- a/cookbooks/arcgis-desktop/providers/licensemanager.rb +++ b/cookbooks/arcgis-desktop/providers/licensemanager.rb @@ -54,7 +54,7 @@ else cmd = 'tar' args = "xzvf \"#{@new_resource.setup_archive}\"" - repo = ::File.join(@new_resource.setups_repo, node['arcgis']['version']) + repo = ::File.join(@new_resource.setups_repo, node['arcgis']['licensemanager']['version']) FileUtils.mkdir_p(repo) unless ::File.directory?(repo) cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600, :cwd => repo }) cmd.run_command @@ -67,9 +67,13 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup - args = "/qb ADDLOCAL=ALL INSTALLDIR=\"#{@new_resource.install_dir}\" INSTALLDIR1=\"#{@new_resource.python_dir}\"" + args = "/qn ADDLOCAL=ALL INSTALLDIR=\"#{@new_resource.install_dir}\" INSTALLDIR1=\"#{@new_resource.python_dir}\"" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}") cmd.run_command @@ -107,7 +111,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{product_code}" + args = "/qn /x #{product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}") cmd.run_command diff --git a/cookbooks/arcgis-desktop/recipes/default.rb b/cookbooks/arcgis-desktop/recipes/default.rb index 11d9da1..6583422 100644 --- a/cookbooks/arcgis-desktop/recipes/default.rb +++ b/cookbooks/arcgis-desktop/recipes/default.rb @@ -48,5 +48,6 @@ arcgis_desktop_desktop 'Authorize ArcGIS Desktop' do authorization_file node['arcgis']['desktop']['authorization_file'] authorization_file_version node['arcgis']['desktop']['authorization_file_version'] + seat_preference node['arcgis']['desktop']['seat_preference'] action :authorize end diff --git a/cookbooks/arcgis-desktop/recipes/licensemanager.rb b/cookbooks/arcgis-desktop/recipes/licensemanager.rb index c609242..9f210ac 100644 --- a/cookbooks/arcgis-desktop/recipes/licensemanager.rb +++ b/cookbooks/arcgis-desktop/recipes/licensemanager.rb @@ -26,7 +26,9 @@ setups_repo node['arcgis']['repository']['setups'] only_if { ::File.exist?(node['arcgis']['licensemanager']['setup_archive']) && !::File.exist?(node['arcgis']['licensemanager']['setup']) } - not_if { Utils.product_installed?(node['arcgis']['licensemanager']['product_code']) } + if node['platform'] == 'windows' + not_if { Utils.product_installed?(node['arcgis']['licensemanager']['product_code']) } + end action :unpack end diff --git a/cookbooks/arcgis-desktop/resources/licensemanager.rb b/cookbooks/arcgis-desktop/resources/licensemanager.rb index 736b8c7..82485ca 100644 --- a/cookbooks/arcgis-desktop/resources/licensemanager.rb +++ b/cookbooks/arcgis-desktop/resources/licensemanager.rb @@ -20,7 +20,7 @@ actions :system, :unpack, :install, :uninstall attribute :setup_archive, :kind_of => String -attribute :setup_repo, :kind_of => String +attribute :setups_repo, :kind_of => String attribute :setup, :kind_of => String attribute :product_code, :kind_of => String attribute :install_dir, :kind_of => String diff --git a/cookbooks/arcgis-egdb/README.md b/cookbooks/arcgis-egdb/README.md index b18e121..83a9355 100644 --- a/cookbooks/arcgis-egdb/README.md +++ b/cookbooks/arcgis-egdb/README.md @@ -48,7 +48,7 @@ ArcPy does not support creating databases in Amazon RDS database servers. The co [{ "database" : "egdb", "data_item_path" : "/enterpriseDatabases/registeredDatabase", - "connection_file": "C:\\chef\\msic_scripts\\connection_files\\RDS_egdb.sde", + "connection_file": "C:\\chef\\misc_scripts\\connection_files\\RDS_egdb.sde", "is_managed" : true, "connection_type" : "shared" }] @@ -135,7 +135,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines ## Licensing -Copyright 2019 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-enterprise/CHANGELOG.md b/cookbooks/arcgis-enterprise/CHANGELOG.md index d90209e..26b2504 100644 --- a/cookbooks/arcgis-enterprise/CHANGELOG.md +++ b/cookbooks/arcgis-enterprise/CHANGELOG.md @@ -3,6 +3,11 @@ arcgis-enterprise cookbook CHANGELOG This file is used to list changes made in each version of the arcgis-enterprise cookbook. +3.6.0 +----- +- Added support for ArcGIS Enterprise 10.8.1. +- Added support for importing root SSL certificate into ArcGIS Server. + 3.5.0 ----- - Added support for ArcGIS Enterprise 10.8. diff --git a/cookbooks/arcgis-enterprise/README.md b/cookbooks/arcgis-enterprise/README.md index ae5e0bd..26e3b37 100644 --- a/cookbooks/arcgis-enterprise/README.md +++ b/cookbooks/arcgis-enterprise/README.md @@ -11,6 +11,7 @@ Requirements * 10.7 * 10.7.1 * 10.8 +* 10.8.1 ### Supported ArcGIS software @@ -49,7 +50,7 @@ Attributes #### General -* `node['arcgis']['version']` = ArcGIS version. Default value is `10.7`. +* `node['arcgis']['version']` = ArcGIS version. Default value is `10.8.1`. * `node['arcgis']['run_as_user']` = Account used to run ArcGIS Server, Portal for ArcGIS, and ArcGIS Data Store. Default account name is `arcgis`. * `node['arcgis']['run_as_password']` = Password for the account used to run ArcGIS Server, Portal for ArcGIS, and ArcGIS Data Store. Default value is`Pa$$w0rdPa$$w0rd`. @@ -98,6 +99,8 @@ Portal for ArcGIS, and ArcGIS Data Store. Default value is`Pa$$w0rdPa$$w0rd`. * `node['arcgis']['server']['keystore_file']` = Path to PKSC12 keystore file (.pfx) with SSL certificate for ArcGIS Server. Default value is `nil`. * `node['arcgis']['server']['keystore_password']` = Keystore file password for ArcGIS Server. Default value is `nil`. * `node['arcgis']['server']['cert_alias']` = SSL certificate alias for ArcGIS Server. Default alias is composed of these values: `node['arcgis']['server']['domain_name']`. +* `node['arcgis']['server']['root_cert']` = ArcGIS Server root CA certificate file path. Default value is `''`. +* `node['arcgis']['server']['root_cert_alias']` = ArcGIS Server root CA certificate alias. Default value is `''`. * `node['arcgis']['server']['system_properties']` = ArcGIS Server system properties. Default value is `{}`. * `node['arcgis']['server']['log_level']` = ArcGIS Server log level. Default value is `WARNING`. * `node['arcgis']['server']['log_dir']` = ArcGIS Server log directory. Default value is `C:\arcgisserver\logs` on Windows and `/arcgis/server/usr/logs` on Linux. @@ -116,6 +119,7 @@ Portal for ArcGIS, and ArcGIS Data Store. Default value is`Pa$$w0rdPa$$w0rd`. * `node['arcgis']['server']['hsts_enabled']` = HTTP Strict Transport Security enabled. Default value is `false`. * `node['arcgis']['server']['virtual_dirs_security_enabled']` = Security for virtual directories enabled. Default value is `false`. * `node['arcgis']['server']['allow_direct_access']` = Allow direct access to server. Default value is `true`. +* `node['arcgis']['server']['allowed_admin_access_ips']` = A comma separated list of client machine IP addresses that are allowed access to ArcGIS Server. `''`. #### Web Adaptor @@ -125,6 +129,7 @@ Portal for ArcGIS, and ArcGIS Data Store. Default value is`Pa$$w0rdPa$$w0rd`. * `node['arcgis']['web_adaptor']['lp-setup']` = The location of language pack for ArcGIS Web Adaptor. Default location is `nil`. * `node['arcgis']['web_adaptor']['setup_archive']` = Path to ArcGIS Web Adaptor setup archive. Default value depends on `node['arcgis']['version']` attribute value. * `node['arcgis']['web_adaptor']['install_dir']` = ArcGIS Web Adaptor installation directory (Linux only). By default, ArcGIS Web Adaptor is installed to `/` on Linux. +* `node['arcgis']['web_adaptor']['reindex_portal_content']` = If set to `true`, Web Adaptor registration reindexes Portal for ArcGIS content. Default value is `true`. #### Portal @@ -195,6 +200,7 @@ Portal for ArcGIS, and ArcGIS Data Store. Default value is`Pa$$w0rdPa$$w0rd`. * `node['arcgis']['data_store']['hostidentifier']` = Host name or IP address of ArcGIS Data Store machine. Default value is `''`. * `node['arcgis']['data_store']['preferredidentifier']` = ArcGIS Data Store preferred identifier method . Default method used is `hostname`. * `node['arcgis']['data_store']['types']` = Comma-separated list of ArcGIS Data Store types to be created, . By default, `tileCache,relational` is used. +* `node['arcgis']['data_store']['mode']` = Tile cache ArcGIS Data Store mode, <|primaryStandby|cluster>. Supported from ArcGIS Data Store 10.8.1. The default value is empty string `` that means use the mode default for the ArcGIS Data Store version or the currently configured mode. * `node['arcgis']['data_store']['relational']['backup_type']` = Type of location to use for relational Data Store backups . The default value is `fs`. * `node['arcgis']['data_store']['relational']['backup_location']` = Relational Data Store backup location. The default location is `node['arcgis']['data_store']['backup_dir']/relational`). * `node['arcgis']['data_store']['tilecache']['backup_type']` = Type of location to use for tile cache Data Store backups . The default value is `fs`. @@ -363,6 +369,10 @@ Unregisters server machine from the ArcGIS Server site. Unregisters all unavailable server machines in 'default' cluster from the ArcGIS Server site. +### arcgis-enterprise::unregister_server_wa + +Unregisters all Web Adaptors registered with ArcGIS Server. + ### arcgis-enterprise::enterprise_validate Checks if ArcGIS Enterprise setups and authorization files exist. @@ -387,7 +397,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2019 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-enterprise/attributes/datastore.rb b/cookbooks/arcgis-enterprise/attributes/datastore.rb index 2f669dc..255fde9 100644 --- a/cookbooks/arcgis-enterprise/attributes/datastore.rb +++ b/cookbooks/arcgis-enterprise/attributes/datastore.rb @@ -27,6 +27,7 @@ data_store['hostidentifier'] = '' data_store['types'] = 'tileCache,relational' + data_store['mode'] = '' data_store['configure_autostart'] = true data_store['install_system_requirements'] = true data_store['setup_archive'] = '' @@ -43,6 +44,10 @@ data_store['data_dir'] = 'C:\\arcgisdatastore' case node['arcgis']['version'] + when '10.8.1' + data_store['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_DataStore_Windows_1081_175216.exe').gsub('/', '\\') + data_store['product_code'] = '{45E1C306-B1AB-4AE5-8435-818F0F9F8821}' when '10.8' data_store['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_DataStore_Windows_108_172872.exe').gsub('/', '\\') @@ -94,6 +99,9 @@ data_store['lp-setup'] = node['arcgis']['data_store']['setup'] case node['arcgis']['version'] + when '10.8.1' + data_store['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_DataStore_Linux_1081_175312.tar.gz') when '10.8' data_store['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_DataStore_Linux_108_172991.tar.gz') diff --git a/cookbooks/arcgis-enterprise/attributes/default.rb b/cookbooks/arcgis-enterprise/attributes/default.rb index 26dc407..a92517b 100644 --- a/cookbooks/arcgis-enterprise/attributes/default.rb +++ b/cookbooks/arcgis-enterprise/attributes/default.rb @@ -27,17 +27,19 @@ default['arcgis']['run_as_msa'] = false -default['arcgis']['version'] = '10.8' +default['arcgis']['version'] = '10.8.1' default['arcgis']['cache_authorization_files'] = false default['arcgis']['configure_windows_firewall'] = false +default['arcgis']['cloud']['provider'] = '' + if node['cloud'] || ENV['arcgis_cloud_platform'] == 'aws' default['arcgis']['configure_cloud_settings'] = true if ENV['arcgis_cloud_platform'] == 'aws' default['arcgis']['cloud']['provider'] = 'ec2' - else + elsif !node['cloud']['provider'].nil? default['arcgis']['cloud']['provider'] = node['cloud']['provider'] end else diff --git a/cookbooks/arcgis-enterprise/attributes/portal.rb b/cookbooks/arcgis-enterprise/attributes/portal.rb index 4b79de8..ad3fe1a 100644 --- a/cookbooks/arcgis-enterprise/attributes/portal.rb +++ b/cookbooks/arcgis-enterprise/attributes/portal.rb @@ -104,6 +104,10 @@ portal['data_dir'] = 'C:\\arcgisportal' case node['arcgis']['version'] + when '10.8.1' + portal['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'Portal_for_ArcGIS_Windows_1081_175214.exe').gsub('/', '\\') + portal['product_code'] = '{0803DE56-BAE9-49F5-A120-BA249BD924E2}' when '10.8' portal['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Portal_for_ArcGIS_Windows_108_172870.exe').gsub('/', '\\') @@ -185,6 +189,9 @@ portal['lp-setup'] = node['arcgis']['server']['setup'] case node['arcgis']['version'] + when '10.8.1' + portal['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'Portal_for_ArcGIS_Linux_1081_175300.tar.gz') when '10.8' portal['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Portal_for_ArcGIS_Linux_108_172989.tar.gz') diff --git a/cookbooks/arcgis-enterprise/attributes/server.rb b/cookbooks/arcgis-enterprise/attributes/server.rb index b95319f..c04de7f 100644 --- a/cookbooks/arcgis-enterprise/attributes/server.rb +++ b/cookbooks/arcgis-enterprise/attributes/server.rb @@ -28,11 +28,13 @@ if node['fqdn'].nil? || node['arcgis']['configure_cloud_settings'] server_domain_name = node['ipaddress'] server['domain_name'] = server_domain_name + server['hostname'] = node['ipaddress'] server['url'] = "https://#{node['ipaddress']}:6443/arcgis" server['wa_url'] = "https://#{node['ipaddress']}/#{server_wa_name}" else server_domain_name = node['fqdn'] server['domain_name'] = server_domain_name + server['hostname'] = '' # Use the default server machine hostname server['url'] = "https://#{node['fqdn']}:6443/arcgis" server['wa_url'] = "https://#{node['fqdn']}/#{server_wa_name}" end @@ -41,7 +43,6 @@ server_domain_name = node['arcgis']['server']['domain_name'] end - server['hostname'] = '' # Use the default server machine hostname server['private_url'] = "https://#{server_domain_name}:6443/arcgis" server['web_context_url'] = "https://#{server_domain_name}/#{server_wa_name}" server['admin_username'] = 'admin' @@ -59,6 +60,8 @@ server['keystore_password'] = ENV['ARCGIS_SERVER_KEYSTORE_PASSWORD'] end server['cert_alias'] = server_domain_name + server['root_cert'] = '' + server['root_cert_alias'] = '' server['system_properties'] = {} server['log_level'] = 'WARNING' server['max_log_file_age'] = 90 @@ -73,6 +76,7 @@ server['hsts_enabled'] = false server['virtual_dirs_security_enabled'] = false server['allow_direct_access'] = true + server['allowed_admin_access_ips'] = '' # hash of environment variables to pass to the install command. # e.g. server['install_environment'] = { 'IATEMPDIR' => /var/tmp' } @@ -97,6 +101,9 @@ server['setup_archive'] = '' server['product_code'] = '' + # disable nodeagent plugins on aws ec2 + server['disable_nodeagent_plugins'] = true + case node['platform'] when 'windows' server['authorization_tool'] = ::File.join(ENV['ProgramW6432'], @@ -114,6 +121,13 @@ server['local_directories_root'] = 'C:\\arcgisserver' case node['arcgis']['version'] + when '10.8.1' + server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Server_Windows_1081_175203.exe').gsub('/', '\\') + server['product_code'] = '{E9B85E31-4C31-4528-996B-F06E213F8BB3}' + default['arcgis']['python']['runtime_environment'] = File.join(node['arcgis']['python']['install_dir'], + "ArcGISx6410.8").gsub('/', '\\') + when '10.8' server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_Server_Windows_108_172859.exe').gsub('/', '\\') @@ -220,6 +234,9 @@ server['lp-setup'] = node['arcgis']['server']['setup'] case node['arcgis']['version'] + when '10.8.1' + server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Server_Linux_1081_175289.tar.gz') when '10.8' server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_Server_Linux_108_172977.tar.gz') diff --git a/cookbooks/arcgis-enterprise/attributes/webadaptor.rb b/cookbooks/arcgis-enterprise/attributes/webadaptor.rb index c2ec855..e9b60ae 100644 --- a/cookbooks/arcgis-enterprise/attributes/webadaptor.rb +++ b/cookbooks/arcgis-enterprise/attributes/webadaptor.rb @@ -34,6 +34,12 @@ web_adaptor['install_dir'] = '' case node['arcgis']['version'] + when '10.8.1' + web_adaptor['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Web_Adaptor_for_Microsoft_IIS_1081_175217.exe').gsub('/', '\\') + web_adaptor['product_code'] = '{9695EF78-A2A8-4383-AFBF-627C55FE31DC}' + web_adaptor['product_code2'] = '{56F26E70-2C61-45BC-A624-E100175086F7}' + web_adaptor['config_web_adaptor_exe'] = '\\ArcGIS\\WebAdaptor\\IIS\\10.8.1\\Tools\\ConfigureWebAdaptor.exe' when '10.8' web_adaptor['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Web_Adaptor_for_Microsoft_IIS_108_172749.exe').gsub('/', '\\') @@ -109,7 +115,9 @@ '{5ECEF84F-592C-47D1-B7C5-9F3D7E2AB7CE}', '{5F1D01EA-296E-4226-A704-6A90E2916782}', '{D6059C27-7199-4A94-806B-6C40EFD02828}', - '{E77ED9CA-7DC8-45FC-A8BB-57AD2096EF8A}'] + '{E77ED9CA-7DC8-45FC-A8BB-57AD2096EF8A}', + '{9695EF78-A2A8-4383-AFBF-627C55FE31DC}', + '{56F26E70-2C61-45BC-A624-E100175086F7}'] else # node['platform'] == 'linux' web_adaptor['setup'] = ::File.join(node['arcgis']['repository']['setups'], node['arcgis']['version'], @@ -117,6 +125,9 @@ web_adaptor['lp-setup'] = node['arcgis']['web_adaptor']['setup'] case node['arcgis']['version'] + when '10.8.1' + web_adaptor['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Web_Adaptor_Java_Linux_1081_175313.tar.gz') when '10.8' web_adaptor['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Web_Adaptor_Java_Linux_108_172992.tar.gz') @@ -159,4 +170,7 @@ end web_adaptor['setup_options'] = '' + + # Starting from ArcGIS 10.8.1 Web Adaptor registration supports 'ReindexPortalContent' option. + web_adaptor['reindex_portal_content'] = true end diff --git a/cookbooks/arcgis-enterprise/attributes/webstyles.rb b/cookbooks/arcgis-enterprise/attributes/webstyles.rb index 62d42ce..847c0e9 100644 --- a/cookbooks/arcgis-enterprise/attributes/webstyles.rb +++ b/cookbooks/arcgis-enterprise/attributes/webstyles.rb @@ -24,6 +24,10 @@ 'ArcGISWebStyles', 'Setup.exe').tr('/', '\\') case node['arcgis']['version'] + when '10.8.1' + webstyles['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'Portal_for_ArcGIS_Web_Styles_Windows_1081_175215.exe').tr('/', '\\') + webstyles['product_code'] = '{7748EA55-04FF-45E2-98EC-C78095AC25AA}' when '10.8' webstyles['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Portal_for_ArcGIS_Web_Styles_Windows_108_172871.exe').tr('/', '\\') @@ -41,6 +45,9 @@ 'WebStyles', 'WebStyles-Setup.sh') case node['arcgis']['version'] + when '10.8.1' + webstyles['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'Portal_for_ArcGIS_Web_Styles_Linux_1081_175311.tar.gz') when '10.8' webstyles['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Portal_for_ArcGIS_Web_Styles_Linux_108_172990.tar.gz') diff --git a/cookbooks/arcgis-enterprise/libraries/server_admin_client.rb b/cookbooks/arcgis-enterprise/libraries/server_admin_client.rb index c4bb743..a92ccad 100644 --- a/cookbooks/arcgis-enterprise/libraries/server_admin_client.rb +++ b/cookbooks/arcgis-enterprise/libraries/server_admin_client.rb @@ -84,6 +84,16 @@ def wait_until_site_exist end end + def wait_until_service_started(service_name) + MAX_RETRIES.times do + if service_started?(service_name) + break + end + + sleep(SLEEP_TIME) + end + end + def info uri = URI.parse(@server_url + '/rest/info') @@ -139,7 +149,8 @@ def upgrade_required? if response.code.to_i == 200 return JSON.parse(response.body)['upgradeStatus'] == 'UPGRADE_REQUIRED' || - JSON.parse(response.body)['upgradeStatus'] == 'LAST_ATTEMPT_FAILED' + JSON.parse(response.body)['upgradeStatus'] == 'LAST_ATTEMPT_FAILED' || + JSON.parse(response.body)['isUpgrade'] # Notebook Server end false @@ -253,7 +264,7 @@ def add_machine_to_cluster(machine_name, cluster) validate_response(response) end - def ssl_certificate_exist?(machine_name, cert_alias) + def ssl_certificate_exist?(machine_name, cert_alias, entry_type = 'PrivateKeyEntry') request = Net::HTTP::Post.new(URI.parse(@server_url + "/admin/machines/#{machine_name}/sslcertificates/#{cert_alias}").request_uri) @@ -267,7 +278,7 @@ def ssl_certificate_exist?(machine_name, cert_alias) validate_response(response) - JSON.parse(response.body)['entryType'] == 'PrivateKeyEntry' + JSON.parse(response.body)['entryType'] == entry_type rescue Exception false end @@ -298,6 +309,31 @@ def import_server_ssl_certificate(machine_name, cert_file, cert_password, cert_a validate_response(response) end + def import_root_ssl_certificate(machine_name, cert_file, cert_alias) + begin + require 'net/http/post/multipart' + rescue LoadError + Chef::Log.error("Missing gem 'multipart-post'. Use the 'system' recipe to install it first.") + end + + url = URI.parse(@server_url + + "/admin/machines/#{machine_name}/sslcertificates/importRootOrIntermediate") + + token = generate_token() + + request = Net::HTTP::Post::Multipart.new url.path, + 'rootCACertificate' => UploadIO.new(File.new(cert_file), 'application/x-x509-ca-cert', cert_alias), + 'alias' => cert_alias, + 'token' => token, + 'f' => 'json' + + request.add_field('Referer', 'referer') + + response = send_request(request, @server_url) + + validate_response(response) + end + def machine_info(machine_name) request = Net::HTTP::Post.new(URI.parse(@server_url + "/admin/machines/#{machine_name}").request_uri) @@ -483,7 +519,7 @@ def security_configuration # Update server security config def update_security_configuration(server_protocol, auth_mode, auth_tier, hsts_enabled, virtual_dirs_security_enabled, - allow_direct_access) + allow_direct_access, allowed_admin_access_ips) if security_configuration['authenticationTier'] == 'ARCGIS_PORTAL' Chef::Log.info("The server is federated. Skip the security configuration update.") return @@ -504,6 +540,7 @@ def update_security_configuration(server_protocol, auth_mode, auth_tier, 'HSTSEnabled' => hsts_enabled, 'virtualDirsSecurityEnabled' => virtual_dirs_security_enabled, 'allowDirectAccess' => allow_direct_access, + 'allowedAdminAccessIPs' => allowed_admin_access_ips, 'f' => 'json') response = send_request(request, @server_url) @@ -601,6 +638,52 @@ def service_exists?(service_name) end end + def configured_service_state(service_name) + return false if service_name.nil? || service_name.empty? + + request = Net::HTTP::Post.new(URI.parse(@server_url + + '/admin/services/' + service_name + '/status').request_uri) + + request.add_field('Referer', 'referer') + + token = generate_token() + + request.set_form_data('token' => token, 'f' => 'json') + + response = send_request(request, @server_url) + + begin + validate_response(response) + + return JSON.parse(response.body)['configuredState'] + rescue Exception => ex + return false + end + end + + def service_started?(service_name) + return false if service_name.nil? || service_name.empty? + + request = Net::HTTP::Post.new(URI.parse(@server_url + + '/admin/services/' + service_name + '/status').request_uri) + + request.add_field('Referer', 'referer') + + token = generate_token() + + request.set_form_data('token' => token, 'f' => 'json') + + response = send_request(request, @server_url) + + begin + validate_response(response) + + return JSON.parse(response.body)['realTimeState'] == 'STARTED' + rescue Exception => ex + return false + end + end + def start_service(service_name) return if service_name.nil? || service_name.empty? @@ -858,6 +941,42 @@ def remove_machine_from_cluster(machine_name, cluster = 'default') validate_response(response) end + def unregister_web_adaptor(id) + request = Net::HTTP::Post.new(URI.parse(@server_url + + "/admin/system/webadaptors/#{id}/unregister").request_uri) + + request.add_field('Referer', 'referer') + + token = generate_token() + + request.set_form_data('token' => token, 'f' => 'json') + + response = send_request(request, @server_url) + + validate_response(response) + end + + def unregister_web_adaptors + request = Net::HTTP::Post.new(URI.parse(@server_url + + "/admin/system/webadaptors").request_uri) + + request.add_field('Referer', 'referer') + + token = generate_token() + + request.set_form_data('token' => token, 'f' => 'json') + + response = send_request(request, @server_url) + + validate_response(response) + + web_adaptors = JSON.parse(response.body)['webAdaptors'] + + web_adaptors.each do |web_adaptor| + unregister_web_adaptor(web_adaptor['id']) + end + end + private def send_request(request, url) diff --git a/cookbooks/arcgis-enterprise/libraries/server_rest_client.rb b/cookbooks/arcgis-enterprise/libraries/server_rest_client.rb index c3fcc55..261d38c 100644 --- a/cookbooks/arcgis-enterprise/libraries/server_rest_client.rb +++ b/cookbooks/arcgis-enterprise/libraries/server_rest_client.rb @@ -112,6 +112,66 @@ def publish_service_definition(uploaded_item_id, config_overwrite, publish_optio end end + def add_service_permission(service, service_type, role) + uri = URI.parse(@server_url + '/admin/services/' + service + '.' + service_type + '/permissions/add') + request = Net::HTTP::Post.new(uri.request_uri) + request.add_field('Referer', 'referer') + + token = generate_token() + + request.set_form_data('principal' => role, + 'isAllowed' => 'true', + 'token' => token, + 'f' => 'json') + + response = send_request(request, @server_url) + + validate_response(response) + end + + def clean_service_permissions(role) + uri = URI.parse(@server_url + '/admin/services/permissions/clean') + request = Net::HTTP::Post.new(uri.request_uri) + request.add_field('Referer', 'referer') + + token = generate_token() + + request.set_form_data('principal' => role, + 'token' => token, + 'f' => 'json') + + response = send_request(request, @server_url) + + validate_response(response) + end + + def upload_service_item(service, service_type, item_folder, item_file) + begin + require 'net/http/post/multipart' + rescue LoadError + Chef::Log.error("Missing gem 'multipart-post'. Use the 'system' recipe to install it first.") + end + + return if item_file.nil? || item_file.empty? + + url = URI.parse(@server_url + '/admin/services/' + service + '.' + service_type + '/iteminfo/upload') + request = Net::HTTP::Post.new(url.request_uri) + + token = generate_token() + + request = Net::HTTP::Post::Multipart.new url.path, + 'folder' => item_folder, + 'file' => UploadIO.new(File.new(item_file), 'application/octet-stream', File.basename(item_file)), + 'token' => token, + 'f' => 'json' + + request.add_field('Referer', 'referer') + + response = send_request(request, @server_url) + + validate_response(response) + end + def get_database_connection_string(uploaded_connection_file_id) tool = '/rest/services/System/PublishingTools/GPServer/Get%20Database%20Connection%20String' request = Net::HTTP::Post.new(URI.parse(@server_url + tool + '/submitJob').request_uri) diff --git a/cookbooks/arcgis-enterprise/metadata.rb b/cookbooks/arcgis-enterprise/metadata.rb index a7f8ee8..e0b610e 100644 --- a/cookbooks/arcgis-enterprise/metadata.rb +++ b/cookbooks/arcgis-enterprise/metadata.rb @@ -4,10 +4,10 @@ license 'Apache 2.0' description 'Installs and configures ArcGIS Enterprise' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' chef_version '>= 13.0', '< 15.0' if defined? chef_version -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-repository', '~> 3.6' depends 'hostsfile', '~> 3.0' depends 'limits', '~> 1.0' depends 'authbind', '~> 0.1' @@ -57,6 +57,7 @@ recipe 'arcgis-enterprise::system', 'System requirements' recipe 'arcgis-enterprise::unregister_machine', 'Unregisters server machine from the ArcGIS Server site' recipe 'arcgis-enterprise::unregister_stopped_machines', 'Unregisters all unavailable server machines in \'default\' cluster from the ArcGIS Server site' +recipe 'arcgis-enterprise::unregister_server_wa', 'Unregisters all ArcGIS Server Web Adaptors' recipe 'arcgis-enterprise::webstyles', 'Installs Portal for ArcGIS Web Styles' issues_url 'https://github.com/Esri/arcgis-cookbook/issues' if respond_to?(:issues_url) diff --git a/cookbooks/arcgis-enterprise/providers/datastore.rb b/cookbooks/arcgis-enterprise/providers/datastore.rb index 8b76f8e..0c09c7b 100644 --- a/cookbooks/arcgis-enterprise/providers/datastore.rb +++ b/cookbooks/arcgis-enterprise/providers/datastore.rb @@ -92,6 +92,10 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup @@ -101,7 +105,7 @@ "PASSWORD=\"#{@new_resource.run_as_password.gsub('&', '^&')}\"" end - args = "/qb INSTALLDIR=\"#{@new_resource.install_dir}\" "\ + args = "/qn INSTALLDIR=\"#{@new_resource.install_dir}\" "\ "USER_NAME=\"#{@new_resource.run_as_user}\" "\ "#{password} "\ "#{@new_resource.setup_options}" @@ -182,7 +186,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 3600}) cmd.run_command @@ -377,6 +381,13 @@ if node['platform'] == 'windows' cmd = ::File.join(@new_resource.install_dir, 'tools\\configuredatastore') args = "\"#{server_admin_url}\" \"#{@new_resource.username}\" \"#{@new_resource.password}\" \"#{@new_resource.data_dir}\" --stores #{@new_resource.types}" + + if !@new_resource.mode.nil? && !@new_resource.mode.empty? && + Gem::Version.new(node['arcgis']['version']) >= Gem::Version.new('10.8.1') && + @new_resource.types.downcase.include?('tilecache') + args += " --mode #{@new_resource.mode}" + end + env = { 'AGSDATASTORE' => @new_resource.install_dir } cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", @@ -388,6 +399,13 @@ node['arcgis']['data_store']['install_subdir']) cmd = ::File.join(install_subdir, 'tools/configuredatastore.sh') args = "\"#{server_admin_url}\" \"#{@new_resource.username}\" \"#{@new_resource.password}\" \"#{@new_resource.data_dir}\" --stores #{@new_resource.types}" + + if !@new_resource.mode.nil? && !@new_resource.mode.empty? && + Gem::Version.new(node['arcgis']['version']) >= Gem::Version.new('10.8.1') && + @new_resource.types.downcase.include?('tilecache') + args += " --mode #{@new_resource.mode}" + end + run_as_user = @new_resource.run_as_user cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", @@ -408,7 +426,7 @@ # At 10.8 tilecache backup location is no longer registered by default # therefore --operation register needs to be used. - if @new_resource.store == 'tilecache' && node['arcgis']['version'].to_f >= 10.8 + if @new_resource.store == 'tilecache' && Gem::Version.new(node['arcgis']['version']) >= Gem::Version.new('10.8') operation = 'register' end diff --git a/cookbooks/arcgis-enterprise/providers/gis_service.rb b/cookbooks/arcgis-enterprise/providers/gis_service.rb index 0df9e20..4dd9c50 100644 --- a/cookbooks/arcgis-enterprise/providers/gis_service.rb +++ b/cookbooks/arcgis-enterprise/providers/gis_service.rb @@ -69,6 +69,97 @@ end end +action :add_permission do + if @new_resource.folder.nil? || @new_resource.folder.empty? || @new_resource.folder == 'root' + service = @new_resource.name + '.' + @new_resource.type; + else + service = @new_resource.folder + '/' + @new_resource.name + '.' + @new_resource.type; + end + + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + admin_client.wait_until_available + + generate_token_url = admin_client.info['authInfo']['tokenServicesUrl'] + + if !generate_token_url.nil? && !generate_token_url.empty? + admin_client.generate_token_url = generate_token_url + end + + if admin_client.service_exists?(service) + rest_client = ArcGIS::ServerRestClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + @new_resource.roles.each do |role| + rest_client.add_service_permission(@new_resource.name, + @new_resource.type, + role) + end + + new_resource.updated_by_last_action(true) + end +end + +action :clean_permissions do + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + admin_client.wait_until_available + + generate_token_url = admin_client.info['authInfo']['tokenServicesUrl'] + + if !generate_token_url.nil? && !generate_token_url.empty? + admin_client.generate_token_url = generate_token_url + end + + rest_client = ArcGIS::ServerRestClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + @new_resource.roles.each do |role| + rest_client.clean_service_permissions(role) + end + + new_resource.updated_by_last_action(true) +end + +action :upload_item do + if @new_resource.folder.nil? || @new_resource.folder.empty? || @new_resource.folder == 'root' + service = @new_resource.name + '.' + @new_resource.type; + else + service = @new_resource.folder + '/' + @new_resource.name + '.' + @new_resource.type; + end + + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + admin_client.wait_until_available + + generate_token_url = admin_client.info['authInfo']['tokenServicesUrl'] + + if !generate_token_url.nil? && !generate_token_url.empty? + admin_client.generate_token_url = generate_token_url + end + + if admin_client.service_exists?(service) + rest_client = ArcGIS::ServerRestClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + rest_client.upload_service_item(@new_resource.name, + @new_resource.type, + @new_resource.item_folder, + @new_resource.item_file) + + new_resource.updated_by_last_action(true) + end +end + action :start do if @new_resource.folder.nil? || @new_resource.folder.empty? || @new_resource.folder == 'root' service = @new_resource.name + '.' + @new_resource.type; @@ -80,7 +171,12 @@ @new_resource.username, @new_resource.password) - admin_client.start_service(service) + if admin_client.configured_service_state(service) == 'STARTED' + # If service's configuredState is 'STARTED', wait until realTimeState becomes 'STARTED'. + admin_client.wait_until_service_started(service) + else + admin_client.start_service(service) + end new_resource.updated_by_last_action(true) end diff --git a/cookbooks/arcgis-enterprise/providers/portal.rb b/cookbooks/arcgis-enterprise/providers/portal.rb index 0a224df..7417622 100644 --- a/cookbooks/arcgis-enterprise/providers/portal.rb +++ b/cookbooks/arcgis-enterprise/providers/portal.rb @@ -63,6 +63,10 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup @@ -72,13 +76,13 @@ "PASSWORD=\"#{@new_resource.run_as_password.gsub('&', '^&')}\"" end - args = "/qb INSTALLDIR=\"#{@new_resource.install_dir}\" "\ + args = "/qn INSTALLDIR=\"#{@new_resource.install_dir}\" "\ "CONTENTDIR=\"#{node['arcgis']['portal']['data_dir']}\" "\ "USER_NAME=\"#{@new_resource.run_as_user}\" "\ "#{password} "\ "#{@new_resource.setup_options}" - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 7200 }) + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 14400 }) cmd.run_command cmd.error! else @@ -98,9 +102,9 @@ end if node['arcgis']['run_as_superuser'] - cmd = Mixlib::ShellOut.new("su #{run_as_user} -c \"#{cmd} #{args}\"", { :timeout => 7200 }) + cmd = Mixlib::ShellOut.new("su #{run_as_user} -c \"#{cmd} #{args}\"", { :timeout => 14400 }) else - cmd = Mixlib::ShellOut.new("#{cmd} #{args}", {:user => run_as_user, :timeout => 7200}) + cmd = Mixlib::ShellOut.new("#{cmd} #{args}", {:user => run_as_user, :timeout => 14400}) end cmd.run_command cmd.error! @@ -118,10 +122,18 @@ ::File.open(properties_filename, 'w') { |f| f.write("dir.data=#{dir_data}") } end end - end - # Wait for Portal installation to finish - sleep(900.0) + # Stop Portal to start it later using SystemD service + cmd = node['arcgis']['portal']['stop_tool'] + + if node['arcgis']['run_as_superuser'] + cmd = Mixlib::ShellOut.new("su #{node['arcgis']['run_as_user']} -c \"#{cmd}\"", {:timeout => 30}) + else + cmd = Mixlib::ShellOut.new(cmd, {:timeout => 30}) + end + cmd.run_command + cmd.error! + end new_resource.updated_by_last_action(true) end @@ -129,7 +141,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 10800}) cmd.run_command @@ -231,6 +243,10 @@ end action :authorize do + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + portal_admin_client = ArcGIS::PortalAdminClient.new( @new_resource.portal_url, @new_resource.username, @@ -306,6 +322,7 @@ portal_admin_client.post_upgrade() rescue Exception => e Chef::Log.error 'Portal post upgrade failed. ' + e.message + raise e end # portal_admin_client.wait_until_available @@ -316,6 +333,9 @@ # Chef::Log.error 'Portal content reindex failed. ' + e.message # end + # Wait for portal to restart after post upgrade + sleep(60.0) + portal_admin_client.wait_until_available Chef::Log.info('Upgrade Living Atlas...') diff --git a/cookbooks/arcgis-enterprise/providers/server.rb b/cookbooks/arcgis-enterprise/providers/server.rb index ec00972..751e03e 100644 --- a/cookbooks/arcgis-enterprise/providers/server.rb +++ b/cookbooks/arcgis-enterprise/providers/server.rb @@ -78,6 +78,10 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup @@ -87,7 +91,7 @@ "PASSWORD=\"#{@new_resource.run_as_password.gsub('&', '^&')}\"" end - args = "/qb INSTALLDIR=\"#{@new_resource.install_dir}\" "\ + args = "/qn INSTALLDIR=\"#{@new_resource.install_dir}\" "\ "INSTALLDIR1=\"#{@new_resource.python_dir}\" "\ "USER_NAME=\"#{@new_resource.run_as_user}\" "\ "#{password} "\ @@ -127,7 +131,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 3600}) cmd.run_command @@ -174,6 +178,10 @@ end action :authorize do + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + cmd = node['arcgis']['server']['authorization_tool'] if node['platform'] == 'windows' args = "/VER #{@new_resource.authorization_file_version} /LIF \"#{@new_resource.authorization_file}\" /S #{@new_resource.authorization_options}" @@ -419,9 +427,19 @@ machine_name = admin_client.local_machine_name + # Import root certificate if it does not exist + unless @new_resource.root_cert.empty? || + admin_client.ssl_certificate_exist?(machine_name, + @new_resource.root_cert_alias, + 'trustedCertEntry') + admin_client.import_root_ssl_certificate(machine_name, + @new_resource.root_cert, + @new_resource.root_cert_alias) + end + cert_alias = admin_client.get_server_ssl_certificate(machine_name) - unless cert_alias == @new_resource.cert_alias + unless @new_resource.keystore_file.empty? || cert_alias == @new_resource.cert_alias unless admin_client.ssl_certificate_exist?(machine_name, @new_resource.cert_alias) admin_client.import_server_ssl_certificate(machine_name, @new_resource.keystore_file, @@ -465,7 +483,8 @@ @new_resource.authentication_tier, @new_resource.hsts_enabled, @new_resource.virtual_dirs_security_enabled, - @new_resource.allow_direct_access) + @new_resource.allow_direct_access, + @new_resource.allowed_admin_access_ips) new_resource.updated_by_last_action(true) @@ -830,6 +849,32 @@ end end +action :unregister_web_adaptors do + begin + if @new_resource.use_join_site_tool + token = generate_admin_token(@new_resource.install_dir, 5) + + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + nil, nil, token) + else + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + end + + admin_client.wait_until_available + + Chef::Log.info('Unregistering ArcGIS Server Web Adaptors...') + + admin_client.unregister_web_adaptors + + new_resource.updated_by_last_action(true) + rescue Exception => e + Chef::Log.error "Failed to unregister ArcGIS Server Web Adaptors. " + e.message + raise e + end +end + private def generate_admin_token(install_dir, expiration) diff --git a/cookbooks/arcgis-enterprise/providers/webadaptor.rb b/cookbooks/arcgis-enterprise/providers/webadaptor.rb index 6a44d85..e3fa40c 100644 --- a/cookbooks/arcgis-enterprise/providers/webadaptor.rb +++ b/cookbooks/arcgis-enterprise/providers/webadaptor.rb @@ -47,18 +47,22 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' # uninstall older WA versions installed_code = Utils.wa_product_code(@new_resource.instance_name, node['arcgis']['web_adaptor']['product_codes']) if !installed_code.nil? - cmd = Mixlib::ShellOut.new("msiexec /qb /x #{installed_code}", {:timeout => 3600}) + cmd = Mixlib::ShellOut.new("msiexec /qn /x #{installed_code}", {:timeout => 3600}) cmd.run_command cmd.error! end cmd = @new_resource.setup - args = "/qb VDIRNAME=#{@new_resource.instance_name} #{@new_resource.setup_options}" + args = "/qn VDIRNAME=#{@new_resource.instance_name} #{@new_resource.setup_options}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 3600}) cmd.run_command @@ -92,7 +96,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 3600}) cmd.run_command @@ -145,37 +149,31 @@ wa_url = @new_resource.server_wa_url + '/webadaptor' uri = URI.parse(@new_resource.server_url) server_url = uri.scheme + '://' + uri.host + ':' + uri.port.to_s - - rest_client = ArcGIS::ServerRestClient.new(@new_resource.server_wa_url, - @new_resource.username, - @new_resource.password) - - unless rest_client.available? - Utils.wait_until_url_available(wa_url) - Utils.wait_until_url_available(server_url) - - if node['platform'] == 'windows' - cmd = ::File.join(ENV['CommonProgramFiles(x86)'], - node['arcgis']['web_adaptor']['config_web_adaptor_exe']) - args = "/m #{@new_resource.mode} /w \"#{wa_url}\" /g \"#{server_url}\" /u \"#{@new_resource.username}\" /p \"#{@new_resource.password}\" /a #{@new_resource.admin_access}" - - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 600}) - cmd.run_command - cmd.error! - else - cmd = 'java' - wareg_jar_path = ::File.join(@new_resource.install_dir, - node['arcgis']['web_adaptor']['install_subdir'], - 'java/tools/arcgis-wareg.jar') - args = "-jar \"#{wareg_jar_path}\" -m #{@new_resource.mode} -w '#{wa_url}' -g '#{server_url}' -u '#{@new_resource.username}' -p '#{@new_resource.password}' -a #{@new_resource.admin_access}" - - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) - cmd.run_command - cmd.error! - end - - new_resource.updated_by_last_action(true) + + Utils.wait_until_url_available(wa_url) + Utils.wait_until_url_available(server_url) + + if node['platform'] == 'windows' + cmd = ::File.join(ENV['CommonProgramFiles(x86)'], + node['arcgis']['web_adaptor']['config_web_adaptor_exe']) + args = "/m #{@new_resource.mode} /w \"#{wa_url}\" /g \"#{server_url}\" /u \"#{@new_resource.username}\" /p \"#{@new_resource.password}\" /a #{@new_resource.admin_access}" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", {:timeout => 600}) + cmd.run_command + cmd.error! + else + cmd = 'java' + wareg_jar_path = ::File.join(@new_resource.install_dir, + node['arcgis']['web_adaptor']['install_subdir'], + 'java/tools/arcgis-wareg.jar') + args = "-jar \"#{wareg_jar_path}\" -m #{@new_resource.mode} -w '#{wa_url}' -g '#{server_url}' -u '#{@new_resource.username}' -p '#{@new_resource.password}' -a #{@new_resource.admin_access}" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) + cmd.run_command + cmd.error! end + + new_resource.updated_by_last_action(true) rescue Exception => e Chef::Log.error "Failed to configure Web Adaptor with ArcGIS Server. " + e.message raise e @@ -189,10 +187,6 @@ portal_url = uri.scheme + '://' + uri.host + ':' + uri.port.to_s healthcheck_url = @new_resource.portal_wa_url + '/portaladmin/healthCheck' - rest_client = ArcGIS::PortalRestClient.new(@new_resource.portal_wa_url, - @new_resource.username, - @new_resource.password) - Utils.wait_until_url_available(portal_url) Utils.wait_until_url_available(wa_url) @@ -201,6 +195,8 @@ node['arcgis']['web_adaptor']['config_web_adaptor_exe']) args = "/m portal /w \"#{wa_url}\" /g \"#{portal_url}\" /u \"#{@new_resource.username}\" /p \"#{@new_resource.password}\"" + args += ' /r false' unless @new_resource.reindex_portal_content + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) cmd.run_command if (cmd.error? && cmd.stdout.include?('The underlying connection was closed: An unexpected error occurred on a receive.')) @@ -219,6 +215,8 @@ 'java/tools/arcgis-wareg.jar') args = "-jar \"#{wareg_jar_path}\" -m portal -w '#{wa_url}' -g '#{portal_url}' -u '#{@new_resource.username}' -p '#{@new_resource.password}'" + args += ' -r false' unless @new_resource.reindex_portal_content + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) cmd.run_command if (cmd.error? && cmd.stdout.include?('The underlying connection was closed: An unexpected error occurred on a receive.')) diff --git a/cookbooks/arcgis-enterprise/providers/webstyles.rb b/cookbooks/arcgis-enterprise/providers/webstyles.rb index 308859e..873c573 100644 --- a/cookbooks/arcgis-enterprise/providers/webstyles.rb +++ b/cookbooks/arcgis-enterprise/providers/webstyles.rb @@ -41,11 +41,15 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup # install_log = ::File.join(Chef::Config[:file_cache_path], 'webstyles_install.log') # /log \"#{install_log}\" - args = "/qb #{@new_resource.setup_options}" + args = "/qn #{@new_resource.setup_options}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", :timeout => 7200) cmd.run_command @@ -62,10 +66,18 @@ end cmd.run_command cmd.error! - end - # Wait for webstyles installation to finish - sleep(900.0) + # Stop Portal to start it later using SystemD service + cmd = node['arcgis']['portal']['stop_tool'] + + if node['arcgis']['run_as_superuser'] + cmd = Mixlib::ShellOut.new("su #{node['arcgis']['run_as_user']} -c \"#{cmd}\"", {:timeout => 30}) + else + cmd = Mixlib::ShellOut.new(cmd, {:timeout => 30}) + end + cmd.run_command + cmd.error! + end new_resource.updated_by_last_action(true) end diff --git a/cookbooks/arcgis-enterprise/recipes/datastore.rb b/cookbooks/arcgis-enterprise/recipes/datastore.rb index cbdb86a..02334c3 100644 --- a/cookbooks/arcgis-enterprise/recipes/datastore.rb +++ b/cookbooks/arcgis-enterprise/recipes/datastore.rb @@ -23,6 +23,7 @@ install_dir node['arcgis']['data_store']['install_dir'] data_dir node['arcgis']['data_store']['data_dir'] types node['arcgis']['data_store']['types'] + mode node['arcgis']['data_store']['mode'] run_as_user node['arcgis']['run_as_user'] server_url 'https://' + node['arcgis']['server']['domain_name'] + ':6443/arcgis' username node['arcgis']['server']['admin_username'] diff --git a/cookbooks/arcgis-enterprise/recipes/install_portal.rb b/cookbooks/arcgis-enterprise/recipes/install_portal.rb index d5cca1b..9ad00d7 100644 --- a/cookbooks/arcgis-enterprise/recipes/install_portal.rb +++ b/cookbooks/arcgis-enterprise/recipes/install_portal.rb @@ -123,8 +123,7 @@ action :configure_autostart end -# On Linux portal is stopped after upgrade -arcgis_enterprise_portal 'Start Portal for ArcGIS after upgrade' do +arcgis_enterprise_portal 'Start Portal for ArcGIS after install' do tomcat_java_opts node['arcgis']['portal']['tomcat_java_opts'] action :start end diff --git a/cookbooks/arcgis-enterprise/recipes/install_server.rb b/cookbooks/arcgis-enterprise/recipes/install_server.rb index 5075eba..9b89cc4 100644 --- a/cookbooks/arcgis-enterprise/recipes/install_server.rb +++ b/cookbooks/arcgis-enterprise/recipes/install_server.rb @@ -70,6 +70,15 @@ action :install end +# Disable all NodeAgent plugins on AWS/EC2 +template ::File.join(node['arcgis']['server']['install_dir'], + node['arcgis']['server']['install_subdir'], + 'framework', 'etc', 'NodeAgentExt.xml') do + source 'NodeAgentExt.xml.erb' + only_if { node['arcgis']['cloud']['provider'] == 'ec2' && + node['arcgis']['server']['disable_nodeagent_plugins'] } +end + arcgis_enterprise_server 'Configure arcgisserver service' do install_dir node['arcgis']['server']['install_dir'] only_if { node['arcgis']['server']['configure_autostart'] } diff --git a/cookbooks/arcgis-enterprise/recipes/portal_wa.rb b/cookbooks/arcgis-enterprise/recipes/portal_wa.rb index 8b25545..0c68677 100644 --- a/cookbooks/arcgis-enterprise/recipes/portal_wa.rb +++ b/cookbooks/arcgis-enterprise/recipes/portal_wa.rb @@ -26,6 +26,7 @@ instance_name node['arcgis']['portal']['wa_name'] username node['arcgis']['portal']['admin_username'] password node['arcgis']['portal']['admin_password'] + reindex_portal_content node['arcgis']['web_adaptor']['reindex_portal_content'] retries 10 retry_delay 600 action :configure_with_portal diff --git a/cookbooks/arcgis-enterprise/recipes/server.rb b/cookbooks/arcgis-enterprise/recipes/server.rb index eff6a89..dbb0518 100644 --- a/cookbooks/arcgis-enterprise/recipes/server.rb +++ b/cookbooks/arcgis-enterprise/recipes/server.rb @@ -135,9 +135,12 @@ keystore_file node['arcgis']['server']['keystore_file'] keystore_password node['arcgis']['server']['keystore_password'] cert_alias node['arcgis']['server']['cert_alias'] + root_cert node['arcgis']['server']['root_cert'] + root_cert_alias node['arcgis']['server']['root_cert_alias'] retries 5 retry_delay 30 - not_if { node['arcgis']['server']['keystore_file'].empty? } + not_if { node['arcgis']['server']['keystore_file'].empty? && + node['arcgis']['server']['root_cert'].empty? } action :configure_https end @@ -152,16 +155,8 @@ hsts_enabled node['arcgis']['server']['hsts_enabled'] virtual_dirs_security_enabled node['arcgis']['server']['virtual_dirs_security_enabled'] allow_direct_access node['arcgis']['server']['allow_direct_access'] + allowed_admin_access_ips node['arcgis']['server']['allowed_admin_access_ips'] retries 5 retry_delay 30 action :configure_security_protocol end - -# Restart ArcGIS Server -#arcgis_enterprise_server 'Stop ArcGIS Server' do -# action :stop -#end - -#arcgis_enterprise_server 'Start ArcGIS Server' do -# action :start -#end \ No newline at end of file diff --git a/cookbooks/arcgis-enterprise/recipes/server_node.rb b/cookbooks/arcgis-enterprise/recipes/server_node.rb index 9256504..873bb52 100644 --- a/cookbooks/arcgis-enterprise/recipes/server_node.rb +++ b/cookbooks/arcgis-enterprise/recipes/server_node.rb @@ -124,9 +124,12 @@ keystore_file node['arcgis']['server']['keystore_file'] keystore_password node['arcgis']['server']['keystore_password'] cert_alias node['arcgis']['server']['cert_alias'] + root_cert node['arcgis']['server']['root_cert'] + root_cert_alias node['arcgis']['server']['root_cert_alias'] use_join_site_tool node['arcgis']['server']['use_join_site_tool'] retries 10 retry_delay 30 - not_if { node['arcgis']['server']['keystore_file'].empty? } + not_if { node['arcgis']['server']['keystore_file'].empty? && + node['arcgis']['server']['root_cert'].empty? } action :configure_https end \ No newline at end of file diff --git a/cookbooks/arcgis-enterprise/recipes/unregister_machine.rb b/cookbooks/arcgis-enterprise/recipes/unregister_machine.rb index 04851c1..b616e47 100644 --- a/cookbooks/arcgis-enterprise/recipes/unregister_machine.rb +++ b/cookbooks/arcgis-enterprise/recipes/unregister_machine.rb @@ -18,7 +18,9 @@ # arcgis_enterprise_server 'Unregister server machine' do + use_join_site_tool node['arcgis']['server']['use_join_site_tool'] server_url node['arcgis']['server']['url'] + install_dir node['arcgis']['server']['install_dir'] username node['arcgis']['server']['admin_username'] password node['arcgis']['server']['admin_password'] retries 5 diff --git a/cookbooks/arcgis-enterprise/recipes/unregister_server_wa.rb b/cookbooks/arcgis-enterprise/recipes/unregister_server_wa.rb new file mode 100644 index 0000000..3b92abf --- /dev/null +++ b/cookbooks/arcgis-enterprise/recipes/unregister_server_wa.rb @@ -0,0 +1,29 @@ +# +# Cookbook Name:: arcgis-enterprise +# Recipe:: unregister_server_wa +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +arcgis_enterprise_server 'Unregister ArcGIS Server Web Adaptors' do + use_join_site_tool node['arcgis']['server']['use_join_site_tool'] + server_url node['arcgis']['server']['url'] + install_dir node['arcgis']['server']['install_dir'] + username node['arcgis']['server']['admin_username'] + password node['arcgis']['server']['admin_password'] + retries 5 + retry_delay 30 + action :unregister_web_adaptors +end diff --git a/cookbooks/arcgis-enterprise/recipes/webstyles.rb b/cookbooks/arcgis-enterprise/recipes/webstyles.rb index 3755f22..4b98727 100644 --- a/cookbooks/arcgis-enterprise/recipes/webstyles.rb +++ b/cookbooks/arcgis-enterprise/recipes/webstyles.rb @@ -18,34 +18,39 @@ # arcgis_enterprise_webstyles 'Unpack ArcGIS Web Styles' do - setup_archive node['arcgis']['webstyles']['setup_archive'] - setups_repo node['arcgis']['repository']['setups'] - run_as_user node['arcgis']['run_as_user'] - only_if { ::File.exist?(node['arcgis']['webstyles']['setup_archive']) && - !::File.exist?(node['arcgis']['webstyles']['setup']) } - if node['platform'] == 'windows' - not_if { Utils.product_installed?(node['arcgis']['webstyles']['product_code']) } - else - not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], - node['hostname'], - node['arcgis']['version'], - :ArcGISWebStyles) } - end - action :unpack + setup_archive node['arcgis']['webstyles']['setup_archive'] + setups_repo node['arcgis']['repository']['setups'] + run_as_user node['arcgis']['run_as_user'] + only_if { ::File.exist?(node['arcgis']['webstyles']['setup_archive']) && + !::File.exist?(node['arcgis']['webstyles']['setup']) } + if node['platform'] == 'windows' + not_if { Utils.product_installed?(node['arcgis']['webstyles']['product_code']) } + else + not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], + node['hostname'], + node['arcgis']['version'], + :ArcGISPortal_WebStyles) } end + action :unpack +end - arcgis_enterprise_webstyles 'Install ArcGIS Web Styles' do - product_code node['arcgis']['webstyles']['product_code'] - setup node['arcgis']['webstyles']['setup'] - setup_options node['arcgis']['webstyles']['setup_options'] - run_as_user node['arcgis']['run_as_user'] - if node['platform'] == 'windows' - not_if { Utils.product_installed?(node['arcgis']['webstyles']['product_code']) } - else - not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], - node['hostname'], - node['arcgis']['version'], - :ArcGISWebStyles) } - end - action :install +arcgis_enterprise_webstyles 'Install ArcGIS Web Styles' do + product_code node['arcgis']['webstyles']['product_code'] + setup node['arcgis']['webstyles']['setup'] + setup_options node['arcgis']['webstyles']['setup_options'] + run_as_user node['arcgis']['run_as_user'] + if node['platform'] == 'windows' + not_if { Utils.product_installed?(node['arcgis']['webstyles']['product_code']) } + else + not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], + node['hostname'], + node['arcgis']['version'], + :ArcGISPortal_WebStyles) } end + action :install +end + +arcgis_enterprise_portal 'Start Portal for ArcGIS after Web Styles install' do + tomcat_java_opts node['arcgis']['portal']['tomcat_java_opts'] + action :start +end diff --git a/cookbooks/arcgis-enterprise/resources/datastore.rb b/cookbooks/arcgis-enterprise/resources/datastore.rb index 29c803b..c766e65 100644 --- a/cookbooks/arcgis-enterprise/resources/datastore.rb +++ b/cookbooks/arcgis-enterprise/resources/datastore.rb @@ -29,6 +29,7 @@ attribute :data_dir, :kind_of => String attribute :backup_dir, :kind_of => String attribute :types, :kind_of => String, :default => 'tileCache,relational' +attribute :mode, :kind_of => String attribute :run_as_user, :kind_of => String attribute :run_as_password, :kind_of => String attribute :run_as_msa, :kind_of => [TrueClass, FalseClass], :default => false diff --git a/cookbooks/arcgis-enterprise/resources/gis_service.rb b/cookbooks/arcgis-enterprise/resources/gis_service.rb index 3d6e761..d6ed2d1 100644 --- a/cookbooks/arcgis-enterprise/resources/gis_service.rb +++ b/cookbooks/arcgis-enterprise/resources/gis_service.rb @@ -17,7 +17,7 @@ # limitations under the License. # -actions :publish, :start, :stop, :delete +actions :publish, :start, :stop, :delete, :add_permission, :clean_permissions, :upload_item attribute :server_url, :kind_of => String attribute :username, :kind_of => String @@ -27,6 +27,9 @@ attribute :type, :kind_of => String attribute :definition_file, :kind_of => String attribute :properties, :kind_of => Hash, :default => {} +attribute :roles, :kind_of => [Array, String] +attribute :item_folder, :kind_of => String +attribute :item_file, :kind_of => String def initialize(*args) super diff --git a/cookbooks/arcgis-enterprise/resources/server.rb b/cookbooks/arcgis-enterprise/resources/server.rb index 8686d85..ea3f89f 100644 --- a/cookbooks/arcgis-enterprise/resources/server.rb +++ b/cookbooks/arcgis-enterprise/resources/server.rb @@ -22,7 +22,7 @@ :join_cluster, :configure_https, :register_database, :federate, :set_identity_store, :assign_privileges, :set_machine_properties, :stop_machine, :unregister_machine, :unregister_stopped_machines, :block_data_copy, - :configure_security_protocol + :configure_security_protocol, :unregister_web_adaptors attribute :setup_archive, :kind_of => String attribute :setups_repo, :kind_of => String @@ -41,6 +41,8 @@ attribute :keystore_file, :kind_of => [String, nil] attribute :keystore_password, :kind_of => [String, nil] attribute :cert_alias, :kind_of => String +attribute :root_cert, :kind_of => String +attribute :root_cert_alias, :kind_of => String attribute :cluster, :kind_of => String attribute :server_id, :kind_of => String attribute :secret_key, :kind_of => String @@ -73,6 +75,7 @@ attribute :hsts_enabled, :kind_of => [TrueClass, FalseClass], :default => false attribute :virtual_dirs_security_enabled, :kind_of => [TrueClass, FalseClass], :default => false attribute :allow_direct_access, :kind_of => [TrueClass, FalseClass], :default => true +attribute :allowed_admin_access_ips, :kind_of => String, :default => '' attribute :setup_options, :kind_of => String, :default => '' attribute :authorization_options, :kind_of => String, :default => '' diff --git a/cookbooks/arcgis-enterprise/resources/webadaptor.rb b/cookbooks/arcgis-enterprise/resources/webadaptor.rb index a9a89de..1819af2 100644 --- a/cookbooks/arcgis-enterprise/resources/webadaptor.rb +++ b/cookbooks/arcgis-enterprise/resources/webadaptor.rb @@ -36,6 +36,7 @@ attribute :admin_access, :kind_of => [TrueClass, FalseClass], :default => false attribute :mode, :kind_of => String, :default => 'server' attribute :setup_options, :kind_of => String, :default => '' +attribute :reindex_portal_content, :kind_of => [TrueClass, FalseClass], :default => true def initialize(*args) super diff --git a/cookbooks/arcgis-enterprise/templates/default/NodeAgentExt.xml.erb b/cookbooks/arcgis-enterprise/templates/default/NodeAgentExt.xml.erb new file mode 100644 index 0000000..c7fb48d --- /dev/null +++ b/cookbooks/arcgis-enterprise/templates/default/NodeAgentExt.xml.erb @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cookbooks/arcgis-geoevent/CHANGELOG.md b/cookbooks/arcgis-geoevent/CHANGELOG.md index 2bcf186..afc6a74 100644 --- a/cookbooks/arcgis-geoevent/CHANGELOG.md +++ b/cookbooks/arcgis-geoevent/CHANGELOG.md @@ -3,6 +3,10 @@ arcgis-geoevent cookbook CHANGELOG This file is used to list changes made in each version of the arcgis-geoevent cookbook. +3.6.0 +----- +- Added support for ArcGIS GeoEvent Server 10.8.1. + 3.5.0 ----- - Added support for ArcGIS GeoEvent Server 10.8. diff --git a/cookbooks/arcgis-geoevent/README.md b/cookbooks/arcgis-geoevent/README.md index 9601ac9..71b5070 100644 --- a/cookbooks/arcgis-geoevent/README.md +++ b/cookbooks/arcgis-geoevent/README.md @@ -11,6 +11,7 @@ Requirements * 10.7 * 10.7.1 * 10.8 +* 10.8.1 ### Supported ArcGIS software @@ -73,7 +74,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2018 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-geoevent/attributes/default.rb b/cookbooks/arcgis-geoevent/attributes/default.rb index f2e3457..752db2f 100644 --- a/cookbooks/arcgis-geoevent/attributes/default.rb +++ b/cookbooks/arcgis-geoevent/attributes/default.rb @@ -28,7 +28,7 @@ geoevent['configure_autostart'] = true case - when ['10.6', '10.6.1', '10.7', '10.7.1', '10.8'].include?(node['arcgis']['version']) + when ['10.6', '10.6.1', '10.7', '10.7.1', '10.8', '10.8.1'].include?(node['arcgis']['version']) geoevent['ports'] = '6180,6143,4181,4182,4190,9191,9192,9193,9194,9220,9320,5565,5575,27271,27272,27273,2181,2182,2190' geoevent['configure_gateway_service'] = true when ['10.4', '10.4.1', '10.5', '10.5.1'].include?(node['arcgis']['version']) @@ -46,6 +46,10 @@ geoevent['lp-setup'] = 'C:\\ArcGIS\\GeoEvent\\SetupFiles\\setup.msi' case node['arcgis']['version'] + when '10.8.1' + geoevent['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_GeoEvent_Server_1081_175242.exe').gsub('/', '\\') + geoevent['product_code'] = '{C98F8E6F-A6D0-479A-B80E-C173996DD70B}' when '10.8' geoevent['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_GeoEvent_Server_108_172924.exe').gsub('/', '\\') @@ -88,6 +92,9 @@ geoevent['lp-setup'] = '/arcgis/geo-event-cdLP/Language-Pack-Setup.sh' case node['arcgis']['version'] + when '10.8.1' + geoevent['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_GeoEvent_Server_1081_175325.tar.gz').gsub('/', '\\') when '10.8' geoevent['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_GeoEvent_Server_108_173004.tar.gz').gsub('/', '\\') diff --git a/cookbooks/arcgis-geoevent/metadata.rb b/cookbooks/arcgis-geoevent/metadata.rb index 6830997..b2a9635 100644 --- a/cookbooks/arcgis-geoevent/metadata.rb +++ b/cookbooks/arcgis-geoevent/metadata.rb @@ -4,11 +4,11 @@ license 'Apache 2.0' description 'Installs and configures ArcGIS GeoEvent Server' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' chef_version '>= 13.0', '< 15.0' if defined? chef_version -depends 'arcgis-enterprise', '~> 3.5' -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-enterprise', '~> 3.6' +depends 'arcgis-repository', '~> 3.6' supports 'windows' supports 'ubuntu' diff --git a/cookbooks/arcgis-geoevent/providers/geoevent.rb b/cookbooks/arcgis-geoevent/providers/geoevent.rb index e393f31..ea48fc9 100644 --- a/cookbooks/arcgis-geoevent/providers/geoevent.rb +++ b/cookbooks/arcgis-geoevent/providers/geoevent.rb @@ -57,10 +57,14 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup run_as_password = @new_resource.run_as_password.gsub("&", "^&") - args = "/qb PASSWORD=\"#{run_as_password}\"" + args = "/qn PASSWORD=\"#{run_as_password}\"" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command @@ -83,7 +87,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command @@ -237,6 +241,10 @@ action :authorize do if !@new_resource.authorization_file.nil? && !@new_resource.authorization_file.empty? + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + cmd = node['arcgis']['server']['authorization_tool'] if node['platform'] == 'windows' diff --git a/cookbooks/arcgis-insights/CHANGELOG.md b/cookbooks/arcgis-insights/CHANGELOG.md index f365158..47d28bd 100644 --- a/cookbooks/arcgis-insights/CHANGELOG.md +++ b/cookbooks/arcgis-insights/CHANGELOG.md @@ -2,6 +2,9 @@ This file is used to list changes made in each version of the arcgis-insights cookbook. +## 3.6.0 +- Added support for Insights for ArcGIS 3.4/3.4.1/2020.1 + ## 3.5.0 - Added support for Insights for ArcGIS 3.3/3.3.1 diff --git a/cookbooks/arcgis-insights/README.md b/cookbooks/arcgis-insights/README.md index 25ff5f7..a55c240 100644 --- a/cookbooks/arcgis-insights/README.md +++ b/cookbooks/arcgis-insights/README.md @@ -8,9 +8,6 @@ Requirements ### Supported Insights for ArcGIS versions -* 1.0 -* 1.1 -* 1.2 * 2.0 * 2.1 * 2.2 @@ -20,13 +17,13 @@ Requirements * 3.2.1 * 3.3 * 3.3.1 +* 3.4 +* 3.4.1 +* 2020.1 ### Platforms -* Windows 7 -* Windows 8 (8.1) * Windows 10 -* Windows Server 2008 (R2) * Windows Server 2012 (R2) * Windows Server 2016 * Windows Server 2019 @@ -42,7 +39,7 @@ The following cookbooks are required: Attributes ---------- -* `node['arcgis']['insights']['version']` = Insights for ArcGIS version. Default version is `3.1` +* `node['arcgis']['insights']['version']` = Insights for ArcGIS version. Default version is `3.4.1` * `node['arcgis']['insights']['setup_archive']` = Path to Insights for ArcGIS version setup archive. Default value depends on `node['arcgis']['pro']['version']` attribute value. * `node['arcgis']['insights']['setup']` = The location of Insights for ArcGIS setup executable. Default location is `%USERPROFILE%\Documents\Insights \Insights\setup.exe` on Windows and `/opt/arcgis/Insights/Insights-Setup.sh` on Linux. * `node['arcgis']['insights']['setup_archive']` = Path to Insights for ArcGIS setup archive. Default value depends on `node['arcgis']['insights']['version']` attribute value. @@ -73,7 +70,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2018 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-insights/attributes/default.rb b/cookbooks/arcgis-insights/attributes/default.rb index 8c814b2..cd9ea8e 100644 --- a/cookbooks/arcgis-insights/attributes/default.rb +++ b/cookbooks/arcgis-insights/attributes/default.rb @@ -20,7 +20,7 @@ include_attribute 'arcgis-enterprise' default['arcgis']['insights'].tap do |insights| - insights['version'] = '3.3.1' + insights['version'] = '2020.1' case node['platform'] when 'windows' @@ -28,6 +28,18 @@ node['arcgis']['insights']['version'] + '\\Insights\\Setup.exe' case node['arcgis']['insights']['version'] + when '2020.1' + insights['product_code'] = '{5293D733-7F85-48C8-90A2-7506E51773DB}' + insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Insights_Windows_2020_1_173526.exe') + when '3.4.1' + insights['product_code'] = '{F3B91D92-3DD8-4F0B-B43B-6F9DA2C1830A}' + insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Insights_Windows_341_171410.exe') + when '3.4' + insights['product_code'] = '{4230C365-8713-4A13-93BA-6016BE47ECAE}' + insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Insights_Windows_34_171405.exe') when '3.3.1' insights['product_code'] = '{2BA374B7-1C4C-4F5D-B80C-6C63077D076E}' insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], @@ -77,6 +89,15 @@ 'Insights/Insights-Setup.sh') case node['arcgis']['insights']['version'] + when '2020.1' + insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Insights_Linux_2020_1_173527.tar.gz') + when '3.4.1' + insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Insights_Linux_341_171471.tar.gz') + when '3.4' + insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Insights_Linux_34_171406.tar.gz') when '3.3.1' insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'Insights_for_ArcGIS_Linux_331_169947.tar.gz') diff --git a/cookbooks/arcgis-insights/metadata.rb b/cookbooks/arcgis-insights/metadata.rb index b424793..633db87 100644 --- a/cookbooks/arcgis-insights/metadata.rb +++ b/cookbooks/arcgis-insights/metadata.rb @@ -4,10 +4,10 @@ license 'Apache 2.0' description 'Installs and configures Insights for ArcGIS' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' -depends 'arcgis-enterprise', '~> 3.5' -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-enterprise', '~> 3.6' +depends 'arcgis-repository', '~> 3.6' supports 'windows' supports 'ubuntu' diff --git a/cookbooks/arcgis-insights/providers/insights.rb b/cookbooks/arcgis-insights/providers/insights.rb index 4b7636a..91598fe 100644 --- a/cookbooks/arcgis-insights/providers/insights.rb +++ b/cookbooks/arcgis-insights/providers/insights.rb @@ -42,9 +42,13 @@ end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup - args = "/qb" + args = "/qn" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command @@ -65,7 +69,7 @@ action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command diff --git a/cookbooks/arcgis-mission/.gitignore b/cookbooks/arcgis-mission/.gitignore new file mode 100644 index 0000000..13e41c4 --- /dev/null +++ b/cookbooks/arcgis-mission/.gitignore @@ -0,0 +1,22 @@ +.vagrant +*~ +*# +.#* +\#*# +.*.sw[a-z] +*.un~ + +# Bundler +Gemfile.lock +gems.locked +bin/* +.bundle/* + +# test kitchen +.kitchen/ +.kitchen.local.yml + +# Chef +Berksfile.lock +.zero-knife.rb +Policyfile.lock.json diff --git a/cookbooks/arcgis-mission/.kitchen.yml b/cookbooks/arcgis-mission/.kitchen.yml new file mode 100644 index 0000000..ca8ec07 --- /dev/null +++ b/cookbooks/arcgis-mission/.kitchen.yml @@ -0,0 +1,26 @@ +--- +driver: + name: vagrant + +provisioner: + name: chef_zero + # You may wish to disable always updating cookbooks in CI or other testing environments. + # For example: + # always_update_cookbooks: <%= !ENV['CI'] %> + always_update_cookbooks: true + +verifier: + name: inspec + +platforms: + - name: ubuntu-16.04 + - name: centos-7 + +suites: + - name: default + run_list: + - recipe[arcgis-mission::default] + verifier: + inspec_tests: + - test/integration/default + attributes: diff --git a/cookbooks/arcgis-mission/Berksfile b/cookbooks/arcgis-mission/Berksfile new file mode 100644 index 0000000..6c8e4f2 --- /dev/null +++ b/cookbooks/arcgis-mission/Berksfile @@ -0,0 +1,7 @@ +source 'https://supermarket.chef.io' + +metadata + +group :integration do + cookbook 'arcgis-repository', path: '../arcgis-repository' +end diff --git a/cookbooks/arcgis-mission/CHANGELOG.md b/cookbooks/arcgis-mission/CHANGELOG.md new file mode 100644 index 0000000..14954d9 --- /dev/null +++ b/cookbooks/arcgis-mission/CHANGELOG.md @@ -0,0 +1,7 @@ +# arcgis-mission CHANGELOG + +This file is used to list changes made in each version of the arcgis-mission cookbook. + +# 3.6.0 +------- +- Initial release of the cookbook. diff --git a/cookbooks/arcgis-mission/LICENSE b/cookbooks/arcgis-mission/LICENSE new file mode 100644 index 0000000..11069ed --- /dev/null +++ b/cookbooks/arcgis-mission/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/cookbooks/arcgis-mission/README.md b/cookbooks/arcgis-mission/README.md new file mode 100644 index 0000000..1e40cc4 --- /dev/null +++ b/cookbooks/arcgis-mission/README.md @@ -0,0 +1,124 @@ +arcgis-mission cookbook +=============== + +This cookbook installs and configures ArcGIS Mission Server. + +Requirements +------------ + +### Supported ArcGIS Mission Server versions + +* 10.8 +* 10.8.1 + +### Supported ArcGIS software + +* ArcGIS Mission Server + +### Platforms + +* Microsoft Windows Server 2019 Standard and Datacenter +* Microsoft Windows Server 2016 Standard and Datacenter +* Microsoft Windows Server 2012 R2 Standard and Datacenter +* Ubuntu 16.04, 18.04 +* Rhel 6.5, 7.0 + +### Dependencies + +The following cookbooks are required: + +* arcgis-enterprise +* arcgis-repository + +Attributes +---------- + +* `node['arcgis']['mission_server']['url']` = ArcGIS Mission Server URL. Default URL is `https://:20443`. +* `node['arcgis']['mission_server']['wa_name']` = Name of ArcGIS Web Adaptor used for ArcGIS Mission Server. Default name is `mission`. +* `node['arcgis']['mission_server']['wa_url']` = URL of the Web Adaptor used for ArcGIS Mission Server. Default URL is `https:///`. +* `node['arcgis']['mission_server']['domain_name']` = ArcGIS Mission Server site domain name. Default domain is FQDN of the machine. +* `node['arcgis']['mission_server']['private_url']` = Private URL of ArcGIS Mission Server. Default URL is `https://:20443/arcgis`. +* `node['arcgis']['mission_server']['web_context_url']` = Web Context URL of ArcGIS Mission Server. Default URL is `https:///`. +* `node['arcgis']['mission_server']['authorization_file']` = ArcGIS Mission Server authorization file path. +* `node['arcgis']['mission_server']['authorization_file_version']` = ArcGIS Mission Server authorization file version. Default value is `node['arcgis']['server']['authorization_file_version']`. +* `node['arcgis']['mission_server']['install_dir']` = ArcGIS Mission Server installation directory. By default, ArcGIS Mission Server is installed to `%ProgramW6432%\ArcGIS\Mission` on Windows machines and to `/home/arcgis` on Linux machines. +* `node['arcgis']['mission_server']['directories_root']` = The root ArcGIS Mission Server server directory location. The default value is `C:\arcgismissionserver\directories` on Windows and `//missionserver/usr/directories` on Linux. +* `node['arcgis']['mission_server']['config_store_connection_string']` = The configuration store location for the ArcGIS Mission Server site. By default, the configuration store is created in the local directory `C:\arcgismissionserver\config-store` on Windows and `//usr/config-store` on Linux. +* `node['arcgis']['mission_server']['setup_archive']` = Path to ArcGIS Mission Server setup archive. Default value depends on `node['arcgis']['version']` attribute value. +* `node['arcgis']['mission_server']['setup']` = The location of ArcGIS Mission Server setup executable. Default location is `%USERPROFILE%\Documents\ArcGIS10.8\MissionServer\Setup.exe` on Windows and `/opt/arcgis/10.8/MissionServer_Linux/Setup` on Linux. +* `node['arcgis']['mission_server']['configure_autostart']` = If set to true, on Linux the Mission Server is configured to start with the operating system. Default value is `true`. +* `node['arcgis']['mission_server']['admin_username']` = Primary ArcGIS Mission Server administrator user name. Default user name is `admin`. +* `node['arcgis']['mission_server']['admin_password']` = Primary ArcGIS Mission Server administrator password. Default value is `change.it`. +* `node['arcgis']['mission_server']['primary_server_url']` = The URL of the existing ArcGIS Mission Server site to join, in the format `https://missionserver.domain.com:20443/arcgis/admin`. Default URL `nil`. +* `node['arcgis']['mission_server']['install_system_requirements']` = Enable system-level configuration for ArcGIS Mission Server. Default value is `true`. +* `node['arcgis']['mission_server']['ports']` = Ports to open for ArcGIS Mission Servier in Windows firewall. Default is `20300,20301,20443`. +* `node['arcgis']['mission_server']['system_properties']` = ArcGIS Mission Server system properties. Default value is `{}`. + +Recipes +------- + +### arcgis-mission::default + +Installs and configures ArcGIS Mission Server. + +### arcgis-mission::federation + +Federates ArcGIS Mission Server with Portal for ArcGIS and enables Mission role. + +### arcgis-mission::install_server + +Installs ArcGIS Mission Server. + +### arcgis-mission::install_server_wa + +Installs ArcGIS Web Adaptor for ArcGIS Mission Server. + +### arcgis-mission::server + +Installs and configures ArcGIS Mission Server. + +### arcgis-mission::server_wa + +Installs and configures ArcGIS Web Adaptor for ArcGIS Mission Server. + +### arcgis-mission::uninstall_server + +Uninstalls ArcGIS Mission Server. + +### arcgis-mission::uninstall_server_wa + +Uninstalls ArcGIS Web Adaptor for ArcGIS Mission Server. + +Usage +----- + +See [wiki](https://github.com/Esri/arcgis-cookbook/wiki) pages for more information about using ArcGIS cookbooks. + +## Issues + +Find a bug or want to request a new feature? Please let us know by submitting an [issue](https://github.com/Esri/arcgis-cookbook/issues). + +## Contributing + +Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing). + +Licensing +--------- + +Copyright 2020 Esri + +Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +A copy of the license is available in the repository's [License.txt](https://github.com/Esri/arcgis-cookbook/blob/master/License.txt?raw=true) file. + +[](Esri Tags: ArcGIS Enterprise Mission Server Chef Cookbook) +[](Esri Language: Ruby) diff --git a/cookbooks/arcgis-mission/attributes/default.rb b/cookbooks/arcgis-mission/attributes/default.rb new file mode 100644 index 0000000..54a93f4 --- /dev/null +++ b/cookbooks/arcgis-mission/attributes/default.rb @@ -0,0 +1,116 @@ +# +# Cookbook Name:: arcgis-mission +# Attributes:: default +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +include_attribute 'arcgis-repository' + +default['arcgis']['mission_server'].tap do |mission_server| + mission_server['url'] = "https://#{node['ipaddress']}:20443/arcgis" + mission_server['wa_name'] = 'mission' + mission_server['wa_url'] = "https://#{node['ipaddress']}/#{node['arcgis']['mission_server']['wa_name']}" + + mission_server['domain_name'] = node['fqdn'] + mission_server['private_url'] = "https://#{node['arcgis']['mission_server']['domain_name']}:20443/arcgis" + mission_server['web_context_url'] = "https://#{node['arcgis']['mission_server']['domain_name']}/#{node['arcgis']['mission_server']['wa_name']}" + + mission_server['ports'] = '20300,20301,20443' + mission_server['authorization_file'] = node['arcgis']['server']['authorization_file'] + mission_server['authorization_file_version'] = node['arcgis']['server']['authorization_file_version'] + mission_server['configure_autostart'] = true + mission_server['install_system_requirements'] = true + + mission_server['setup_archive'] = '' + + mission_server['admin_username'] = 'siteadmin' + if ENV['ARCGIS_MISSION_SERVER_ADMIN_PASSWORD'].nil? + mission_server['admin_password'] = 'change.it' + else + mission_server['admin_password'] = ENV['ARCGIS_MISSION_SERVER_ADMIN_PASSWORD'] + end + + mission_server['system_properties'] = {} + + case node['platform'] + when 'windows' + mission_server['setup'] = ::File.join(node['arcgis']['repository']['setups'], + 'ArcGIS ' + node['arcgis']['version'], + 'MissionServer', 'Setup.exe') + mission_server['install_dir'] = ::File.join(ENV['ProgramW6432'], 'ArcGIS\\Mission').gsub('/', '\\') + mission_server['install_subdir'] = '' + mission_server['authorization_tool'] = ::File.join(node['arcgis']['mission_server']['install_dir'], + 'bin\\SoftwareAuthorization.exe').gsub('/', '\\') + mission_server['keycodes'] = ::File.join(ENV['ProgramW6432'], + "ESRI\\License#{node['arcgis']['mission_server']['authorization_file_version']}\\sysgen\\keycodes").gsub('/', '\\') + + mission_server['directories_root'] = 'C:\\arcgismissionserver\\directories' + mission_server['config_store_connection_string'] = 'C:\\arcgismissionserver\\config-store' + + case node['arcgis']['version'] + when '10.8.1' + mission_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Mission_Server_Windows_1081_175253.exe').gsub('/', '\\') + mission_server['product_code'] = '{26F574C6-C9F8-487C-977A-A906AAA60136}' + when '10.8' + mission_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Mission_Server_Windows_108_172945.exe').gsub('/', '\\') + mission_server['product_code'] = '{A1A58B32-2ADF-4EAD-AC84-BE97318CA569}' + else + Chef::Log.warn 'Unsupported ArcGIS Mission Server version' + end + else # node['platform'] == 'linux' + mission_server['setup'] = ::File.join(node['arcgis']['repository']['setups'], + node['arcgis']['version'], + 'MissionServer', 'Setup') + mission_server['install_dir'] = "/home/#{node['arcgis']['run_as_user']}" + mission_server['install_subdir'] = node['arcgis']['mission_server']['install_dir'].end_with?('/arcgis') ? + 'mission' : 'arcgis/mission' + + if node['arcgis']['mission_server']['install_dir'].nil? + mission_server_install_dir = mission_server['install_dir'] + else + mission_server_install_dir = node['arcgis']['mission_server']['install_dir'] + end + + if node['arcgis']['mission_server']['install_subdir'].nil? + mission_server_install_subdir = mission_server['install_subdir'] + else + mission_server_install_subdir = node['arcgis']['mission_server']['install_subdir'] + end + + mission_server['authorization_tool'] = ::File.join(mission_server_install_dir, + mission_server_install_subdir, + '/tools/authorizeSoftware') + + mission_server['directories_root'] = ::File.join(mission_server_install_dir, + mission_server_install_subdir, + 'usr', 'directories') + mission_server['config_store_connection_string'] = ::File.join(mission_server_install_dir, + mission_server_install_subdir, + 'usr', 'config-store') + + case node['arcgis']['version'] + when '10.8.1' + mission_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Mission_Server_Linux_1081_175334.tar.gz') + when '10.8' + mission_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Mission_Server_Linux_108_173013.tar.gz') + else + Chef::Log.warn 'Unsupported ArcGIS Mission Server version' + end + end +end diff --git a/cookbooks/arcgis-mission/chefignore b/cookbooks/arcgis-mission/chefignore new file mode 100644 index 0000000..4439807 --- /dev/null +++ b/cookbooks/arcgis-mission/chefignore @@ -0,0 +1,104 @@ +# Put files/directories that should be ignored in this file when uploading +# to a chef-server or supermarket. +# Lines that start with '# ' are comments. + +# OS generated files # +###################### +.DS_Store +Icon? +nohup.out +ehthumbs.db +Thumbs.db + +# SASS # +######## +.sass-cache + +# EDITORS # +########### +\#* +.#* +*~ +*.sw[a-z] +*.bak +REVISION +TAGS* +tmtags +*_flymake.* +*_flymake +*.tmproj +.project +.settings +mkmf.log + +## COMPILED ## +############## +a.out +*.o +*.pyc +*.so +*.com +*.class +*.dll +*.exe +*/rdoc/ + +# Testing # +########### +.watchr +.rspec +spec/* +spec/fixtures/* +test/* +features/* +examples/* +Guardfile +Procfile +.kitchen* +kitchen.yml* +.rubocop.yml +spec/* +Rakefile +.travis.yml +.foodcritic +.codeclimate.yml + +# SCM # +####### +.git +*/.git +.gitignore +.gitmodules +.gitconfig +.gitattributes +.svn +*/.bzr/* +*/.hg/* +*/.svn/* + +# Berkshelf # +############# +Berksfile +Berksfile.lock +cookbooks/* +tmp + +# Bundler # +########### +vendor/* + +# Policyfile # +############## +Policyfile.rb +Policyfile.lock.json + +# Cookbooks # +############# +CONTRIBUTING* +CHANGELOG* +TESTING* + +# Vagrant # +########### +.vagrant +Vagrantfile diff --git a/cookbooks/arcgis-mission/metadata.rb b/cookbooks/arcgis-mission/metadata.rb new file mode 100644 index 0000000..3c324cb --- /dev/null +++ b/cookbooks/arcgis-mission/metadata.rb @@ -0,0 +1,27 @@ +name 'arcgis-mission' +maintainer 'Esri' +maintainer_email 'contracts@esri.com' +license 'Apache-2.0' +description 'Installs/Configures ArcGIS Mission Server' +long_description 'Installs/Configures ArcGIS Mission Server' +version '3.6.0' +chef_version '>= 13.0', '< 15.0' if defined? chef_version + +depends 'arcgis-enterprise', '~> 3.6' +depends 'arcgis-repository', '~> 3.6' + +supports 'ubuntu' +supports 'redhat' +supports 'windows' + +recipe 'arcgis-mission::default', 'Installs and configures ArcGIS Mission Server' +recipe 'arcgis-mission::federation', 'Federates ArcGIS Mission Server with Portal for ArcGIS and enables MissionServer role' +recipe 'arcgis-mission::install_server', 'Installs ArcGIS Mission Server' +recipe 'arcgis-mission::install_server_wa', 'Installs ArcGIS Web Adaptor for ArcGIS Mission Server' +recipe 'arcgis-mission::server', 'Installs and configures ArcGIS Mission Server' +recipe 'arcgis-mission::server_wa', 'Installs and configures ArcGIS Web Adaptor for ArcGIS Mission Server' +recipe 'arcgis-mission::uninstall_server', 'Uninstalls ArcGIS Mission Server' +recipe 'arcgis-mission::uninstall_server_wa', 'Uninstalls ArcGIS Web Adaptor for ArcGIS Mission Server' + +issues_url 'https://github.com/Esri/arcgis-cookbook/issues' if respond_to?(:issues_url) +source_url 'https://github.com/Esri/arcgis-cookbook' if respond_to?(:source_url) diff --git a/cookbooks/arcgis-mission/recipes/default.rb b/cookbooks/arcgis-mission/recipes/default.rb new file mode 100644 index 0000000..e93764f --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/default.rb @@ -0,0 +1,19 @@ +# +# Cookbook:: arcgis-mission +# Recipe:: default +# +# Copyright:: 2020, Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +include_recipe 'arcgis-mission::server' diff --git a/cookbooks/arcgis-mission/recipes/federation.rb b/cookbooks/arcgis-mission/recipes/federation.rb new file mode 100644 index 0000000..5d5c9b5 --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/federation.rb @@ -0,0 +1,45 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: federation +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +arcgis_enterprise_portal 'Federate Mission Server' do + portal_url node['arcgis']['portal']['wa_url'] + username node['arcgis']['portal']['admin_username'] + password node['arcgis']['portal']['admin_password'] + server_url node['arcgis']['mission_server']['web_context_url'] + server_admin_url node['arcgis']['mission_server']['private_url'] + server_username node['arcgis']['mission_server']['admin_username'] + server_password node['arcgis']['mission_server']['admin_password'] + is_hosting false + retries 5 + retry_delay 30 + action :federate_server +end + +arcgis_enterprise_portal 'Enable MissionServer server function' do + portal_url node['arcgis']['portal']['wa_url'] + username node['arcgis']['portal']['admin_username'] + password node['arcgis']['portal']['admin_password'] + server_url node['arcgis']['mission_server']['web_context_url'] + server_admin_url node['arcgis']['mission_server']['private_url'] + server_username node['arcgis']['mission_server']['admin_username'] + server_password node['arcgis']['mission_server']['admin_password'] + server_function 'MissionServer' + is_hosting false + action :enable_server_function +end diff --git a/cookbooks/arcgis-mission/recipes/fileserver.rb b/cookbooks/arcgis-mission/recipes/fileserver.rb new file mode 100644 index 0000000..6d5b90b --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/fileserver.rb @@ -0,0 +1,35 @@ +# Cookbook Name:: arcgis-mission +# Recipe:: fileserver +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +if node['platform'] != 'windows' + node['arcgis']['mission_server']['shares'].each do |share| + directory share do + owner node['arcgis']['run_as_user'] + mode '0700' + recursive true + action :create + end + + nfs_export share do + network '*' + writeable true + sync true + options ['insecure', 'no_subtree_check', 'nohide', 'no_root_squash'] + end + end +end \ No newline at end of file diff --git a/cookbooks/arcgis-mission/recipes/install_server.rb b/cookbooks/arcgis-mission/recipes/install_server.rb new file mode 100644 index 0000000..3a17ebb --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/install_server.rb @@ -0,0 +1,77 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: install_server +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +if node['platform'] == 'windows' + arcgis_mission_server 'Update ArcGIS Mission Server service logon account' do + install_dir node['arcgis']['mission_server']['install_dir'] + run_as_user node['arcgis']['run_as_user'] + run_as_password node['arcgis']['run_as_password'] + only_if { Utils.product_installed?(node['arcgis']['mission_server']['product_code']) } + subscribes :update_account, "user[#{node['arcgis']['run_as_user']}]", :immediately + action :nothing + end +end + +arcgis_mission_server "Install System Requirements:#{recipe_name}" do + action :system + only_if { node['arcgis']['mission_server']['install_system_requirements'] } +end + +arcgis_mission_server 'Unpack ArcGIS Mission Server Setup' do + setup_archive node['arcgis']['mission_server']['setup_archive'] + setups_repo node['arcgis']['repository']['setups'] + run_as_user node['arcgis']['run_as_user'] + only_if { ::File.exist?(node['arcgis']['mission_server']['setup_archive']) && + !::File.exist?(node['arcgis']['mission_server']['setup']) } + if node['platform'] == 'windows' + not_if { Utils.product_installed?(node['arcgis']['mission_server']['product_code']) } + else + not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], + node['hostname'], + node['arcgis']['version'], + :ArcGISMissionServer) } + end + action :unpack +end + +arcgis_mission_server 'Setup ArcGIS Mission Server' do + setup node['arcgis']['mission_server']['setup'] + install_dir node['arcgis']['mission_server']['install_dir'] + run_as_user node['arcgis']['run_as_user'] + run_as_password node['arcgis']['run_as_password'] + if node['platform'] == 'windows' + not_if { Utils.product_installed?(node['arcgis']['mission_server']['product_code']) } + else + not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], + node['hostname'], + node['arcgis']['version'], + :ArcGISMissionServer) } + end + action :install +end + +arcgis_mission_server 'Configure agsmission service' do + install_dir node['arcgis']['mission_server']['install_dir'] + only_if { node['arcgis']['mission_server']['configure_autostart'] } + action :configure_autostart +end + +arcgis_mission_server 'Start ArcGIS Mission Server' do + action :start +end diff --git a/cookbooks/arcgis-mission/recipes/install_server_wa.rb b/cookbooks/arcgis-mission/recipes/install_server_wa.rb new file mode 100644 index 0000000..4c656ca --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/install_server_wa.rb @@ -0,0 +1,60 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: install_server_wa +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +arcgis_enterprise_webadaptor 'Unpack ArcGIS Web Adaptor' do + setup_archive node['arcgis']['web_adaptor']['setup_archive'] + setups_repo node['arcgis']['repository']['setups'] + run_as_user node['arcgis']['run_as_user'] + only_if { ::File.exist?(node['arcgis']['web_adaptor']['setup_archive']) && + !::File.exist?(node['arcgis']['web_adaptor']['setup']) } + if node['platform'] == 'windows' + not_if { !Utils.wa_product_code(node['arcgis']['mission_server']['wa_name'], + [node['arcgis']['web_adaptor']['product_code'], + node['arcgis']['web_adaptor']['product_code2']]).nil? } + else + not_if { ::File.exist?(::File.join(node['arcgis']['web_adaptor']['install_dir'], + node['arcgis']['web_adaptor']['install_subdir'], + 'java/arcgis.war')) } + end + action :unpack +end + +arcgis_enterprise_webadaptor 'Install Web Adaptor for Mission Server' do + install_dir node['arcgis']['web_adaptor']['install_dir'] + setup node['arcgis']['web_adaptor']['setup'] + run_as_user node['arcgis']['run_as_user'] + instance_name node['arcgis']['mission_server']['wa_name'] + if node['platform'] == 'windows' + not_if { !Utils.wa_product_code(node['arcgis']['mission_server']['wa_name'], + [node['arcgis']['web_adaptor']['product_code'], + node['arcgis']['web_adaptor']['product_code2']]).nil? } + else + not_if { ::File.exist?(::File.join(node['arcgis']['web_adaptor']['install_dir'], + node['arcgis']['web_adaptor']['install_subdir'], + 'java/arcgis.war')) } + end + action :install +end + +arcgis_enterprise_webadaptor 'Deploy Web Adaptor for Mission Server' do + install_dir node['arcgis']['web_adaptor']['install_dir'] + instance_name node['arcgis']['mission_server']['wa_name'] + not_if { node['platform'] == 'windows' } + action :deploy +end diff --git a/cookbooks/arcgis-mission/recipes/server.rb b/cookbooks/arcgis-mission/recipes/server.rb new file mode 100644 index 0000000..403d192 --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/server.rb @@ -0,0 +1,74 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: server +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe 'arcgis-mission::install_server' + +arcgis_mission_server 'Authorize ArcGIS Mission Server' do + authorization_file node['arcgis']['mission_server']['authorization_file'] + authorization_file_version node['arcgis']['mission_server']['authorization_file_version'] + retries 2 + retry_delay 30 + notifies :stop, 'arcgis_mission_server[Stop ArcGIS Mission Server]', :immediately + action :authorize +end + +# Restart ArcGIS Mission Server +arcgis_mission_server 'Stop ArcGIS Mission Server' do + action :nothing +end + +arcgis_mission_server 'Start ArcGIS Mission Server' do + action :start +end + +directory node['arcgis']['mission_server']['directories_root'] do + owner node['arcgis']['run_as_user'] + if node['platform'] != 'windows' + mode '0700' + end + recursive true + not_if { node['arcgis']['mission_server']['directories_root'].start_with?('\\\\') || + node['arcgis']['mission_server']['directories_root'].start_with?('/net/') } + action :create +end + +# Create configuration store directory +directory node['arcgis']['mission_server']['config_store_connection_string'] do + owner node['arcgis']['run_as_user'] + if node['platform'] != 'windows' + mode '0700' + end + recursive true + not_if { node['arcgis']['mission_server']['config_store_connection_string'].start_with?('\\\\') || + node['arcgis']['mission_server']['config_store_connection_string'].start_with?('/net/') } + action :create +end + +arcgis_mission_server 'Create ArcGIS Mission Server site' do + install_dir node['arcgis']['mission_server']['install_dir'] + server_url node['arcgis']['mission_server']['url'] + username node['arcgis']['mission_server']['admin_username'] + password node['arcgis']['mission_server']['admin_password'] + server_directories_root node['arcgis']['mission_server']['directories_root'] + config_store_connection_string node['arcgis']['mission_server']['config_store_connection_string'] + system_properties node['arcgis']['mission_server']['system_properties'] + retries 5 + retry_delay 30 + action :create_site +end diff --git a/cookbooks/arcgis-mission/recipes/server_wa.rb b/cookbooks/arcgis-mission/recipes/server_wa.rb new file mode 100644 index 0000000..69e9b1f --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/server_wa.rb @@ -0,0 +1,33 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: server_wa +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe 'arcgis-mission::install_server_wa' + +arcgis_enterprise_webadaptor 'Configure Web Adaptor with Mission Server' do + install_dir node['arcgis']['web_adaptor']['install_dir'] + server_wa_url node['arcgis']['mission_server']['wa_url'] + server_url node['arcgis']['mission_server']['url'] + username node['arcgis']['mission_server']['admin_username'] + password node['arcgis']['mission_server']['admin_password'] + admin_access true + mode 'mission' + retries 5 + retry_delay 60 + action :configure_with_server +end diff --git a/cookbooks/arcgis-mission/recipes/uninstall_server.rb b/cookbooks/arcgis-mission/recipes/uninstall_server.rb new file mode 100644 index 0000000..c257df2 --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/uninstall_server.rb @@ -0,0 +1,33 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: uninstall_server +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +arcgis_mission_server 'Uninstall ArcGIS Mission Server' do + install_dir node['arcgis']['mission_server']['install_dir'] + run_as_user node['arcgis']['run_as_user'] + if node['platform'] == 'windows' + product_code node['arcgis']['mission_server']['product_code'] + only_if { Utils.product_installed?(node['arcgis']['mission_server']['product_code']) } + else + only_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'], + node['hostname'], + node['arcgis']['version'], + :ArcGISMissionServer) } + end + action :uninstall +end diff --git a/cookbooks/arcgis-mission/recipes/uninstall_server_wa.rb b/cookbooks/arcgis-mission/recipes/uninstall_server_wa.rb new file mode 100644 index 0000000..798252f --- /dev/null +++ b/cookbooks/arcgis-mission/recipes/uninstall_server_wa.rb @@ -0,0 +1,40 @@ +# +# Cookbook Name:: arcgis-mission +# Recipe:: uninstall_server_wa +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +arcgis_enterprise_webadaptor 'Uninstall Web Adaptor for Mission Server' do + install_dir node['arcgis']['web_adaptor']['install_dir'] + instance_name node['arcgis']['mission_server']['wa_name'] + run_as_user node['arcgis']['run_as_user'] + if node['platform'] == 'windows' + product_code Utils.wa_product_code(node['arcgis']['mission_server']['wa_name'], + [node['arcgis']['web_adaptor']['product_code'], + node['arcgis']['web_adaptor']['product_code2']]) + only_if { + !Utils.wa_product_code(node['arcgis']['mission_server']['wa_name'], + [node['arcgis']['web_adaptor']['product_code'], + node['arcgis']['web_adaptor']['product_code2']]).nil? + } + else + only_if { + ::File.exist?(::File.join(node['arcgis']['web_server']['webapp_dir'], + node['arcgis']['mission_server']['wa_name'] + '.war')) + } + end + action :uninstall +end diff --git a/cookbooks/arcgis-mission/resources/server.rb b/cookbooks/arcgis-mission/resources/server.rb new file mode 100644 index 0000000..c79ad17 --- /dev/null +++ b/cookbooks/arcgis-mission/resources/server.rb @@ -0,0 +1,314 @@ +# +# Cookbook Name:: arcgis-mission +# Resource:: server +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +actions :system, :unpack, :install, :uninstall, :update_account, :stop, :start, + :configure_autostart, :authorize, :create_site + +attribute :setup_archive, :kind_of => String +attribute :setups_repo, :kind_of => String +attribute :setup, :kind_of => String +attribute :install_dir, :kind_of => String +attribute :run_as_user, :kind_of => String +attribute :run_as_password, :kind_of => String +attribute :authorization_file, :kind_of => String +attribute :authorization_file_version, :kind_of => String +attribute :product_code, :kind_of => String +attribute :username, :kind_of => String +attribute :password, :kind_of => String +attribute :server_directories_root, :kind_of => String +attribute :config_store_connection_string, :kind_of => String +attribute :server_url, :kind_of => String +attribute :system_properties, :kind_of => Hash, :default => {} + +def initialize(*args) + super + @action = :install +end + +use_inline_resources if defined?(use_inline_resources) + +action :system do + case node['platform'] + when 'windows' + # Configure Windows firewall + windows_firewall_rule 'ArcGIS Mission Server' do + description 'Allows connections through all ports used by ArcGIS Mission Server' + local_port node['arcgis']['mission_server']['ports'] + protocol 'TCP' + firewall_action :allow + only_if { node['arcgis']['configure_windows_firewall'] } + end + end +end + +action :unpack do + if node['platform'] == 'windows' + cmd = @new_resource.setup_archive + args = "/s /d \"#{@new_resource.setups_repo}\"" + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) + cmd.run_command + cmd.error! + else + cmd = 'tar' + args = "xzvf \"#{@new_resource.setup_archive}\"" + repo = ::File.join(@new_resource.setups_repo, node['arcgis']['version']) + FileUtils.mkdir_p(repo) unless ::File.directory?(repo) + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600, :cwd => repo }) + cmd.run_command + cmd.error! + + FileUtils.chown_R @new_resource.run_as_user, nil, repo + end +end + +action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + + if node['platform'] == 'windows' + cmd = @new_resource.setup + run_as_password = @new_resource.run_as_password.gsub("&", "^&") + args = "/qn INSTALLDIR=\"#{@new_resource.install_dir}\" USER_NAME=\"#{@new_resource.run_as_user}\" PASSWORD=\"#{run_as_password}\"" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) + cmd.run_command + cmd.error! + else + cmd = @new_resource.setup + args = "-m silent -l yes -d \"#{@new_resource.install_dir}\"" + run_as_user = @new_resource.run_as_user + + cmd = Mixlib::ShellOut.new("su - #{run_as_user} -c \"#{cmd} #{args}\"", { :timeout => 3600 }) + cmd.run_command + cmd.error! + end +end + +action :uninstall do + if node['platform'] == 'windows' + cmd = 'msiexec' + args = "/qn /x #{@new_resource.product_code}" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) + cmd.run_command + cmd.error! + else + install_subdir = ::File.join(@new_resource.install_dir, + node['arcgis']['mission_server']['install_subdir']) + cmd = ::File.join(install_subdir, 'uninstall_ArcGISMissionServer') + args = '-s' + + cmd = Mixlib::ShellOut.new("su - #{@new_resource.run_as_user} -c \"#{cmd} #{args}\"", + { :timeout => 3600 }) + cmd.run_command + cmd.error! + end +end + +action :update_account do + if node['platform'] == 'windows' + Utils.sc_config('ArcGIS Mission Server', @new_resource.run_as_user, @new_resource.run_as_password) + end +end + +action :stop do + if node['platform'] == 'windows' + service "ArcGIS Mission Server" do + supports :status => true, :restart => true, :reload => true + action :stop + end + else + service "agsmission" do + supports :status => true, :restart => true, :reload => true + action :stop + end + end + + new_resource.updated_by_last_action(true) +end + +action :start do + if node['platform'] == 'windows' + service "ArcGIS Mission Server" do + supports :status => true, :restart => true, :reload => true + timeout 180 + action [:enable, :start] + end + else + service "agsmission" do + supports :status => true, :restart => true, :reload => true + action [:enable, :start] + end + end +end + +action :configure_autostart do + if node['platform'] == 'windows' + service "ArcGIS Mission Server" do + supports :status => true, :restart => true, :reload => true + action :enable + end + else + Chef::Log.info('Configure ArcGIS Mission Server to be started with the operating system.') + + agsuser = node['arcgis']['run_as_user'] + agsmissionhome = ::File.join(@new_resource.install_dir, + node['arcgis']['mission_server']['install_subdir']) + + if node['init_package'] == 'init' # SysV + Chef::Log.warn('SysV not supported.') + else # node['init_package'] == 'systemd' + agsmission_path = '/etc/systemd/system/agsmission.service' + agsmission_service_file = 'agsmission.service.erb' + agsmission_template_variables = ({ :agsmissionhome => agsmissionhome, :agsuser => agsuser }) + end + + template agsmission_path do + source agsmission_service_file + cookbook 'arcgis-mission' + variables agsmission_template_variables + owner agsuser + group 'root' + mode '0755' + notifies :run, 'execute[Load agsmission systemd unit file]', :immediately + end + + execute 'Load agsmission systemd unit file' do + command 'systemctl daemon-reload' + action :nothing + only_if {( node['init_package'] == 'systemd' )} + notifies :restart, 'service[agsmission]', :immediately + end + + service 'agsmission' do + supports :status => true, :restart => true, :reload => true + action :enable + end + end +end + +action :authorize do + if !@new_resource.authorization_file.nil? && !@new_resource.authorization_file.empty? + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + + cmd = node['arcgis']['mission_server']['authorization_tool'] + + if node['platform'] == 'windows' + args = "/VER #{@new_resource.authorization_file_version} /LIF \"#{@new_resource.authorization_file}\" /S" + sa_cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) + + sleep(rand(0..120)) # Use random delay top reduce probability of multiple machines authorization at the same time + sa_cmd.run_command + + # Retry authorization five times with random intervals between 120 and 300 seconds. + # Check if 'keycodes' file exists after each retry. + # This is required to get around the problem with simultaneous authorization from + # multiple machines using the same license. + node['arcgis']['server']['authorization_retries'].times do + if sa_cmd.error? + Chef::Log.error sa_cmd.format_for_exception + ' Retrying software authorization.' + sleep(rand(120..300)) + else + sleep(30) + break if ::File.exists?(node['arcgis']['mission_server']['keycodes']) + Chef::Log.error "'#{node['arcgis']['mission_server']['keycodes']}' file not found. Retrying software authorization." + sleep(rand(90..270)) + end + sa_cmd.run_command + end + + sa_cmd.error! + else + args = "-f \"#{@new_resource.authorization_file}\"" + sa_cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", + { :timeout => 600, :user => node['arcgis']['run_as_user'] }) + sleep(rand(0..120)) # Use random delay top reduce probability of multiple machines authorization at the same time + sa_cmd.run_command + + # Retry authorization five times with random intervals between 120 and 300 seconds. + # Check if softwareAuthorization stdout does not contain 'Not Authorized' after each retry. + # This is required to get around the problem with simultaneous authorization from + # multiple machines using the same license. + sa_status_cmd = Mixlib::ShellOut.new("\"#{cmd}\" -s", + { :user => node['arcgis']['run_as_user'], :timeout => 600 }) + + node['arcgis']['server']['authorization_retries'].times do + if sa_cmd.error? + Chef::Log.error sa_cmd.format_for_exception + ' Retrying software authorization...' + sleep(rand(120..300)) + else + sleep(30) + sa_status_cmd.run_command + break if !sa_status_cmd.error? && !sa_status_cmd.stdout.include?('Not Authorized') + Chef::Log.error sa_status_cmd.stdout + Chef::Log.error "ArcGIS Mission Server is not authorized. Retrying software authorization..." + sleep(rand(90..270)) + end + sa_cmd.run_command + end + + sa_cmd.error! + end + end +end + +action :create_site do + if node['platform'] == 'windows' + cmd = ::File.join(@new_resource.install_dir, 'tools', 'createsite', 'createsite.bat') + args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " \ + "-d \"#{@new_resource.server_directories_root}\" -c \"#{@new_resource.config_store_connection_string}\" " + + env = { 'AGSMISSION' => @new_resource.install_dir + '\\' } + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", :timeout => 1200, :environment => env) + cmd.run_command + cmd.error! + else + install_dir = ::File.join(@new_resource.install_dir, node['arcgis']['mission_server']['install_subdir']) + cmd = ::File.join(install_dir, 'tools', 'createsite', 'createsite.sh') + args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + + "-d \"#{@new_resource.server_directories_root}\" -c \"#{@new_resource.config_store_connection_string}\"" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", + { :timeout => 1200, :user => @new_resource.run_as_user }) + cmd.run_command + + # Hack the error from stdout until createsite tool exits with nonzero on error + if cmd.stdout.include?('Error:') + Chef::Log.error cmd.stdout + raise cmd.stdout + end + + cmd.error! + end + + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + admin_client.wait_until_available + + if !@new_resource.system_properties.empty? + Chef::Log.info('Updating ArcGIS Mission Server system properties...') + admin_client.update_system_properties(@new_resource.system_properties) + end +end diff --git a/cookbooks/arcgis-mission/templates/default/agsmission.service.erb b/cookbooks/arcgis-mission/templates/default/agsmission.service.erb new file mode 100644 index 0000000..22a5aaf --- /dev/null +++ b/cookbooks/arcgis-mission/templates/default/agsmission.service.erb @@ -0,0 +1,42 @@ +# ------------------------------------------------------------------ +# ArcGIS Mission Server systemd unit file +# ------------------------------------------------------------------ +# +# Configure ArcGIS Mission Server to be started at boot on RHEL 7.x by +# following these instructions: +# +# 1.) Switch to the root user. +# +# 2.) Copy this file to /etc/systemd/system +# +# 3.) Enable the service to start at boot: +# +# # systemctl enable agsmission.service +# +# 4.) Verify systemd service is setup correctly: +# +# # systemctl stop agsmission.service +# # systemctl start agsmission.service +# # systemctl status agsmission.service +# +# 5.) Reboot the system and verify that Mission Server restarts properly. +# +# ------------------------------------------------------------------ + +[Unit] +Description=ArcGIS Mission Server Service +After=network.target + +[Service] +Type=forking +User=<%=@agsuser%> +LimitNOFILE=65535 +LimitNPROC=25059 +GuessMainPID=false +ExecStart=<%=@agsmissionhome%>/startmissionserver.sh +ExecStop=<%=@agsmissionhome%>/stopmissionserver.sh +<%=@cloudenvironment%> + +[Install] +WantedBy=multi-user.target + diff --git a/cookbooks/arcgis-notebooks/CHANGELOG.md b/cookbooks/arcgis-notebooks/CHANGELOG.md index 8a7a07c..5d33148 100644 --- a/cookbooks/arcgis-notebooks/CHANGELOG.md +++ b/cookbooks/arcgis-notebooks/CHANGELOG.md @@ -2,6 +2,13 @@ This file is used to list changes made in each version of the arcgis-notebooks cookbook. +# 3.6.0 +------- + +- Added support for ArcGIS Notebook Server 10.8.1. +- Added unregister_machine recipe. + # 3.5.0 +------- -Initial release of the cookbook. +- Initial release of the cookbook. diff --git a/cookbooks/arcgis-notebooks/README.md b/cookbooks/arcgis-notebooks/README.md index 50cb7be..76c02e2 100644 --- a/cookbooks/arcgis-notebooks/README.md +++ b/cookbooks/arcgis-notebooks/README.md @@ -10,6 +10,7 @@ Requirements * 10.7.1 * 10.8 +* 10.8.1 ### Supported ArcGIS software @@ -98,6 +99,9 @@ Uninstalls ArcGIS Notebook Server. Uninstalls ArcGIS Web Adaptor for ArcGIS Notebook Server. +### arcgis-notebooks::unregister_machine + +Unregisters server machine from the ArcGIS Notebook Server site. Usage ----- @@ -168,10 +172,10 @@ Find a bug or want to request a new feature? Please let us know by submitting a Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing). -Licensing +## Licensing --------- -Copyright 2019 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-notebooks/attributes/default.rb b/cookbooks/arcgis-notebooks/attributes/default.rb index 6784707..45fe3b3 100644 --- a/cookbooks/arcgis-notebooks/attributes/default.rb +++ b/cookbooks/arcgis-notebooks/attributes/default.rb @@ -58,6 +58,14 @@ notebook_server['workspace'] = 'C:\\arcgisnotebookserver\\arcgisworkspace' case node['arcgis']['version'] + when '10.8.1' + notebook_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Notebook_Server_1081_175250.exe').gsub('/', '\\') + notebook_server['standard_images'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Notebook_Docker_Standard_1081_175251.tar.gz').gsub('/', '\\') + notebook_server['advanced_images'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Notebook_Docker_Advanced_1081_175252.tar.gz').gsub('/', '\\') + notebook_server['product_code'] = '{55DE1B3D-DDFB-4906-81F2-B573BAC25018}' when '10.8' notebook_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_Notebook_Server_108_172941.exe').gsub('/', '\\') @@ -101,6 +109,12 @@ notebook_server_install_subdir, '/tools/authorizeSoftware') + notebook_server['keycodes'] = ::File.join(node['arcgis']['notebook_server']['install_dir'], + node['arcgis']['notebook_server']['install_subdir'], + 'framework/.esri/License' + + node['arcgis']['notebook_server']['authorization_file_version'] + + '/sysgen/keycodes') + notebook_server['directories_root'] = ::File.join(notebook_server_install_dir, notebook_server_install_subdir, 'usr', 'directories') @@ -112,6 +126,13 @@ 'usr', 'arcgisworkspace') case node['arcgis']['version'] + when '10.8.1' + notebook_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Notebook_Server_Linux_1081_175333.tar.gz') + notebook_server['standard_images'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Notebook_Docker_Standard_1081_175251.tar.gz') + notebook_server['advanced_images'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGIS_Notebook_Docker_Advanced_1081_175252.tar.gz') when '10.8' notebook_server['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGIS_Notebook_Server_Linux_108_173012.tar.gz') diff --git a/cookbooks/arcgis-notebooks/metadata.rb b/cookbooks/arcgis-notebooks/metadata.rb index e4a6636..563bc4a 100644 --- a/cookbooks/arcgis-notebooks/metadata.rb +++ b/cookbooks/arcgis-notebooks/metadata.rb @@ -4,11 +4,11 @@ license 'Apache-2.0' description 'Installs/Configures ArcGIS Notebook Server' long_description 'Installs/Configures ArcGIS Notebook Server' -version '3.5.0' +version '3.6.0' chef_version '>= 13.0', '< 15.0' if defined? chef_version -depends 'arcgis-enterprise', '~> 3.5' -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-enterprise', '~> 3.6' +depends 'arcgis-repository', '~> 3.6' depends 'docker', '~> 4.9' supports 'ubuntu' @@ -25,6 +25,7 @@ recipe 'arcgis-notebooks::server_wa', 'Installs and configures ArcGIS Web Adaptor for ArcGIS Notebook Server' recipe 'arcgis-notebooks::uninstall_server', 'Uninstalls ArcGIS Notebook Server' recipe 'arcgis-notebooks::uninstall_server_wa', 'Uninstalls ArcGIS Web Adaptor for ArcGIS Notebook Server' +recipe 'arcgis-notebooks::unregister_machine', 'Unregisters server machine from the ArcGIS Notebook Server site' issues_url 'https://github.com/Esri/arcgis-cookbook/issues' if respond_to?(:issues_url) source_url 'https://github.com/Esri/arcgis-cookbook' if respond_to?(:source_url) diff --git a/cookbooks/arcgis-notebooks/recipes/server.rb b/cookbooks/arcgis-notebooks/recipes/server.rb index e4b1986..886e2bd 100644 --- a/cookbooks/arcgis-notebooks/recipes/server.rb +++ b/cookbooks/arcgis-notebooks/recipes/server.rb @@ -68,6 +68,7 @@ arcgis_notebooks_server 'Create ArcGIS Notebook Server site' do install_dir node['arcgis']['notebook_server']['install_dir'] + server_url node['arcgis']['notebook_server']['url'] username node['arcgis']['notebook_server']['admin_username'] password node['arcgis']['notebook_server']['admin_password'] server_directories_root node['arcgis']['notebook_server']['directories_root'] diff --git a/cookbooks/arcgis-notebooks/recipes/server_node.rb b/cookbooks/arcgis-notebooks/recipes/server_node.rb index fe16cbf..fbc690e 100644 --- a/cookbooks/arcgis-notebooks/recipes/server_node.rb +++ b/cookbooks/arcgis-notebooks/recipes/server_node.rb @@ -46,6 +46,7 @@ arcgis_notebooks_server 'Join ArcGIS Notebook Server site' do install_dir node['arcgis']['notebook_server']['install_dir'] + server_url node['arcgis']['notebook_server']['url'] username node['arcgis']['notebook_server']['admin_username'] password node['arcgis']['notebook_server']['admin_password'] primary_server_url node['arcgis']['notebook_server']['primary_server_url'] diff --git a/cookbooks/arcgis-notebooks/recipes/unregister_machine.rb b/cookbooks/arcgis-notebooks/recipes/unregister_machine.rb new file mode 100644 index 0000000..3f9746a --- /dev/null +++ b/cookbooks/arcgis-notebooks/recipes/unregister_machine.rb @@ -0,0 +1,27 @@ +# +# Cookbook Name:: arcgis-notebooks +# Recipe:: unregister_machine +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +arcgis_notebooks_server 'Unregister server machine' do + server_url node['arcgis']['notebook_server']['url'] + username node['arcgis']['notebook_server']['admin_username'] + password node['arcgis']['notebook_server']['admin_password'] + retries 5 + retry_delay 30 + action :unregister_machine +end diff --git a/cookbooks/arcgis-notebooks/resources/server.rb b/cookbooks/arcgis-notebooks/resources/server.rb index c63ff99..f0e9c2d 100644 --- a/cookbooks/arcgis-notebooks/resources/server.rb +++ b/cookbooks/arcgis-notebooks/resources/server.rb @@ -1,6 +1,6 @@ # # Cookbook Name:: arcgis-notebooks -# Resource:: notebook +# Resource:: server # # Copyright 2019 Esri # @@ -18,7 +18,8 @@ # actions :system, :unpack, :install, :uninstall, :update_account, :stop, :start, - :configure_autostart, :authorize, :post_install, :create_site, :join_site + :configure_autostart, :authorize, :post_install, :create_site, :join_site, + :unregister_machine attribute :setup_archive, :kind_of => String attribute :setups_repo, :kind_of => String @@ -35,6 +36,7 @@ attribute :server_directories_root, :kind_of => String attribute :config_store_connection_string, :kind_of => String attribute :workspace, :kind_of => String +attribute :server_url, :kind_of => String attribute :primary_server_url, :kind_of => String def initialize(*args) @@ -93,10 +95,14 @@ def initialize(*args) end action :install do + unless ::File.exists?(@new_resource.setup) + raise "File '#{@new_resource.setup}' not found." + end + if node['platform'] == 'windows' cmd = @new_resource.setup run_as_password = @new_resource.run_as_password.gsub("&", "^&") - args = "/qb INSTALLDIR=\"#{@new_resource.install_dir}\" USER_NAME=\"#{@new_resource.run_as_user}\" PASSWORD=\"#{run_as_password}\"" + args = "/qn INSTALLDIR=\"#{@new_resource.install_dir}\" USER_NAME=\"#{@new_resource.run_as_user}\" PASSWORD=\"#{run_as_password}\"" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command @@ -115,7 +121,7 @@ def initialize(*args) action :uninstall do if node['platform'] == 'windows' cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) cmd.run_command @@ -217,21 +223,67 @@ def initialize(*args) action :authorize do if !@new_resource.authorization_file.nil? && !@new_resource.authorization_file.empty? + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + cmd = node['arcgis']['notebook_server']['authorization_tool'] if node['platform'] == 'windows' args = "/VER #{@new_resource.authorization_file_version} /LIF \"#{@new_resource.authorization_file}\" /S" - - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) - cmd.run_command - cmd.error! + sa_cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) + + sleep(rand(0..120)) # Use random delay top reduce probability of multiple machines authorization at the same time + sa_cmd.run_command + + # Retry authorization five times with random intervals between 120 and 300 seconds. + # Check if 'keycodes' file exists after each retry. + # This is required to get around the problem with simultaneous authorization from + # multiple machines using the same license. + node['arcgis']['server']['authorization_retries'].times do + if sa_cmd.error? + Chef::Log.error sa_cmd.format_for_exception + ' Retrying software authorization.' + sleep(rand(120..300)) + else + sleep(30) + break if ::File.exists?(node['arcgis']['notebook_server']['keycodes']) + Chef::Log.error "'#{node['arcgis']['notebook_server']['keycodes']}' file not found. Retrying software authorization." + sleep(rand(90..270)) + end + sa_cmd.run_command + end + + sa_cmd.error! else args = "-f \"#{@new_resource.authorization_file}\"" - - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", + sa_cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600, :user => node['arcgis']['run_as_user'] }) - cmd.run_command - cmd.error! + sleep(rand(0..120)) # Use random delay top reduce probability of multiple machines authorization at the same time + sa_cmd.run_command + + # Retry authorization five times with random intervals between 120 and 300 seconds. + # Check if softwareAuthorization stdout does not contain 'Not Authorized' after each retry. + # This is required to get around the problem with simultaneous authorization from + # multiple machines using the same license. + sa_status_cmd = Mixlib::ShellOut.new("\"#{cmd}\" -s", + { :user => node['arcgis']['run_as_user'], :timeout => 600 }) + + node['arcgis']['server']['authorization_retries'].times do + if sa_cmd.error? + Chef::Log.error sa_cmd.format_for_exception + ' Retrying software authorization...' + sleep(rand(120..300)) + else + sleep(30) + sa_status_cmd.run_command + break if !sa_status_cmd.error? && !sa_status_cmd.stdout.include?('Not Authorized') + Chef::Log.error sa_status_cmd.stdout + Chef::Log.error "ArcGIS Notebook Server is not authorized. Retrying software authorization..." + sleep(rand(90..270)) + end + sa_cmd.run_command + end + + sa_cmd.error! end end end @@ -257,46 +309,87 @@ def initialize(*args) end action :create_site do - if node['platform'] == 'windows' - cmd = ::File.join(@new_resource.install_dir, 'tools', 'CreateSiteUtility', 'createsite.bat') - args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + - "-d \"#{@new_resource.server_directories_root}\" -c \"#{@new_resource.config_store_connection_string}\" " + - "-w \"#{@new_resource.workspace}\"" + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 1200 }) - cmd.run_command - cmd.error! + admin_client.wait_until_available + + if admin_client.upgrade_required? + Chef::Log.info('Completing ArcGIS Notebook Server upgrade...') + admin_client.complete_upgrade else - install_dir = ::File.join(@new_resource.install_dir, node['arcgis']['notebook_server']['install_subdir']) - cmd = ::File.join(install_dir, 'tools', 'createSiteUtility', 'createsite.sh') - args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + - "-d \"#{@new_resource.server_directories_root}\" -c \"#{@new_resource.config_store_connection_string}\"" + if node['platform'] == 'windows' + cmd = ::File.join(@new_resource.install_dir, 'tools', 'CreateSiteUtility', 'createsite.bat') + args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + + "-d \"#{@new_resource.server_directories_root}\" -c \"#{@new_resource.config_store_connection_string}\" " + + "-w \"#{@new_resource.workspace}\"" - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", - { :timeout => 1200, :user => @new_resource.run_as_user }) - cmd.run_command - cmd.error! + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 1200 }) + cmd.run_command + cmd.error! + else + install_dir = ::File.join(@new_resource.install_dir, node['arcgis']['notebook_server']['install_subdir']) + cmd = ::File.join(install_dir, 'tools', 'createSiteUtility', 'createsite.sh') + args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + + "-d \"#{@new_resource.server_directories_root}\" -c \"#{@new_resource.config_store_connection_string}\"" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", + { :timeout => 1200, :user => @new_resource.run_as_user }) + cmd.run_command + cmd.error! + end end end action :join_site do - if node['platform'] == 'windows' - cmd = ::File.join(@new_resource.install_dir, 'tools', 'JoinSiteUtility', 'joinsite.bat') - args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + - "-s \"#{@new_resource.primary_server_url}\"" + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 1200 }) - cmd.run_command - cmd.error! + admin_client.wait_until_available + + if admin_client.upgrade_required? + Chef::Log.info('Completing ArcGIS Notebook Server upgrade...') + admin_client.complete_upgrade else - install_dir = ::File.join(@new_resource.install_dir, node['arcgis']['notebook_server']['install_subdir']) - cmd = ::File.join(install_dir, 'tools', 'joinSiteUtility', 'joinsite.sh') - args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + - "-s \"#{@new_resource.primary_server_url}\"" + if node['platform'] == 'windows' + cmd = ::File.join(@new_resource.install_dir, 'tools', 'JoinSiteUtility', 'joinsite.bat') + args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + + "-s \"#{@new_resource.primary_server_url}\"" - cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", - { :timeout => 1200, :user => @new_resource.run_as_user }) - cmd.run_command - cmd.error! + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 1200 }) + cmd.run_command + cmd.error! + else + install_dir = ::File.join(@new_resource.install_dir, node['arcgis']['notebook_server']['install_subdir']) + cmd = ::File.join(install_dir, 'tools', 'joinSiteUtility', 'joinsite.sh') + args = "-u \"#{@new_resource.username}\" -p \"#{@new_resource.password}\" " + + "-s \"#{@new_resource.primary_server_url}\"" + + cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", + { :timeout => 1200, :user => @new_resource.run_as_user }) + cmd.run_command + cmd.error! + end end -end \ No newline at end of file +end + +action :unregister_machine do + begin + admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url, + @new_resource.username, + @new_resource.password) + + admin_client.wait_until_available + + Chef::Log.info('Unregistering server machine...') + + machine_name = node['fqdn'] + + admin_client.unregister_machine(machine_name) + rescue Exception => e + Chef::Log.error "Failed to unregister server machine. " + e.message + raise e + end +end diff --git a/cookbooks/arcgis-pro/CHANGELOG.md b/cookbooks/arcgis-pro/CHANGELOG.md index a27fba4..baf9f17 100644 --- a/cookbooks/arcgis-pro/CHANGELOG.md +++ b/cookbooks/arcgis-pro/CHANGELOG.md @@ -3,6 +3,10 @@ arcgis-pro cookbook CHANGELOG This file is used to list changes made in each version of the arcgis-pro cookbook. +3.6.0 +----- +- Added support for ArcGIS Pro 2.6. + 3.5.0 ----- - Added support for ArcGIS Pro 2.5. diff --git a/cookbooks/arcgis-pro/README.md b/cookbooks/arcgis-pro/README.md index b8f02f6..8255168 100644 --- a/cookbooks/arcgis-pro/README.md +++ b/cookbooks/arcgis-pro/README.md @@ -7,20 +7,16 @@ Requirements ------------ ### Supported ArcGIS Pro versions -* 1.2 -* 1.3 -* 1.4 * 2.0 * 2.1 * 2.2 * 2.3 * 2.4 * 2.5 +* 2.6 ### Platforms -* Windows 8 (8.1) * Windows 10 -* Windows Server 2008 (R2) * Windows Server 2012 (R2) * Windows Server 2016 * Windows Server 2019 @@ -33,7 +29,7 @@ The following cookbooks are required: Attributes ---------- -* `node['arcgis']['pro']['version']` = ArcGIS Pro version. Default version is `2.4` +* `node['arcgis']['pro']['version']` = ArcGIS Pro version. Default version is `2.6` * `node['arcgis']['pro']['setup_archive']` = Path to ArcGIS Pro setup archive. Default value depends on `node['arcgis']['pro']['version']` attribute value. * `node['arcgis']['pro']['setup']` = The location of ArcGIS Pro setup msi. Default location is `C:\Temp\ArcGISPro\ArcGISPro.msi`. * `node['arcgis']['pro']['install_dir']` = ArcGIS Pro installation directory. Default installation directory is `%ProgramFiles%\ArcGIS\Pro`. @@ -79,7 +75,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2016 Esri +Copyright 2016-2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis-pro/attributes/default.rb b/cookbooks/arcgis-pro/attributes/default.rb index 973ca72..ff1a49b 100644 --- a/cookbooks/arcgis-pro/attributes/default.rb +++ b/cookbooks/arcgis-pro/attributes/default.rb @@ -21,7 +21,7 @@ default['arcgis']['pro'].tap do |pro| case node['platform'] when 'windows' - pro['version'] = '2.5' + pro['version'] = '2.6' pro['setup'] = ::File.join(node['arcgis']['repository']['setups'], 'ArcGIS Pro ' + node['arcgis']['pro']['version'], @@ -38,6 +38,10 @@ pro['authorization_tool'] = ENV['ProgramW6432'] + '\\ArcGIS\\Pro\\bin\\SoftwareAuthorizationPro.exe' case node['arcgis']['pro']['version'] + when '2.6' + pro['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], + 'ArcGISPro_26_175036.exe').gsub('/', '\\') + pro['product_code'] = '{9D510CBA-7DB1-4E3D-8938-5E193DF406C9}' when '2.5' pro['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'], 'ArcGISPro_25_172639.exe').gsub('/', '\\') diff --git a/cookbooks/arcgis-pro/metadata.rb b/cookbooks/arcgis-pro/metadata.rb index 25c5308..e09558e 100644 --- a/cookbooks/arcgis-pro/metadata.rb +++ b/cookbooks/arcgis-pro/metadata.rb @@ -4,9 +4,9 @@ license 'Apache 2.0' description 'Installs and configures ArcGIS Pro' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-repository', '~> 3.6' depends 'windows', '~> 5.3' supports 'windows' diff --git a/cookbooks/arcgis-pro/providers/pro.rb b/cookbooks/arcgis-pro/providers/pro.rb index cc56621..92f9027 100644 --- a/cookbooks/arcgis-pro/providers/pro.rb +++ b/cookbooks/arcgis-pro/providers/pro.rb @@ -41,15 +41,15 @@ cmd = node['arcgis']['pro']['setup'] if node['arcgis']['pro']['authorization_type'] == 'NAMED_USER' - args = "ALLUSERS=#{node['arcgis']['pro']['allusers']} BLOCKADDINS=#{node['arcgis']['pro']['blockaddins']} INSTALLDIR=\"#{node['arcgis']['pro']['install_dir']}\" /qb" + args = "ALLUSERS=#{node['arcgis']['pro']['allusers']} BLOCKADDINS=#{node['arcgis']['pro']['blockaddins']} INSTALLDIR=\"#{node['arcgis']['pro']['install_dir']}\" /qn" end if node['arcgis']['pro']['authorization_type'] == 'SINGLE_USE' - args = "ALLUSERS=#{node['arcgis']['pro']['allusers']} Portal_List=#{node['arcgis']['pro']['portal_list']} AUTHORIZATION_TYPE=#{node['arcgis']['pro']['authorization_type']} SOFTWARE_CLASS=#{node['arcgis']['pro']['software_class']} BLOCKADDINS=#{node['arcgis']['pro']['blockaddins']} INSTALLDIR=\"#{node['arcgis']['pro']['install_dir']}\" /qb" + args = "ALLUSERS=#{node['arcgis']['pro']['allusers']} Portal_List=#{node['arcgis']['pro']['portal_list']} AUTHORIZATION_TYPE=#{node['arcgis']['pro']['authorization_type']} SOFTWARE_CLASS=#{node['arcgis']['pro']['software_class']} BLOCKADDINS=#{node['arcgis']['pro']['blockaddins']} INSTALLDIR=\"#{node['arcgis']['pro']['install_dir']}\" /qn" end if node['arcgis']['pro']['authorization_type'] == 'CONCURRENT_USE' - args = "ALLUSERS=#{node['arcgis']['pro']['allusers']} Portal_List=#{node['arcgis']['pro']['portal_list']} ESRI_LICENSE_HOST=#{node['arcgis']['pro']['esri_license_host']} AUTHORIZATION_TYPE=#{node['arcgis']['pro']['authorization_type']} SOFTWARE_CLASS=#{node['arcgis']['pro']['software_class']} BLOCKADDINS=#{node['arcgis']['pro']['blockaddins']} INSTALLDIR=\"#{node['arcgis']['pro']['install_dir']}\" /qb" + args = "ALLUSERS=#{node['arcgis']['pro']['allusers']} Portal_List=#{node['arcgis']['pro']['portal_list']} ESRI_LICENSE_HOST=#{node['arcgis']['pro']['esri_license_host']} AUTHORIZATION_TYPE=#{node['arcgis']['pro']['authorization_type']} SOFTWARE_CLASS=#{node['arcgis']['pro']['software_class']} BLOCKADDINS=#{node['arcgis']['pro']['blockaddins']} INSTALLDIR=\"#{node['arcgis']['pro']['install_dir']}\" /qn" end cmd = Mixlib::ShellOut.new("msiexec.exe /i \"#{cmd}\" #{args}", @@ -80,7 +80,7 @@ action :uninstall do cmd = 'msiexec' - args = "/qb /x #{@new_resource.product_code}" + args = "/qn /x #{@new_resource.product_code}" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 3600 }) @@ -93,6 +93,10 @@ action :authorize do cmd = node['arcgis']['pro']['authorization_tool'] if node['arcgis']['pro']['authorization_type'] == 'SINGLE_USE' + unless ::File.exists?(@new_resource.authorization_file) + raise "File '#{@new_resource.authorization_file}' not found." + end + args = "/LIF \"#{@new_resource.authorization_file}\" /S /VER \"#{@new_resource.authorization_file_version}\"" cmd = Mixlib::ShellOut.new("\"#{cmd}\" #{args}", { :timeout => 600 }) diff --git a/cookbooks/arcgis-pro/recipes/default.rb b/cookbooks/arcgis-pro/recipes/default.rb index 2d02057..7f2a4bd 100644 --- a/cookbooks/arcgis-pro/recipes/default.rb +++ b/cookbooks/arcgis-pro/recipes/default.rb @@ -22,5 +22,6 @@ arcgis_pro_pro 'Authorize ArcGIS Pro' do authorization_file node['arcgis']['pro']['authorization_file'] authorization_file_version node['arcgis']['pro']['authorization_file_version'] + authorization_type node['arcgis']['pro']['authorization_type'] action :authorize end \ No newline at end of file diff --git a/cookbooks/arcgis-repository/CHANGELOG.md b/cookbooks/arcgis-repository/CHANGELOG.md index 5e3859c..7c809d5 100644 --- a/cookbooks/arcgis-repository/CHANGELOG.md +++ b/cookbooks/arcgis-repository/CHANGELOG.md @@ -3,6 +3,10 @@ arcgis-repository cookbook CHANGELOG This file is used to list changes made in each version of the arcgis-repository cookbook. +3.6.0 +----- +- Added s3files2 recipe. + 3.5.0 ----- - Updated dependent cookbooks. diff --git a/cookbooks/arcgis-repository/README.md b/cookbooks/arcgis-repository/README.md index 5128267..f201079 100644 --- a/cookbooks/arcgis-repository/README.md +++ b/cookbooks/arcgis-repository/README.md @@ -11,10 +11,10 @@ Requirements * 10.7 * 10.7.1 * 10.8 +* 10.8.1 ### Platforms -* Windows 7 * Windows 8 (8.1) * Windows 10 * Windows Server 2008 (R2) @@ -40,7 +40,8 @@ Attributes * `node['arcgis']['repository']['server']['url']` = Remote ArcGIS software repository URL. The Default URL is `https://downloads.arcgis.com/dms/rest/download/secured`. * `node['arcgis']['repository']['server']['key']` = Remote ArcGIS software repository key. * `node['arcgis']['repository']['server']['s3bucket']` = Remote ArcGIS software repository S3 bucket name. -* `node['arcgis']['repository']['server']['aws_access_key']` = AWS access key ID. +* `node['arcgis']['repository']['server']['region']` = Remote ArcGIS software repository S3 bucket region id. +* `node['arcgis']['repository']['server']['aws_access_key']` = AWS access key ID. IAM role credentials are used if access key is not specified. * `node['arcgis']['repository']['server']['aws_secret_access_key']` = AWS secret access key. * `node['arcgis']['repository']['files']` = file names mapped to SHA256 checksum and the remote path subfolder attributes. Default value is `nil`. @@ -55,6 +56,10 @@ Downloads files from remote ArcGIS software repository to local repository speci Downloads files from ArcGIS software repository in S3 to local repository specified by `node['arcgis']['repository']['local_archives']` attribute. +### arcgis-repository::s3files2 + +Downloads files from ArcGIS software repository in S3 to local repository using AWS CLI Tools on Linux and AWS Tools for PowerShell on Windows. + Examples -------- @@ -115,3 +120,32 @@ arcgis-repository::s3files recipe use example. ] } ``` + +## Issues + +Find a bug or want to request a new feature? Please let us know by submitting an [issue](https://github.com/Esri/arcgis-cookbook/issues). + +## Contributing + +Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing). + +Licensing +--------- + +Copyright 2020 Esri + +Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +A copy of the license is available in the repository's [License.txt](https://github.com/Esri/arcgis-cookbook/blob/master/License.txt?raw=true) file. + +[](Esri Tags: ArcGIS Chef Cookbook) +[](Esri Language: Ruby) diff --git a/cookbooks/arcgis-repository/attributes/default.rb b/cookbooks/arcgis-repository/attributes/default.rb index f9fb4cc..3c7bb2f 100644 --- a/cookbooks/arcgis-repository/attributes/default.rb +++ b/cookbooks/arcgis-repository/attributes/default.rb @@ -40,71 +40,10 @@ repository['server']['key'] = '' # ArcGIS Software Repository in S3 attributes - repository_s3buckets = { - 'ap-south-1' => 'arcgisstore107-ap-south-1', - 'eu-north-1' => 'arcgisstore107-eu-north-1', - 'eu-west-3' => 'arcgisstore107-eu-west-3', - 'eu-west-2' => 'arcgisstore107-eu-west-2', - 'eu-west-1' => 'arcgisstore107-eu-west-1', - 'ap-northeast-2' => 'arcgisstore107-ap-northeast-2', - 'ap-northeast-1' => 'arcgisstore107-ap-northeast-1', - 'sa-east-1' => 'arcgisstore107-sa-east-1', - 'ca-central-1' => 'arcgisstore107-ca-central-1', - 'ap-southeast-1' => 'arcgisstore107-ap-southeast-1', - 'ap-southeast-2' => 'arcgisstore107-ap-southeast-2', - 'eu-central-1' => 'arcgisstore107-eu-central-1', - 'us-east-1' => 'arcgisstore107-us-east-1', - 'us-east-2' => 'arcgisstore107-us-east-2', - 'us-west-1' => 'arcgisstore107-us-west-1', - 'us-west-2' => 'arcgisstore107-us-west-2', - 'us-gov-west-1' => 'arcgisstore107-us-gov-west-1', - 'us-gov-east-1' => 'arcgisstore107-us-gov-east-1' - } - - repository['server']['region'] = 'us-east-1' - repository['server']['s3bucket'] = repository_s3buckets[node['arcgis']['repository']['server']['region']] + repository['server']['region'] = '' + repository['server']['s3bucket'] = '' # AWS access keys are required to download files form ArcGIS software repository S3 buckets repository['server']['aws_access_key'] = '' repository['server']['aws_secret_access_key'] = '' - - # if node['platform'] == 'windows' - # repository['files'] = { - # 'ArcGIS_DataStore_Windows_107_167633.exe' => { - # 'subfolder' => '10450/setups', - # 'checksum' => 'A28C8CA67DB7ECCE8AFF41CD0B88EB781C05D7949AD495DEF9045FEAEED6E3C4' - # }, - # 'ArcGIS_Server_Windows_107_167621.exe' => { - # 'subfolder' => '10450/setups', - # 'checksum' => '444FC3FB1D11A715FAA355A0587D7E71F0AE4873EC3C9F00BE98AD04566D2CD2' - # }, - # 'Portal_for_ArcGIS_Windows_107_167632.exe' => { - # 'subfolder' => '10450/setups', - # 'checksum' => 'BDC20B9A19515966864953E85E25E174E58877B934157AA33EFB1443314B80E5' - # }, - # 'Web_Adaptor_for_Microsoft_IIS_107_167634.exe' => { - # 'subfolder' => '10450/setups', - # 'checksum' => '714C20ACD19663CCAE8A1BF2ABBEF70F46E53BF83626DE13483348BBBB056A2C' - # } - # } - # else # Linux - # repository['files'] = { - # 'ArcGIS_DataStore_Linux_107_167719.tar.gz' => { - # 'subfolder' => '10450/setups', - # 'checksum' => 'A8DBE53A19838120ED99D352654174B37B31163E173AD0D26B47A15872E4245C' - # }, - # 'ArcGIS_Server_Linux_107_167707.tar.gz' => { - # 'subfolder' => '10450/setups', - # 'checksum' => '350B985F8CF900A27C0043561CFA092930A1CCA2352A1DECABA4DD378ECA1492' - # }, - # 'Portal_for_ArcGIS_Linux_107_167718.tar.gz' => { - # 'subfolder' => '10450/setups', - # 'checksum' => '12E362E7542EF1BB3EB04E605BB99F1B1D181644C4E7C6C2B19B6601AF50595B' - # }, - # 'Web_Adaptor_Java_Linux_107_167720.tar.gz' => { - # 'subfolder' => '10450/setups', - # 'checksum' => 'F0773EE8BFF83FFFB40FB0AF232BCB988BCF49B4491A1BAD6F8852F71AA7B3A6' - # } - # } - # end end diff --git a/cookbooks/arcgis-repository/libraries/utils.rb b/cookbooks/arcgis-repository/libraries/utils.rb index a1744d1..e499747 100644 --- a/cookbooks/arcgis-repository/libraries/utils.rb +++ b/cookbooks/arcgis-repository/libraries/utils.rb @@ -21,6 +21,21 @@ # ArcGIS helper classes # module ArcGIS + + def self.build_endpoint_url(bucket, region) + endpoint = if region && region != "us-east-1" + "s3-#{region}.amazonaws.com" + else + "s3.amazonaws.com" + end + + if bucket =~ /^[a-z0-9][a-z0-9-]+[a-z0-9]$/ + "https://#{bucket}.#{endpoint}" + else + "https://#{endpoint}/#{bucket}" + end + end + # Retrieves ArcGIS software download URL from remote ArcGIS Software repository. def self.get_download_url(repository_url, access_key, file, subfolder) uri = URI.parse(repository_url + '/' + file) diff --git a/cookbooks/arcgis-repository/metadata.rb b/cookbooks/arcgis-repository/metadata.rb index 22faa9c..713bdef 100644 --- a/cookbooks/arcgis-repository/metadata.rb +++ b/cookbooks/arcgis-repository/metadata.rb @@ -4,7 +4,7 @@ license 'Apache-2.0' description 'Downloads ArcGIS software setups from remote to local repositories' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' chef_version '>= 13.0', '< 15.0' if defined? chef_version depends 's3_file', '~> 2.8' @@ -15,6 +15,7 @@ recipe 'arcgis-repository::default', 'Downloads files from remote ArcGIS software repository to local repository.' recipe 'arcgis-repository::s3files', 'Downloads files from ArcGIS software repository in S3 to local repository.' +recipe 'arcgis-repository::s3files2', 'Downloads files from ArcGIS software repository in S3 to local repository using AWS CLI Tools on Linux and AWS Tools for PowerShell on Windows.' issues_url 'https://github.com/esri/arcgis-cookbook/issues' source_url 'https://github.com/esri/arcgis-cookbook' diff --git a/cookbooks/arcgis-repository/recipes/s3files.rb b/cookbooks/arcgis-repository/recipes/s3files.rb index 8b43959..8f3b402 100644 --- a/cookbooks/arcgis-repository/recipes/s3files.rb +++ b/cookbooks/arcgis-repository/recipes/s3files.rb @@ -31,7 +31,11 @@ path ::File.join(node['arcgis']['repository']['local_archives'], filename) remote_path remote_path bucket node['arcgis']['repository']['server']['s3bucket'] - if !node['arcgis']['repository']['server']['aws_access_key'].empty? + unless node['arcgis']['repository']['server']['region'].empty? + s3_url ArcGIS.build_endpoint_url(node['arcgis']['repository']['server']['s3bucket'], + node['arcgis']['repository']['server']['region']) + end + if !node['arcgis']['repository']['server']['aws_access_key'].empty? aws_access_key_id node['arcgis']['repository']['server']['aws_access_key'] aws_secret_access_key node['arcgis']['repository']['server']['aws_secret_access_key'] end diff --git a/cookbooks/arcgis-repository/recipes/s3files2.rb b/cookbooks/arcgis-repository/recipes/s3files2.rb new file mode 100644 index 0000000..36f32ab --- /dev/null +++ b/cookbooks/arcgis-repository/recipes/s3files2.rb @@ -0,0 +1,60 @@ +# +# Cookbook:: arcgis-repository +# Recipe:: s3files2 +# +# Copyright 2020 Esri +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Create archives directory +directory node['arcgis']['repository']['local_archives'] do + mode '0755' if node['platform'] != 'windows' + recursive true + action :create +end + +node['arcgis']['repository']['files'].each do |filename, props| + # Download the remote file from S3 + s3_bucket = node['arcgis']['repository']['server']['s3bucket'] + s3_region = node['arcgis']['repository']['server']['region'] + s3_key = props['subfolder'].nil? ? filename : ::File.join(props['subfolder'], filename) + path = ::File.join(node['arcgis']['repository']['local_archives'], filename) + + if node['platform'] == 'windows' + keys = if node['arcgis']['repository']['server']['aws_access_key'].empty? + '' # Use IAM role credentials + else + "-AccessKey #{node['arcgis']['repository']['server']['aws_access_key']} " \ + "-SecretKey #{node['arcgis']['repository']['server']['aws_secret_access_key']}" + end + + powershell_script "Download #{filename}" do + code "Read-S3Object -BucketName #{s3_bucket} -Region #{s3_region} -Key #{s3_key} -File #{path} #{keys}" + not_if { ::File.exist?(::File.join(node['arcgis']['repository']['local_archives'], filename)) } + end + else + keys = if node['arcgis']['repository']['server']['aws_access_key'].empty? + {} # Use IAM role credentials + else + {'AWS_ACCESS_KEY_ID' => node['arcgis']['repository']['server']['aws_access_key'], + 'AWS_SECRET_ACCESS_KEY' => node['arcgis']['repository']['server']['aws_secret_access_key']} + end + + execute "Download #{filename}" do + command "aws s3 cp s3://#{s3_bucket}/#{s3_key} #{path} --region #{s3_region}" + environment keys + not_if { ::File.exist?(::File.join(node['arcgis']['repository']['local_archives'], filename)) } + end + end +end diff --git a/cookbooks/arcgis/Berksfile b/cookbooks/arcgis/Berksfile index 7d62e47..05ccfea 100644 --- a/cookbooks/arcgis/Berksfile +++ b/cookbooks/arcgis/Berksfile @@ -10,10 +10,12 @@ group :release do cookbook 'arcgis-enterprise', path: '../arcgis-enterprise' cookbook 'arcgis-geoevent', path: '../arcgis-geoevent' cookbook 'arcgis-notebooks', path: '../arcgis-notebooks' + cookbook 'arcgis-mission', path: '../arcgis-mission' cookbook 'arcgis-insights', path: '../arcgis-insights' cookbook 'arcgis-pro', path: '../arcgis-pro' cookbook 'arcgis-repository', path: '../arcgis-repository' cookbook 'esri-iis', path: '../esri-iis' cookbook 'esri-tomcat', path: '../esri-tomcat' + cookbook 'java', '~> 6.0' cookbook 'apt' end diff --git a/cookbooks/arcgis/CHANGELOG.md b/cookbooks/arcgis/CHANGELOG.md index bda5d4b..4d3b4c4 100644 --- a/cookbooks/arcgis/CHANGELOG.md +++ b/cookbooks/arcgis/CHANGELOG.md @@ -3,6 +3,10 @@ arcgis cookbook CHANGELOG This file is used to list changes made in each version of the arcgis cookbook. +3.6.0 +----- +- Added arcgis-mission cookbook. + 3.5.0 ----- - Added arcgis-notebooks cookbook. diff --git a/cookbooks/arcgis/README.md b/cookbooks/arcgis/README.md index 998d5f2..033b6bc 100644 --- a/cookbooks/arcgis/README.md +++ b/cookbooks/arcgis/README.md @@ -1,7 +1,7 @@ arcgis cookbook =============== -arcgis cookbook is a collection of Chef cookbooks used for ArcGIS configuration management. +arcgis cookbook is a collection of Chef cookbooks for ArcGIS configuration management. ### Dependencies @@ -15,6 +15,7 @@ The following cookbooks are required: * arcgis-pro * arcgis-repository * arcgis-notebooks +* arcgis-mission * esri-iis * esri-tomcat @@ -36,7 +37,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2019 Esri +Copyright 2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/arcgis/metadata.rb b/cookbooks/arcgis/metadata.rb index fe51e06..c1ff9ee 100644 --- a/cookbooks/arcgis/metadata.rb +++ b/cookbooks/arcgis/metadata.rb @@ -4,17 +4,18 @@ license 'Apache 2.0' description 'ArcGIS Chef Cookbooks' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '3.5.0' +version '3.6.0' chef_version '>= 12.6', '< 15.0' if defined? chef_version -depends 'arcgis-desktop', '~> 3.5' +depends 'arcgis-desktop', '~> 3.6' depends 'arcgis-egdb', '~> 1.0' -depends 'arcgis-enterprise', '~> 3.5' -depends 'arcgis-geoevent', '~> 3.5' -depends 'arcgis-notebooks', '~> 3.5' -depends 'arcgis-insights', '~> 3.5' -depends 'arcgis-pro', '~> 3.5' -depends 'arcgis-repository', '~> 3.5' +depends 'arcgis-enterprise', '~> 3.6' +depends 'arcgis-geoevent', '~> 3.6' +depends 'arcgis-notebooks', '~> 3.6' +depends 'arcgis-mission', '~> 3.6' +depends 'arcgis-insights', '~> 3.6' +depends 'arcgis-pro', '~> 3.6' +depends 'arcgis-repository', '~> 3.6' depends 'esri-iis', '~> 0.1' depends 'esri-tomcat', '~> 0.1' diff --git a/cookbooks/esri-tomcat/CHANGELOG.md b/cookbooks/esri-tomcat/CHANGELOG.md index a0538b9..cff0335 100644 --- a/cookbooks/esri-tomcat/CHANGELOG.md +++ b/cookbooks/esri-tomcat/CHANGELOG.md @@ -4,6 +4,10 @@ esri-tomcat cookbook CHANGELOG This file is used to list changes made in each version of the esri-tomcat cookbook. +0.1.7 +----- +- Disabled AJP port connector. + 0.1.6 ----- - Added tarball_path attribute. diff --git a/cookbooks/esri-tomcat/README.md b/cookbooks/esri-tomcat/README.md index b857796..fa5b516 100644 --- a/cookbooks/esri-tomcat/README.md +++ b/cookbooks/esri-tomcat/README.md @@ -15,7 +15,6 @@ Requirements The following cookbooks are required: * tomcat -* java * openssl Attributes @@ -24,16 +23,17 @@ Attributes #### General * `node['tomcat']['version']` = Tomcat version to install. Default is `8.0.33`. -* `node['tomcat']['instance_name']` = Default is `arcgis`. -* `node['tomcat']['instance_path']` = Default is `/opt/tomcat_INSTANCENAME_VERSION`. -* `node['tomcat']['tarball_path']` = Default is `/apache-tomcat-.tar.gz` +* `node['tomcat']['instance_name']` = tomcat instance name. Default is `arcgis`. +* `node['tomcat']['install_path']` = tomcat installation directory. Default is `/opt/tomcat_INSTANCENAME_VERSION`. +* `node['tomcat']['tarball_path']` = tomcat tarball archive path. Default is `/apache-tomcat-.tar.gz`. +* `node['tomcat']['verify_checksum']` = Verify checksum of downloaded tomcat tarball. Default value is `true`. #### SSL/TLS * `node['tomcat']['keystore_file']` = Optional: Path to the keystore file. If not provided, a new file and a self-signed certificate will be created. * `node['tomcat']['keystore_password']` = Optional: Password to the keystore. -* `node['tomcat']['ssl_enabled_protocols']` = Default is `TLSv1.2,TLSv1.1,TLSv1` -* `node['tomcat']['domain_name']` = Default is `Fully Qualified Domain Name` +* `node['tomcat']['ssl_enabled_protocols']` = SSL protocols of HTTPS listener. Default is `TLSv1.2,TLSv1.1,TLSv1`. +* `node['tomcat']['domain_name']` = Domain name for generated self-signed SSL certificate. Default is `Fully Qualified Domain Name`. ## Issues @@ -46,7 +46,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines Licensing --------- -Copyright 2016 Esri +Copyright 2016-2020 Esri Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. diff --git a/cookbooks/esri-tomcat/attributes/default.rb b/cookbooks/esri-tomcat/attributes/default.rb index 9433cca..5298b6d 100644 --- a/cookbooks/esri-tomcat/attributes/default.rb +++ b/cookbooks/esri-tomcat/attributes/default.rb @@ -7,7 +7,7 @@ default['tomcat']['user'] = 'tomcat_' + node['tomcat']['instance_name'] default['tomcat']['group'] = 'tomcat_' + node['tomcat']['instance_name'] -default['tomcat']['ssl_enabled_protocols']='TLSv1.2,TLSv1.1,TLSv1' +default['tomcat']['ssl_enabled_protocols'] ='TLSv1.2,TLSv1.1,TLSv1' default['tomcat']['keystore_file'] = '' if ENV['TOMCAT_KEYSTORE_PASSWORD'].nil? default['tomcat']['keystore_password'] = '' @@ -16,3 +16,4 @@ end default['tomcat']['keystore_type'] = 'PKCS12' default['tomcat']['domain_name'] = node['fqdn'] +default['tomcat']['verify_checksum'] = true diff --git a/cookbooks/esri-tomcat/metadata.rb b/cookbooks/esri-tomcat/metadata.rb index a76828a..530b145 100644 --- a/cookbooks/esri-tomcat/metadata.rb +++ b/cookbooks/esri-tomcat/metadata.rb @@ -4,11 +4,10 @@ license 'Apache 2.0' description 'Installs/Configures esri-tomcat' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.1.6' +version '0.1.7' chef_version '>= 13' depends 'tomcat', '>= 3.2.0' -depends 'java', '~> 4.0' depends 'openssl', '~> 8.5' %w(ubuntu redhat centos).each do |os| diff --git a/cookbooks/esri-tomcat/recipes/install.rb b/cookbooks/esri-tomcat/recipes/install.rb index 787e113..194e88f 100644 --- a/cookbooks/esri-tomcat/recipes/install.rb +++ b/cookbooks/esri-tomcat/recipes/install.rb @@ -4,14 +4,13 @@ # # Copyright (c) 2016 The Authors, All Rights Reserved. -include_recipe 'java' - instance_name = node['tomcat']['instance_name'] tomcat_install instance_name do version node['tomcat']['version'] install_path node['tomcat']['install_path'] tarball_path node['tomcat']['tarball_path'] + verify_checksum node['tomcat']['verify_checksum'] tomcat_user node['tomcat']['user'] tomcat_group node['tomcat']['group'] not_if { ::File.exist?(::File.join(node['tomcat']['install_path'], 'LICENSE')) } diff --git a/cookbooks/esri-tomcat/templates/default/server.xml.erb b/cookbooks/esri-tomcat/templates/default/server.xml.erb index 53f7306..5df0e26 100644 --- a/cookbooks/esri-tomcat/templates/default/server.xml.erb +++ b/cookbooks/esri-tomcat/templates/default/server.xml.erb @@ -88,8 +88,7 @@ --> - - +