You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by chris snow <ch...@gmail.com> on 2014/04/20 12:22:01 UTC

parametrised config.sh cartridge script for 4.0?

It is probably too late to make config.sh parameter driven.

Instead, would it ok for me to add an expect script for 4.0 that takes
parameters and then passes the parameters to config.sh?

That way, we don't have to risk breaking config.sh, but it makes it
easier for me to automate cartridge setup on the vagrant environment.
An example expect script:

-----
#!/bin/bin/expect

set service_name [lindex $argv 0];
set puppet_master_ip [lindex $argv 1];
set puppet_master_hostname [lindex $argv 2];

spawn /root/bin/config.sh
expect "This script will install and configure puppet agent, do you
want to continue *"
send "y\r"
expect "Please provide stratos service-name:"
send "$service_name\r"
expect "Please provide puppet master IP:"
send "$puppet_master_ip\r"
expect "Please provide puppet master hostname *"
send "$puppet_master_hostname\r"
expect eof
-----