Skip to content

Commit

Permalink
Merge pull request #259 from Esri/v3.6.1
Browse files Browse the repository at this point in the history
Release v3.6.1
  • Loading branch information
cameronkroeker committed Nov 3, 2020
2 parents 36cf097 + acf3071 commit ae704a0
Show file tree
Hide file tree
Showing 44 changed files with 248 additions and 50 deletions.
4 changes: 4 additions & 0 deletions cookbooks/arcgis-desktop/CHANGELOG.md
Expand Up @@ -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.1
-----
- Added support for Chef Client 15.

3.6.0
-----
- Added support for ArcGIS Desktop 10.8.1 and ArcGIS License Manager 2020.0.
Expand Down
3 changes: 2 additions & 1 deletion cookbooks/arcgis-desktop/metadata.rb
Expand Up @@ -4,7 +4,8 @@
license 'Apache 2.0'
description 'Installs and configures ArcGIS Desktop and ArcGIS License Manager'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '3.6.0'
version '3.6.1'
chef_version '>= 13.0' if defined? chef_version

depends 'arcgis-repository', '~> 3.6'
depends 'windows', '~> 5.3'
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/arcgis-egdb/metadata.rb
Expand Up @@ -5,7 +5,7 @@
description 'Creates enterprise geodatabases in SQL Server or PostgreSQL DBMS and registers them with ArcGIS Server.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.1'
chef_version '>= 12.6', '< 15.0' if defined? chef_version
chef_version '>= 13.0' if defined? chef_version

depends 'arcgis-enterprise', '~> 3.4'

Expand Down
4 changes: 4 additions & 0 deletions cookbooks/arcgis-enterprise/CHANGELOG.md
Expand Up @@ -3,6 +3,10 @@ arcgis-enterprise cookbook CHANGELOG

This file is used to list changes made in each version of the arcgis-enterprise cookbook.

3.6.1
-----
- Added support for Chef Client 15.

3.6.0
-----
- Added support for ArcGIS Enterprise 10.8.1.
Expand Down
6 changes: 5 additions & 1 deletion cookbooks/arcgis-enterprise/README.md
Expand Up @@ -363,7 +363,11 @@ Uninstalls ArcGIS Server, Portal for ArcGIS, ArcGIS Data Store, and ArcGIS Web A

### arcgis-enterprise::unregister_machine

Unregisters server machine from the ArcGIS Server site.
Unregisters the local server machine from the ArcGIS Server site.

### arcgis-enterprise::unregister_machines

Unregisters from the ArcGIS Server site all the server machines except for the local.

### arcgis-enterprise::unregister_stopped_machines

Expand Down
4 changes: 3 additions & 1 deletion cookbooks/arcgis-enterprise/attributes/datasources.rb
Expand Up @@ -26,4 +26,6 @@
default['arcgis']['datasources'].tap do |datasource|
datasource['block_data_copy'] = false
datasource['ags_connection_file'] = File.join(node['arcgis']['misc']['scripts_dir'], 'AdminConnection.ags')
end
datasource['sde_files']['files'] = {}
datasource['server_config_url'] = "https://#{node['fqdn']}:6443/arcgis"
end
17 changes: 17 additions & 0 deletions cookbooks/arcgis-enterprise/libraries/server_admin_client.rb
Expand Up @@ -805,6 +805,23 @@ def assign_privileges(rolename, privilege)
validate_response(response)
end

def machines
request = Net::HTTP::Post.new(URI.parse(@server_url +
"/admin/machines").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)

JSON.parse(response.body)['machines']
end

# TODO: Support setting webServerMaxHeapSize, appServerMaxHeapSize, and
# other machine properties here.
def set_machine_properties(machine_name, soc_max_heap_size)
Expand Down
5 changes: 3 additions & 2 deletions cookbooks/arcgis-enterprise/metadata.rb
Expand Up @@ -4,8 +4,8 @@
license 'Apache 2.0'
description 'Installs and configures ArcGIS Enterprise'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '3.6.0'
chef_version '>= 13.0', '< 15.0' if defined? chef_version
version '3.6.1'
chef_version '>= 13.0' if defined? chef_version

depends 'arcgis-repository', '~> 3.6'
depends 'hostsfile', '~> 3.0'
Expand Down Expand Up @@ -56,6 +56,7 @@
recipe 'arcgis-enterprise::stop_machine', 'Stops server machine in the ArcGIS Server site'
recipe 'arcgis-enterprise::system', 'System requirements'
recipe 'arcgis-enterprise::unregister_machine', 'Unregisters server machine from the ArcGIS Server site'
recipe 'arcgis-enterprise::unregister_machines', 'Unregisters from the ArcGIS Server site all the server machines except for the local machine'
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'
Expand Down
33 changes: 33 additions & 0 deletions cookbooks/arcgis-enterprise/providers/server.rb
Expand Up @@ -830,6 +830,39 @@
end
end

action :unregister_machines 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 all server machines except the local machine...')

machines = admin_client.machines
local_machine_name = admin_client.local_machine_name

machines.each do |machine|
if machine['machineName'] != local_machine_name
admin_client.unregister_machine(machine['machineName'])
end
end

new_resource.updated_by_last_action(true)
rescue Exception => e
Chef::Log.error "Failed to unregister server machines. " + e.message
raise e
end
end

action :block_data_copy do
begin
admin_client = ArcGIS::ServerAdminClient.new(@new_resource.server_url,
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/arcgis-enterprise/recipes/install_portal_wa.rb
Expand Up @@ -24,7 +24,7 @@
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']['server']['wa_name'],
not_if { !Utils.wa_product_code(node['arcgis']['portal']['wa_name'],
[node['arcgis']['web_adaptor']['product_code'],
node['arcgis']['web_adaptor']['product_code2']]).nil? }
else
Expand Down
29 changes: 29 additions & 0 deletions cookbooks/arcgis-enterprise/recipes/unregister_machines.rb
@@ -0,0 +1,29 @@
#
# Cookbook Name:: arcgis-enterprise
# Recipe:: unregister_machines
#
# 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 server machines' 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_machines
end
3 changes: 2 additions & 1 deletion cookbooks/arcgis-enterprise/resources/server.rb
Expand Up @@ -21,7 +21,8 @@
:configure_autostart, :authorize, :create_site, :join_site,
: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,
:stop_machine, :unregister_machine, :unregister_machines,
:unregister_stopped_machines, :block_data_copy,
:configure_security_protocol, :unregister_web_adaptors

attribute :setup_archive, :kind_of => String
Expand Down
4 changes: 4 additions & 0 deletions cookbooks/arcgis-geoevent/CHANGELOG.md
Expand Up @@ -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.1
-----
- Added support for Chef Client 15.

3.6.0
-----
- Added support for ArcGIS GeoEvent Server 10.8.1.
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/arcgis-geoevent/metadata.rb
Expand Up @@ -4,8 +4,8 @@
license 'Apache 2.0'
description 'Installs and configures ArcGIS GeoEvent Server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '3.6.0'
chef_version '>= 13.0', '< 15.0' if defined? chef_version
version '3.6.1'
chef_version '>= 13.0' if defined? chef_version

depends 'arcgis-enterprise', '~> 3.6'
depends 'arcgis-repository', '~> 3.6'
Expand Down
4 changes: 4 additions & 0 deletions cookbooks/arcgis-insights/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

This file is used to list changes made in each version of the arcgis-insights cookbook.

## 3.6.1
- Added support for Chef Client 15.
- Added support for ArcGIS Insights 2020.2/2020.3.

## 3.6.0
- Added support for Insights for ArcGIS 3.4/3.4.1/2020.1

Expand Down
11 changes: 8 additions & 3 deletions cookbooks/arcgis-insights/README.md
Expand Up @@ -20,6 +20,8 @@ Requirements
* 3.4
* 3.4.1
* 2020.1
* 2020.2
* 2020.3

### Platforms

Expand All @@ -31,6 +33,7 @@ Requirements
* Rhel 6.5, 7.0

### Dependencies

The following cookbooks are required:

* arcgis-enterprise
Expand All @@ -39,19 +42,21 @@ The following cookbooks are required:
Attributes
----------

* `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 <version>\Insights\setup.exe` on Windows and `/opt/arcgis/Insights/Insights-Setup.sh` on Linux.
* `node['arcgis']['insights']['version']` = Insights for ArcGIS version. Default version is `2020.3`
* `node['arcgis']['insights']['setup_archive']` = Path to Insights for ArcGIS version setup archive. Default value depends on `node['arcgis']['insights']['version']` attribute value.
* `node['arcgis']['insights']['setup']` = The location of Insights for ArcGIS setup executable. Default location is `%USERPROFILE%\Documents\ArcGIS Insights <version>\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.


Recipes
-------

### arcgis-insights::default

Installs and configures Insights for ArcGIS.

### arcgis-insights::uninstall

Uninstalls Insights for ArcGIS.

Usage
Expand Down
22 changes: 21 additions & 1 deletion cookbooks/arcgis-insights/attributes/default.rb
Expand Up @@ -20,18 +20,32 @@
include_attribute 'arcgis-enterprise'

default['arcgis']['insights'].tap do |insights|
insights['version'] = '2020.1'
insights['version'] = '2020.3'

case node['platform']
when 'windows'
insights['setup'] = node['arcgis']['repository']['setups'] + '\\Insights for ArcGIS ' +
node['arcgis']['insights']['version'] + '\\Insights\\Setup.exe'

case node['arcgis']['insights']['version']
when '2020.3'
insights['product_code'] = '{A423A99B-D785-49F9-B91B-E39457B6B6D5}'
insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'],
'ArcGIS_Insights_Windows_2020_3_176134.exe')
insights['setup'] = node['arcgis']['repository']['setups'] + '\\ArcGIS Insights Windows ' +
node['arcgis']['insights']['version'] + '\\Insights\\Setup.exe'
when '2020.2'
insights['product_code'] = '{A51F92FD-3A9D-467C-B29F-74759CB85E0A}'
insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'],
'ArcGIS_Insights_Windows_2020_2_175863.exe')
insights['setup'] = node['arcgis']['repository']['setups'] + '\\ArcGIS Insights ' +
node['arcgis']['insights']['version'] + '\\Insights\\Setup.exe'
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')
insights['setup'] = node['arcgis']['repository']['setups'] + '\\ArcGIS Insights ' +
node['arcgis']['insights']['version'] + '\\Insights\\Setup.exe'
when '3.4.1'
insights['product_code'] = '{F3B91D92-3DD8-4F0B-B43B-6F9DA2C1830A}'
insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'],
Expand Down Expand Up @@ -89,6 +103,12 @@
'Insights/Insights-Setup.sh')

case node['arcgis']['insights']['version']
when '2020.3'
insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'],
'ArcGIS_Insights_Linux_2020_3_176135.tar.gz')
when '2020.2'
insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'],
'ArcGIS_Insights_Linux_2020_2_175864.tar.gz')
when '2020.1'
insights['setup_archive'] = ::File.join(node['arcgis']['repository']['archives'],
'ArcGIS_Insights_Linux_2020_1_173527.tar.gz')
Expand Down
3 changes: 2 additions & 1 deletion cookbooks/arcgis-insights/metadata.rb
Expand Up @@ -4,7 +4,8 @@
license 'Apache 2.0'
description 'Installs and configures Insights for ArcGIS'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '3.6.0'
version '3.6.1'
chef_version '>= 13.0' if defined? chef_version

depends 'arcgis-enterprise', '~> 3.6'
depends 'arcgis-repository', '~> 3.6'
Expand Down
25 changes: 23 additions & 2 deletions cookbooks/arcgis-insights/providers/insights.rb
Expand Up @@ -2,7 +2,7 @@
# Cookbook Name:: arcgis-insights
# Provider:: insights
#
# Copyright 2017 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.
Expand Down Expand Up @@ -61,6 +61,17 @@
{ :timeout => 3600 })
cmd.run_command
cmd.error!

# 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)
Expand Down Expand Up @@ -98,8 +109,18 @@
cmd.run_command
cmd.error!
end

# 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

0 comments on commit ae704a0

Please sign in to comment.