Commit 2f82470d authored by Philipp's avatar Philipp

WIP: Adding instance-opcua.jinja.cfg.in in order to request different instance.cfg files.

- Lacking the ability to request nested json files.
- Missing asyncua hence not working
parent 9c4f8c85
[buildout]
parts =
promises
directory
opcua-xml-url
opcua-to-http-gw-service
publish-connection-parameter
switch-softwaretype
opcua
eggs-directory = {{ buildout["eggs-directory"] }}
develop-eggs-directory = {{ buildout["develop-eggs-directory"] }}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[check-port-listening-promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promise}/${:_buildout_section_name_}
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
promise = ${:etc}/promise/
log = ${:var}/log
bin = ${:home}/bin
[instance-parameter]
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
configuration.erp5-url = slapparameter_dict.get('erp5-url')
configuration.erp5-username = slapparameter_dict.get('erp5-username')
configuration.erp5-password = slapparameter_dict.get('erp5-password')
configuration.ipv6-enabled = '1'
configuration.opcua-port = 4840
configuration.ipv6-enabled = '1'
[opcua-xml-url]
recipe = slapos.recipe.build:download
url = https://lab.nexedi.com/Demonkey/osie/raw/philipp_opcua/opcua-to-http-gw/opcua-server-config.xml
offline = false
destination = ${directory:etc}/schema.xml
[opcua-to-http-gw-service]
recipe = slapos.cookbook:wrapper
command-line = {{ interpreter_location }}/py {{ osie_repository_location }}/opcua-to-http-gw/opcua-to-http-gw.py --xml ${opcua-xml-url:destination} --erp5-url ${instance-parameter:configuration.erp5-url} --erp5-username ${instance-parameter:configuration.erp5-username} --erp5-password ${instance-parameter:configuration.erp5-password} --port ${instance-parameter:configuration.opcua-port} --ipv6 ${instance-parameter:ipv6-random} --ipv6-enabled ${instance-parameter:configuration.ipv6-enabled}
wrapper-path = ${directory:service}/opcua-to-http-gw-service
output = $${:wrapper-path}
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[opcua-to-http-gw-listen-promise-ipv6]
<= check-port-listening-promise
hostname = ${instance-parameter:ipv6-random}
port = ${instance-parameter:configuration.opcua-port}
[promises]
recipe =
instance-promises =
${opcua-to-http-gw-listen-promise-ipv6:path}
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = opcua:output
RootSoftwareInstance = $${:default}
[publish-connection-parameter]
recipe = slapos.cookbook:publish
ipv6 = ${instance-parameter:ipv6-random}
[opcua]
recipe = slapos.recipe.template:jinja2
url = ${instance-opcua:output}
output = $${buildout:directory}/instance-opcua.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
key parameter_dict slap-configuration:configuration
jsonkey default_parameter_dict :default-parameters
key ipv6_random slap-configuration:ipv6-random
key ipv4_random slap-configuration:ipv4-random
import os os
import json json
# todo check variable names
# todo check logic of variable groupings
# todo check if variable names are accessed in nested version
# todo add missing variables as input for the opcua-to-http-gw.py
default-parameters =
{
"ipv6-enabled": "1",
"ipv4-enabled": "0",
"opcua-server-bool": "False",
"opcua-client-bool": "True",
"instance-service-name": "opcua-to-http-gw",
"opcua-to-http-gw-url": "",
"erp5-url": "",
"erp5-username": "zope",
"erp5-password": "",
"endpoint-for-opcua-client-ipv4": "",
"endpoint-for-opcua-client-ipv6": "",
"application-uri": "Powerfuse_DataConnect",
"opcua-port}": "4880",
"erp5-site-arguments.ERP5_REQUEST_API": "ERP5Site_handleOPCUARequest_data_stream",
"vialogin-bool": "True",
"username": "",
"pasword": "",
"request-api-interval-bool": "False",
"ERP5_REQUEST_API_INTERVAL": "30",
"monitoring-bool": "False",
"read-backend-bool": "False",
"vialogin-bool": "True",
"opcua-xml-url": ""
}
\ No newline at end of file
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