Introducing Domino One-Touch JSON templating - Without manual JSON editing :-)
Daniel Nashed – 30 December 2021 11:42:19
Domino One-Touch setup with JSON format is really great stuff -- I love it since day one.
But it might be a bit difficult to edit for many admins -- Even if you use an prepared template, you have to edit the JSON file in an editor to specify server name, etc.
Using variables ala Helm or Ansible makes a lot of sense and if you leverage existing JSON config templates, you might get away with not editing JSON at all.
Both using the {{ Variable }} syntax. But I am more used to the shell variable syntax: ${Variable}. So I implemented both.
I already uploaed the script and updated JSON configuration files to the develop branch of our GitHub repository as part of the start script.
Example:
https://github.com/IBM/domino-docker/blob/develop/start_script/OneTouchSetup/first_server.json
The script itself can be also used for any kind of variable replacement. It checks template variables and prompts for a value -- see example below.
If a variable is already set in the environment, the value is used as default prompt.
On purpose all place-holders match the One-Touch environment variable names.
If you source in an existing configuration, those variables are automatically used.
And sticking with the existing standard variables makes it more consistent.
Example config extract with both syntax options:
{
"serverSetup": {
"server": {
"type": "first",
"name": "{{ SERVERSETUP_SERVER_NAME }}",
"domainName": "{{ SERVERSETUP_SERVER_DOMAINNAME }}",
"title": "$(SERVERSETUP_SERVER_TITLE)",
"serverTasks": "replica,router,update,amgr,adminp,http,certmgr"
},
...
Running the start script config command now automatically uses the new functionality when specifying JSON. The result is a ready to use JSON file.
This is just a simple way to replace template variables. In future it would be a good idea to have a configuration database to build ready to use special tailored configurations.
But I think this is already really helpful to have. Not only for workshops and lab environments..
The script itself is surprisingly short including all checks --> https://github.com/IBM/domino-docker/blob/develop/start_script/extra/domCfgJSON.sh
-- Daniel
Example setup:
domino setup json 1
Using Domino config File [/etc/sysconfig/rc_domino_config]
SERVER_NAME: notes.nashcom.de
SERVER_DOMAINNAME: NashCom
SERVER_TITLE: Demo Server One Touch
NETWORK_HOSTNAME: notes.nashcom.de
ORG_ORGNAME: NashCom
ORG_CERTIFIERPASSWORD: xxx
ADMIN_FIRSTNAME: Daniel
ADMIN_LASTNAME: Nashed
ADMIN_PASSWORD: xxx
ADMIN_IDFILEPATH: admin.id
--------------------------------------------------------------------------------
One-Touch Domino Validation
--------------------------------------------------------------------------------
[3909618:000002-00007F687C6B60C0] Success - /local/notesdata/DominoAutoConfig.json is valid with respect to schema dominoOneTouchSetup.schema.json
--------------------------------------------------------------------------------
- Comments [0]