Commit 166c30b4 authored by Ivan Tyagov's avatar Ivan Tyagov

Cleanup.

parent dbc0f387
...@@ -3,7 +3,7 @@ filename = instance-modbus.cfg.in ...@@ -3,7 +3,7 @@ filename = instance-modbus.cfg.in
md5sum = 8637c6b714a0bb9f27c86f3928049b98 md5sum = 8637c6b714a0bb9f27c86f3928049b98
filename = instance-opc-ua.cfg.in filename = instance-opc-ua.cfg.in
md5sum = 9edc884287844d3b7182eeebbbe11285 md5sum = 2b9473020abf55ebd7cefbac81f705a9
filename = instance-opc-ua-virtual.cfg.in filename = instance-opc-ua-virtual.cfg.in
md5sum = 29ca37d2a24f613a31d9fecdca2dd9a9 md5sum = 27c8a7f3052c52cfcb7fd3343637cc5c
...@@ -9,9 +9,6 @@ parts = ...@@ -9,9 +9,6 @@ parts =
publish-connection-parameter publish-connection-parameter
coupler-opc-ua coupler-opc-ua
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
# Always the same.
eggs-directory = {{ buildout['eggs-directory'] }} eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }} develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true offline = true
...@@ -19,20 +16,12 @@ extends = {{ template_monitor }} ...@@ -19,20 +16,12 @@ extends = {{ template_monitor }}
[coupler-opc-ua] [coupler-opc-ua]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
# start with defaults
command-line = command-line =
{{ buildout['bin-directory'] }}/server -d ${instance-parameter:configuration.coupler_block_device} -s ${instance-parameter:configuration.coupler_i2c_slave_list} -m 1 -p ${instance-parameter:configuration.opc_ua_port} -u ${instance-parameter:configuration.username} -w ${instance-parameter:configuration.password} {{ buildout['bin-directory'] }}/server -d ${instance-parameter:configuration.coupler_block_device} -s ${instance-parameter:configuration.coupler_i2c_slave_list} -m 1 -p ${instance-parameter:configuration.opc_ua_port} -u ${instance-parameter:configuration.username} -w ${instance-parameter:configuration.password}
wrapper-path = ${directory:service}/coupler-opc-ua-virtual wrapper-path = ${directory:service}/coupler-opc-ua-virtual
[instance-parameter] [instance-parameter]
# 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}
...@@ -42,18 +31,10 @@ cert = ${slap-connection:cert-file} ...@@ -42,18 +31,10 @@ cert = ${slap-connection:cert-file}
configuration.coupler_block_device = /dev/i2c-1 configuration.coupler_block_device = /dev/i2c-1
configuration.coupler_i2c_slave_list = 0x58 configuration.coupler_i2c_slave_list = 0x58
# Define default parameter(s) that will be used later, in case user didn't
# specify it.
# All possible parameters should have a default.
# 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.
configuration.interface = 0.0.0.0 configuration.interface = 0.0.0.0
configuration.opc_ua_port = 4840 configuration.opc_ua_port = 4840
configuration.username = configuration.username =
configuration.password = configuration.password =
# 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).
# Create all needed directories, depending on your needs # Create all needed directories, depending on your needs
[directory] [directory]
...@@ -61,16 +42,10 @@ recipe = slapos.cookbook:mkdirectory ...@@ -61,16 +42,10 @@ recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory} home = ${buildout:directory}
etc = ${:home}/etc etc = ${:home}/etc
var = ${:home}/var var = ${:home}/var
# Executables put here will be started but not monitored (for startup scripts)
script = ${:etc}/run/ script = ${:etc}/run/
# Executables put here will be started and monitored (for daemons)
service = ${:etc}/service service = ${:etc}/service
# Path of the log directory used by our service (see [helloweb])
log = ${:var}/log log = ${:var}/log
# Publish all the parameters needed for the user to connect to the instance.
# It can be anything: URL(s), password(s), or arbitrary parameters.
# Here we'll just echo back the entered name as instance parameter
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
opc_ua_port = ${instance-parameter:configuration.opc_ua_port} opc_ua_port = ${instance-parameter:configuration.opc_ua_port}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment