How do I provision a tenant?

Table of Contents

The tenant stage on its own — the middle stage of a full system provision, for when the system and tenant already exist and you only need to provision the logged-in bootstrap-mode tenant. Tangled into the library as tenant_provision.ores.

1. Question

How do I add a tenant to a system that is already set up?

2. Answer

Log in as an administrator — the tenant is created under the tenant that administrator works in, which is why the first tenant is created by bootstrap setup and every one after it by this command. Name the tenant, its hostname, and its first administrator's password, and name the starting point the tenant is built from with --profile: the starting point's own steps then publish the tenant's reference data, import its legal entities, and provision its parties, server-side. The command follows the run to its end.

Every tenant after the first is created the way the first one is, so this is the same request bootstrap setup sends once the installation has an administrator.

connect $ORES_NATS_URL
login super_admin Secure-Password-123
provision tenant --tenant-code example --tenant-name "Example Corp" --tenant-hostname example --tenant-admin-password Secure-Password-123 --profile empty_operational --param counterparty_size=small
logout
exit
./ores.shell ${log_args} ${connect_args} << 'EOF'
<<tenant-provision>>
EOF

3. Script

projects/ores.shell/scripts/library/provisioning/tenant_provision.ores — generated from this recipe by compass build --direct tangle_shell_scripts (do not edit the .ores by hand).

4. Tested by

Manual: compass shell -f tenant_provision.ores after the system stage.

5. See also

Emacs 29.3 (Org mode 9.6.15)