scripting interactivity

20 views
Skip to first unread message

Ivan Storck

unread,
Oct 19, 2011, 5:45:58 PM10/19/11
to babush...@googlegroups.com
As a babushka new user, who is absolutely fascinated with it, I could really use some pointers on scripting a new ubuntu install with interactivity. 

Issue 1)   how to reconfigure debconf to be interactive?
I normally do dpkg-reconfigure debconf and then type in 2 for deadline, and then 2 for high
how would I write this as a dep ?

Issue 2)  how to configure ddclient non-interactively

I have a start of my dep here but could use pointers on making it prompt for hostname and password

Thank you!

Alan Harper

unread,
Oct 19, 2011, 5:48:54 PM10/19/11
to babush...@googlegroups.com
Hi Ivan,

It's been a while but I'd go look at the debconf docs. IIRC you can put scripted answers somewhere, and debconf will refer to these instead of prompting you. I'd dare say this is the answer to your ddclient answer as well.

Cheers,
Alan

Paul Annesley

unread,
Oct 19, 2011, 6:14:35 PM10/19/11
to babush...@googlegroups.com
I've used the following to suppress prompting for a MySQL root password:

shell "echo mysql-server-5.0 mysql-server/root_password password '' | sudo debconf-set-selections"
shell "echo mysql-server-5.0 mysql-server/root_password_again password '' | sudo debconf-set-selections"

(They're pairs of single quotes after the word "password")

Cheers,
Paul

Ivan Storck

unread,
Oct 19, 2011, 6:21:57 PM10/19/11
to babush...@googlegroups.com
thanks for the quick replies! 

for issue 1, configuring debconf, I've used this line in my 'base server' sep

sudo "dpkg-reconfigure debconf -f readline -p high"

for issue 2, configuring ddclient,  I am still looking into ddclient and apt options. it would help if I knew all the available commands from babushka. I've tried reading the yarddoc and other deps but i still don't quite 'grok' it yet. 

Ben Hoskings

unread,
Oct 19, 2011, 6:49:06 PM10/19/11
to babush...@googlegroups.com
I'm not sure if this will work for dpkg-reconfigure, but you can pass input to a shell command with the :input option. A good example of this is my dep to generate self-signed ssl certs:

https://github.com/benhoskings/babushka-deps/blob/master/nginx.rb#L69-81

You just supply each piece of input with a newline following it, to simulate hitting enter between each one.

- Ben

On 20/10/2011, at 8:45 AM, Ivan Storck wrote:

Reply all
Reply to author
Forward
0 new messages