Operations

Automate Configuration Properties during Deployment (Ansible)

You can deploy SAS Viya with configuration values that are customized to your site by running your Ansible playbook with sitedefault.yml. Using sitedefault.yml, enables you to provision multiple machines in the same manner, and prevents you from having to modify configuration values with an administration interface after deployment.

Note: It is extremely important that the initial values applied with sitedefault.yml are correct. After you specify a value with sitedefault.yml, you cannot re-run sitedefault.yml to change that value. You can re-run sitedefault.yml only to specify properties that have not already been specified. To change properties set with sitedefault.yml, you must use the sas-bootstrap-config CLI directly or use another administration interface, such as SAS Environment Manager.

To specify configuration values using sitedefault.yml, follow these steps:

  1. Sign on to your Ansible controller with administrator privileges and locate the file, /playbook/roles/consul/files/sitedefault_sample.yml.
  2. Make a copy of sitedefault_sample.yml and name the copy, sitedefault.yml.
  3. Using a text editor, open sitedefault.yml and add values that are valid for your site.

    Configuration values that apply to all services should be nested under config: / application:. Values that apply only to a specific service should be nested under config: / service_name:.

    For information about the LDAP properties used in sitedefault.yml, see sas.identities.providers.ldap.

    For information about the all the properties that can be used in sitedefault.yml, see Configuration Properties: Reference (Services).

    CAUTION

    Some properties require passwords. If properties with passwords are specified in sitedefault.yml, you must secure the file appropriately. If you chose not to supply the properties in sitedefault.yml, then you can enter them using SAS Environment Manager. (Sign in to SAS Environment Manager as sasboot and follow the instructions in Configure the Connection to LDAP in SAS Viya for Linux: Deployment Guide.)

  4. When you are finished, save sitedefault.yml and make sure that it resides in the /playbook/roles/consul/files directory of the playbook.
  5. Run your Ansible playbook. Running the playbook using the site.yml file checks for sitedefault.yml, and uses those settings if the file is present.

    Here is an example:

    ansible-playbook site.yml

    For a complete list of playbook commands, see Deploy the Software in SAS Viya for Linux: Deployment Guide.

  6. After the playbook is run, verify that the configuration values are successfully loaded into the configuration server by performing the following steps:
    1. Verify that a copy of sitedefault.yml resides in /viya/config/etc/consul.d/default/.
    2. Verify that config-kv-bulkload-sitedefault.json resides in /viya/config/etc/consul.d/.
    3. View the configuration properties for a configuration definition such as, SAS Logon Manager, in SAS Environment Manager to verify that the specified values are present.

      For more information, follow the first five steps in Edit Configuration Instances.

Customizing Configuration for All Java Services

You can use global configuration files to customize the start-up options for all Java services on a Linux deployment.

Follow these steps:

  1. In the /opt/sas/viya/config/etc/sysconfig/sas-javaesntl/ directory, create a file whose name starts with sas-java-services. For example, for a monitoring framework named AppMonitor, the configuration file could be named sas-java-services-appmon.
    Note: Options are applied in all of the files in the /opt/sas/viya/config/etc/sysconfig/sas-javaesntl/ directory whose filenames begin with sas-java-services, regardless of the rest of the filename. If the directory contains renamed old files or work files, the options in those files will be applied as well.
  2. In the configuration file, add configuration statements for each option that you want to specify. This is the format of each configuration statement:
    export JAVA_OPTION_<variable_name>=<JVM_command_line_option>

    Each JAVA_OPTION_<variable_name value must be globally unique. Do not use names that might conflict with names in other configuration files.

    The JVM_command_line_option must be enclosed in double quotation marks if the command contains blanks.

    For example, a monitoring framework named AppMonitor requires multiple JVM start-up options. The file /opt/sas/viya/config/etc/sysconfig/sas-javaesntl/sas-java-services-appmon could contain these options:

    export JAVA_OPTION_APPMON_AGENT=-javaagent:/opt/appmon/javaagent.jar
        export JAVA_OPTION_APPMON_CONTROLLER_HOST=-Daappmonitor.controller.hostName=eval.appmonitor.com
        export JAVA_OPTION_APPMON_CONTROLLER_PORT=-Dappmonitor.controller.port=443
        export JAVA_OPTION_APPMON_CONTROLLER_SSL=-Dappmonitor.controller.ssl.enabled=true
        export JAVA_OPTION_APPMON_AGENT_NODE=-Dappmonitor.agent.nodeName=viya1
        export JAVA_OPTION_APPMON_APPNAME=-Dappmonitor.agent.applicationName=prod-vdmml
        export JAVA_OPTION_APPMON_PROXY_HOST=-Dappmonitor.http.proxyHost=inet.abc.com
        export JAVA_OPTION_APPMON_PROXY_PORT=-Dappmonitor.http.proxyPort=808
  3. Restart one service and inspect the service log to confirm that all options are applied as expected.
  4. Modify the configuration file and restart. Repeat until all options are applied correctly.
  5. After all options are correct, restart all services for the new options to take effect.

CAUTION

Global configuration should be used carefully. Global options, especially invasive options like Java agents, can have a significant impact on the operation of a SAS Viya system. New options should be carefully tested and validated before deploying them to production systems.

Last updated: May 14, 2025