sprinkle-tool / sprinkle

Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
https://github.com/sprinkle-tool/sprinkle
MIT License
1.15k stars 138 forks source link

Answering Prompts When Running Sprinkle - Interactivity Issue #185

Closed AshStuart closed 10 years ago

AshStuart commented 10 years ago

Hi, I'm very very new to Sprinkle and this is probably a very basic point.

As one of the first of the packages, I'm trying to run a package to set up a firewall, and one of the runner commands results in a question which requires a y/n answer.

However, typing y and pressing enter doesn't help and the program stalls at that point infinitely.

The same issue first occurred when I had the sudo come up asking for my password. I bypassed that by setting :run_method sudo.

I am using capistrano for delivery.

I do recall an 'interactive' issue mentioned as having been 'fixed' in one of the issues here but I haven't been able to track down the details. These discussions don't seem to show up on search engines, and I am not sure where else I could look. Apologies if this is the wrong forum, but I'd be grateful for any inputs. Thanks, A

both client and server - ubuntu

[ufw.rb] package :ufw_deny do requires :ufw_core

runner 'ufw logging on' ....

runner 'ufw enable -f'

ufw_deny install sequence: ufw enable for roles: app

--> Running Sprinkle::Installers::Runner for roles: app

* [out :: 190.20.10.113] * [out :: 190.20.10.113] Command may disrupt existing ssh connections. Proceed with operation (y|n)? (y)

[nothing happens after this]

joshgoebel commented 10 years ago

I believe this has been asked and answered if you look thru the prior issues… but you have to work with what the shell provides… so maybe something like:

runner "echo y | ufw enable -f"

There is currently no way in Sprinkle to fully interact with a command. Most commands honestly provide a command line parameter to kill prompts so this isn't necessary. You should check the ufw docs and see if it doesn't have such a switch.