scissor-project / open-scissor

OpenSCISSOR provisioning and orchestration
Apache License 2.0
2 stars 0 forks source link

Dynamically validate deployment script parameters #46

Closed ferrarimarco closed 6 years ago

ferrarimarco commented 6 years ago

Description of the Change

With this change we implement runtime validation for the deployment script parameters array.

The validation procedure runs two checks:

  1. Each array element must not be empty
  2. The array size should be what we expect

Alternate Designs

N/A

Benefits

  1. Provisioning parameters are dynamically checked for consistency
  2. Common parameters (VM IPv4 address and hostname) are not repeated for each VM

Possible Drawbacks

N/A

Applicable Issues

45

Output of vagrant up kafka-idmef-converter:

==> kafka-idmef-converter: Running provisioner: shell...
    kafka-idmef-converter: Running: /tmp/vagrant-shell20171206-21067-11d3lsy.sh
    kafka-idmef-converter: + IFS='\n    '
    kafka-idmef-converter: + kafka_server=10.10.1.55
    kafka-idmef-converter: + kafka_port=9092
    kafka-idmef-converter: + consumer_topics='cam, env, net, scada'
    kafka-idmef-converter: + producer_topic=IDMEF
    kafka-idmef-converter: + sed -e s/__KAFKA_SERVER__/10.10.1.55/g -e s/__KAFKA_PORT__/9092/g -e 's/__CONSUMER_TOPICS__/cam, env, net, scada/g' -e s/__PRODUCER_TOPIC__/IDMEF/g -i /etc/converter.conf
    kafka-idmef-converter: + systemctl restart converter