On this page:

3.7Pre-Seeding Configuration and Data

 

If you wish to completely automate the provisioning of new environments, you may wish to have various elements of your configuration automatically "pre-seeded" into your system the first time it starts up.

This page describes strategies for achieving various pre-seeded configurations.

3.7.1Pre-Seeding Module Configuration

 

Each Smile CDR module type has a set of configuration elements that it supports. These are the properties that are visible in the Node Configuration Properties File.

The Fetch Config: Module Property File operation on the JSON Admin Endpoint can be used to export the complete configuration for an existing node. Note that this export will include all settings except passwords and credentials. These will need to be added manually.

If you wish to create new environments based on an existing environment, this exported file is an easy way to get started. You may wish to also configure the Module Property Source to PROPERTIES, meaning that the values in the file should always take precedence over values in the configuration database.

3.7.2Pre-Seeding Users

 

If you are using the Local Inbound Security module, it is helpful to have a set of default users added to the user database by default. Typically this would include an admin user that can be used to create other users, as well as an anonymous user whose credentials will be used for anonymous requests.

The Users Seed File property on the Local Inbound Security module should be used for this purpose. The Smile CDR default configuration includes this setting, and will seed two users: admin and anonymous.

In a Node Configuration Properties File there should then be a line similar to the following:

module.local_security.config.seed.users.file  =classpath:/config_seeding/users.json

The file contents should be a UserDetailsList object. A sample is shipped in the default Smile CDR configuration in the path: classes/config_seeding/users.json.

The JSON Admin API Search For Users operation uses this same format as its output, so it can be helpful in producing a seed file.

3.7.3Pre-Seeding OpenID Connect Servers

 

If you are using the SMART Inbound Security or SMART Outbound Security modules, you can have OpenID Connect Server definitions (such as the ones you would create in the Web Admin Console) automatically seed into a newly created environment by using the OpenID Connect Server Pre-Seed File property.

In a Node Configuration Properties File this should appear as a line similar to the following:

module.MODULE_ID.config.seed_servers.file  =classpath:/config_seeding/oidc-servers.json

The file contents should be a OAuth2Servers object. A sample is shipped in the default Smile CDR configuration in the path: classes/config_seeding/oidc-servers.json.

The JSON Admin API Fetch All OpenID Connect Server Definitions operation uses this same format as its output, so it can be helpful in producing a seed file.

3.7.4Pre-Seeding OpenID Connect Clients

 

If you are using the SMART Outbound Security module, you can have OpenID Connect Client definitions (such as the ones you would create in the Web Admin Console) automatically seed into a newly created environment by using the OpenID Connect Client Pre-Seed File property.

In a Node Configuration Properties File this should appear as a line similar to the following:

module.MODULE_ID.config.seed_clients.file  =classpath:/config_seeding/oidc-clients.json

The file contents should be a OAuth2Clients object. A sample is shipped in the default Smile CDR configuration in the path: classes/config_seeding/oidc-clients.json.

The JSON Admin API Fetch All OpenID Connect Client Definitions operation uses this same format as its output, so it can be helpful in producing a seed file.