Use User-Input Template for creating DB config

About this task

If you have to re-use the same database credentials for differents nodes, it is possible to export and import a user input template for create-dbconfig.
Note: If you want to automate the creation of database.conf with different credentials, you could use the script option of the gateway-CLI described Step 3

Procedure

  1. Export an Input-Template for create-dbconfig
    1. Start the CLI
    2. (Optional) To export the template in clear text, enable the plaintemplate option using the command:
      plaintemplate --enable
    3. Export the user input for create-dbconfig using the --export option:
      create-dbconfig --export path/to/template.yml
    4. Fill all the requsted information as described in Performing the initial configuration. The files database.conf and template.yml are create by the CLI
  2. Import an Input-Template for create-dbconfig (optional)
    1. Start the CLI
    2. (Optional) To import the template in clear text, enable the plaintemplate option using the command:
      plaintemplate --enable
    3. Import the user input for create-dbconfig using the --input option
      create-dbconfig --import path/to/template.yml 
    The database.conf file is created using the defined user input of the template.yml.
  3. Use create-dbconfig without user interaction.
    To automatically create a database.conf file with the Gateway-CLI we need to define a script to be passed to the CLI. As precondition we need a created template.yml file to be loaded within the script. To create this template you can use the steps explained in Step 1.
    1. Create a file cli-load-template:
      plaintemplate --enable
      forceoverwrite --enable
      create-dbconfig --import path/to/template.yml 
    2. Execute the gateway-cli
      ./gateway-cli @cli-load-template