Esri / arcgis-cookbook

Chef cookbooks for ArcGIS
Apache License 2.0
300 stars 116 forks source link

Portal install should create content folder #369

Closed ramtechjoe closed 1 year ago

ramtechjoe commented 1 year ago

Hi,

I am wondering why the portal or portal_install does not create the content directory. The server recipe includes

directory node['arcgis']['server']['directories_root'] do
  owner node['arcgis']['run_as_user']
  if node['platform'] != 'windows'
    mode '0700'
  end
  recursive true
  not_if { node['arcgis']['server']['directories_root'].start_with?('\\\\') ||
           node['arcgis']['server']['directories_root'].start_with?('/net/') }
  action :create
end

To create the server shared folder.

The portal recipes do not include a similar create for the portal content folders. This is a bit confusing because with server you just need the share root, but for portal you need to create the full path in advance

Thanks

cameronkroeker commented 1 year ago

Hi @ramtechjoe,

We have attempted to add this logic in the past but wasn't able to get it to work reliably. One of the challenges is with portal on Linux.

On Linux, the default content directory is inside the portal installation directory (/arcgis/portal/usr/arcgisportal/content), and when chef pre-creates the directory it changes the permissions on the installation directory causing portal to not start up successfully after the site is created. We were only able to get it work when the content directory resides outside the install directory, however there isn't a reliable way to determine if the user is passing in a non-default vs default path.

This really isn't an issue on Windows though, because the setup will create it:

CONTENTDIR=<installation location content>

This property allows you to specify the portal's content directory. The location you specify must be a local directory; you cannot choose a shared network directory. This is because the Portal for ArcGIS service is configured to run under the Windows native LocalSystem account by default. The LocalSystem account cannot access network locations. For more information, see [The Portal for ArcGIS account](https://enterprise.arcgis.com/en/portal/11.1/administer/windows/the-portal-for-arcgis-account.htm). If you do not set this property, the default installation location of C:\arcgisportal is used.

https://enterprise.arcgis.com/en/portal/latest/install/windows/silently-installing-portal-for-arcgis.htm#GUID-590EF5CB-BBDA-45B4-A3CB-5FE922B43063

However, the Linux setup does not have such parameter:

https://enterprise.arcgis.com/en/portal/latest/install/linux/silently-installing-portal-for-arcgis.htm#GUID-E4195524-7270-424E-860D-E7E48A96E2B9

If I recall correctly, we even tried to pre-create it before install, but then this caused the install to fail. So for now this is a known limitation, and in the next cookbook release we make note of it in the documentation.

You can use the arcgis-portal-fileserver.json to create the directory prior.

Thanks, Cameron K.

ramtechjoe commented 1 year ago

@cameronkroeker thank you for the detailed explanation. I will look at the fileserver recipe to include as part of future builds

Thanks again. I really appreciate the investment made in chef, it has saved us countless hours and provided a repeatable approach to deployment.