# Fetch arbitrary parameters defined by the user in SlapOS Master for his instance.
# We use the slapconfiguration recipe with a few parameters (partition id,
# computer id, certificate, etc).
# It will then authenticate to SlapOS Master and fetch the instance parameters.
# The parameters are accessible from $${instance-parameter:configuration.name-of-parameter}
# Always the same. Just copy/paste.
# See docstring of slapos.cookbook:slapconfiguration for more information.
recipe = slapos.cookbook:slapconfiguration
recipe = slapos.cookbook:slapconfiguration
computer = $${slap_connection:computer_id}
computer = $${slap-connection:computer-id}
partition = $${slap_connection:partition_id}
partition = $${slap-connection:partition-id}
url = $${slap_connection:server_url}
url = $${slap-connection:server-url}
key = $${slap_connection:key_file}
key = $${slap-connection:key-file}
cert = $${slap_connection:cert_file}
cert = $${slap-connection:cert-file}
# Define default parameter(s) that will be used later, in case user didn't
# Softwaretype default would request softwaretype webservice
# specify it.
[switch-softwaretype]
# All possible parameters should have a default.
recipe = slapos.cookbook:softwaretype
# In our use case, we are expecting from the user to specify one (optional) parameter: "name". We put the default value here if he doesn't specify it, so that it doesn't crash.
default = ${instance-default:output}
configuration.name = John Doe
webservice = ${instance-webservice:output}
# If our use case requires that the user can specify a mail address so that his instance can mail to him (for example), we can do:
# configuration.mail-address =
# If the user doesn't specify it, it won't break and the recipe can handle it (i.e don't send any mail for example).
# Add parameter title to be provided by user/developer, would be None in case user fails to give anything
configuration.title =
configuration.repetition_number =
configuration.port = 7777
# Create all needed directories, depending on your needs
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
etc = $${:home}/etc
var = $${:home}/var
bin = $${:home}/bin
srv = $${:home}/srv
# Executables put here will be started but not monitored (for startup scripts)
script = $${:etc}/run/
# Executables put here will be started and monitored (for daemons)
service = $${:etc}/service
# Executables put here will be launched after buildout has completed to see
# if instance is running
promise = $${:etc}/promise/
# Path of the log directory used by our service (see [hello-world])