I've got a salt script that is being executed with state.sls
like this:
salt '*' state.sls foo.bar
In my script I've got this:
foo-bar:
cmd.run:
- php foo.php bar --delete
- cwd: /srv/foo
The --delete
flag will cause the script to truncate a database first. My problem is that it asks a question and expects an input.
root@host:/srv/foo# php foo.php bar --delete
This is going to remove all data in the database. Are you sure? [y/n]:
Because salt doesn't know how to answer that it will time out and abort and do things that I did not intend.
The salt docs on cmd.run
did not say anything about doing this and I am not sure what to google for exactly. I know that in a Perl implementation I would use Expect to do this.
How do I tell salt to please answer with y
?