Esri / arcgis-cookbook

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

Chef run does not set Server's WebContextURL when specified in role json file #275

Closed anandak closed 3 years ago

anandak commented 3 years ago

We recently setup a single machine base deployment in HA using the sample roles provided, i.e., arcgis-enterprise-windows-ha-primary.json and arcgis-enterprise-windows-ha-secondary.json

We had provided urls for both ['arcgis']['portal']['web_context_url'] and ['arcgis']['server']['web_context_url'] in both role json files, but only the portal seems to reflect that.

The admin API of Portal -> system -> properties -> shows the url that we specified, howwever the admin API of Server -> System -> properties is empty { }, and we checked this in both server nodes.

It seemed like the attribute ['arcgis']['server']['web_context_url'] was not honored during the chef run, or am I missing something?

cameronkroeker commented 3 years ago

Hi @anandak ,

The ['arcgis']['server']['web_context_url'] is only used for the federation recipe. More specifically, its used to set the federation Services URL:

https://github.com/Esri/arcgis-cookbook/blob/ae704a00cef52d34057569e36214f8669d539266/cookbooks/arcgis-enterprise/recipes/federation.rb#L24

Instead you will need to use ['arcgis']['server']['system_properties'] attribute to define the system properties WebContextURL. For example:

{
    "arcgis": {
        "version": "10.8.1",
        "server": {
            "private_url": "https://domain.com:6443/arcgis",
            "web_context_url": "https://domain.com/server",
            "wa_name": "server",
            "system_properties": {
                "WebContextURL": "https://domain.com/server"
            }
        }
    "run_list": [
        "recipe[arcgis-enterprise::server]"
    ]
}

In v3.6.1 and below, this gets set during the create_site action, which means if the site has already been created then it will be skipped. So I recommend defining this attribute prior to creating the site. However, we will improve this in the next release of the cookbook, moving it out of the create_site action, and into its own system_properties action so that if the site already exists the system properties can still be updated.

https://github.com/Esri/arcgis-cookbook/blob/ae704a00cef52d34057569e36214f8669d539266/cookbooks/arcgis-enterprise/recipes/server.rb#L94

Thanks, Cameron K.

anandak commented 3 years ago

Thank you! this helps.