How do I provide dpkg configuration parameters to aptitude or apt-get?

Posted by troutwine on Server Fault See other posts from Server Fault or by troutwine
Published on 2011-11-12T23:45:00Z Indexed on 2011/11/13 1:54 UTC
Read the original article Hit count: 651

Filed under:
|
|
|
|

When installing gitolite I find that:

# aptitude install gitolite
The following NEW packages will be installed:
  gitolite 
0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 114 kB of archives. After unpacking 348 kB will be used.
Get:1 http://security.debian.org/ squeeze/updates/main gitolite all 1.5.4-2+squeeze1 [114 kB]
Fetched 114 kB in 0s (202 kB/s)
Preconfiguring packages ...
Selecting previously deselected package gitolite.
(Reading database ... 30593 files and directories currently installed.)
Unpacking gitolite (from .../gitolite_1.5.4-2+squeeze1_all.deb) ...
Setting up gitolite (1.5.4-2+squeeze1) ...
No adminkey given - not initializing gitolite in /var/lib/gitolite.

The last line is of interest to me. If I run dpkg-reconfigure -plow gitolite I am presented with a dialog and can modify:

  • the system user name for gitolite,
  • the location of the gitolite repositories and
  • provide the admin pubkey.

I'd prefer to use the git system user and provide the admin pubkey on installation, say something of the sort:

# aptitude install gitolite --user git --admin-pubkey 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDAc7kCAi2WkvqpAL1fK1sIw6xjpatJ+Ms2nrwLJPhdovEY3MPZF7mtH+rv1CHFDn66fLGiWevOFp...'

That, of course, doesn't work. Can something similar be done? How do I determine the configuration parameters ahead of time? This would be remarkably useful, for instance, when installing gitolite automatically, via puppet or chef.

© Server Fault or respective owner

Related posts about debian

Related posts about puppet