Answer a question after a command has been run in a init.pp in a module.

19 views
Skip to first unread message

JGonza1

unread,
Oct 9, 2012, 2:26:37 PM10/9/12
to puppet...@googlegroups.com
I have the command below in a init.pp file that I run to startup splunk for the first time but it outputs the license agreement which requires to input a y or n. Is there a way to input a y after the lincese agreement?
 
exec { "start":
     command => "/opt/splunkforwarder/bin/splunk start",
  }
I have tried to redirect a y in the command below but it did not work.
exec { "start":
     command => "/opt/splunkforwarder/bin/splunk start < y",
  }
 

Gonzalo Servat

unread,
Oct 9, 2012, 5:06:34 PM10/9/12
to puppet...@googlegroups.com
On Wed, Oct 10, 2012 at 5:26 AM, JGonza1 <jgonz...@gmail.com> wrote:
I have the command below in a init.pp file that I run to startup splunk for the first time but it outputs the license agreement which requires to input a y or n. Is there a way to input a y after the lincese agreement?

To accept the license automatically when you start Splunk for the first time, add the accept-license option to the start command:

$SPLUNK_HOME/bin/splunk start --accept-license
- Gonzalo

Michael Dodwell

unread,
Oct 9, 2012, 6:36:53 PM10/9/12
to puppet...@googlegroups.com
For future reference you where trying to do: command => "yes | /opt/splunkforwarder/bin/splunk start",

'yes' is a unix program that will type 'y' over and over again.. you could also of used 'echo y | <splunk>' if you needed just 1 y..
Reply all
Reply to author
Forward
0 new messages