[SOLVED]Preconfiguring a package for numerous installations

Kernels & Hardware, configuring network, installing services

[SOLVED]Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-19 07:55

Hello,

I have to install a package on several dozen machines. This package asks several questions during its installation (it's to join a Debian machine to a Windows network, with winbind/kerberos).

I'd like to have this package install without me having to type the same answers to these questions on each machine. I have read the manpages about debconf but I find them vague: if I do a dpkg-preconfigure, is there somewhere a file that is created with the answers to the questions, so that I can then copy this file on another machine and have the package install non-interactively?

Sorry if it's a FAQ or a vague question, but I'm not very knowledgeable about Debian, and I have a hard time understanding the info I find on the web.

Thanks for any help.

F. Delente
Last edited by fdelente on 2020-08-22 13:28, edited 1 time in total.
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby Head_on_a_Stick » 2020-08-19 09:42

fdelente wrote:if I do a dpkg-preconfigure, is there somewhere a file that is created with the answers to the questions, so that I can then copy this file on another machine and have the package install non-interactively?

See debconf.conf(5).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12488
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-19 12:01

Yes, I have looked this manpage (debconf.conf) and others (deconf and confmodule) but I didn't find an example that would help me set up my system.

The manpage of dpkg-preconfigure says that all answers can be given in advance, and stored in a LDAP database, but I don't want (don't know and am not interested in that solution), but can a file be used instead?

The package that asks for parameters is https://deb.sambaedu.org/debian/pool/st ... 96_all.deb

It's a package that manages the integration of a Linux machine in an Active Directory architecture.

I looked inside the package at the doinst script, but it doesn't make reference to another package or to parameters.

However, when I install it on a machine, I have several questions about the Kerberos realm, the admin password, etc. I'd like to not have to type these (they are to be the same) on every machine I have to install.

Thanks again.
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby stevepusser » 2020-08-21 03:28

Can the developers of the package help you with the possible location of a file with the answers? Normal Linux global config files go into /etc.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 11983
Joined: 2009-10-06 05:53

Re: Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-21 04:54

I've asked the developers, but they didn't seem much at ease with debconf and couldn't really give me any hint on how to do!
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby cuckooflew » 2020-08-21 11:30

but can a file be used instead?

My approach would be to make a copy, or take notes, and put them in a file.
EG: On the first install and set up procedure, copy/paste your answers/responses to a file, keep that handy,...When you do the next install, instead of typing each response letter by letter,you can use the mouse and copy/paste the text from your list file, one word or string at a time.
========
Also find all the conf files that contain the information for the configurations,
On some of my laptops, all I do is copy the conf files , from my main PC, to the new system on the lap top.
I would also look at installing the packages needed, as part of the initial install, Some logic applied to this could go a long way.
One of the best examples of a auto install method, script that I know of is the OpenBsd autoinstall option, something similar probably could be made and applied to Debian package installations, if you don't like or want to use the debconf.conf method :
The manpage of dpkg-preconfigure says that all answers can be given in advance, and stored in aLDAP database, but I don't want (don't know and am not interested in that solution),

Yes , the first time it might be difficult, since you don't know, you will need to do some study/research, and perhaps trial and error. There is plenty of information about LDAP database and it's use.
fdelente wrote:I've asked the developers, but they didn't seem much at ease with debconf and couldn't really give me any hint on how to do!

Perhaps they just don't know how. There also are security issues to consider,
eg: Do you really want to use the same password on ever machine in the network, that seems pretty risky to me, How many machines are involved ? The packages that you want to install only need to be installed once,...if it is to tedious for your taste, or you are just to busy, maybe have the secretary do it, or you could look into hiring some one that has experience with this sort of thing, I think a IT expert could set everything up in less then a hour, but I might be wrong. And am almost going to drift off topic, so any way,...
guess that is about it.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-21 11:40

Thanks for your answer, unfortunately it's my « job » to do it (not really but I have been assigned the task) and I have about 300 or 400 machines to install... so whether typing by hand or copy/pasting will be tedious for that amount!
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby cuckooflew » 2020-08-21 13:25

Ahh, Ok, well your welcome,
That is a lot of installs....
You mention :
« job » to do it (not really but I have been assigned the task)

I can't help but wonder, is this some kind of home work project, or How is it you were assigned,...I would ask who ever assigned you this task , if they could also assign some others with some coding / shell scripts skills, and interest,
If and when you, make a file with all the info/data , responses that need to be submitted, that is the first step, in producing a script that could be used as a "auto installer",... Yes, it would be tedious to copy/paste the responses 400 times, but once you have that info, you can create a script, that does the copy/paste routine, I still think you need to reconsider using the same password on all 400 machines, all some one needs to do is hack 1 password and they could cause a lot of damage to all 400 of the machines, eg: the entire network. ...
I am looking at this: https://www.sambaedu.org/Via google translate,
Project display

SambaÉdu is a free educational server solution under GNU / Linux ( Debian ) which uses open source technologies: Samba - Php - MySQL and implements the free version of Active Directory.

A web interface allows the administration of the device by a person not familiar with GNU / Linux .

Designed, developed, maintained and supported primarily by teachers, SambaÉdu offers all the expected services, allowing teaching teams to have an adapted tool combining flexibility and robustness. Thus, during the health crisis of spring 2020, various modules appeared (Guacamole, BBB, NextCloud, FreeRadius, etc.) to meet the needs of teachers and their students.-----snip---

Since it is in French, it is hard for me to follow the website info, but it appears to be a extensive project, seems like you should be communicating with the developers, I know you said you had,
fdelente wrote:I've asked the developers, but they didn't seem much at ease with debconf and couldn't really give me any hint on how to do!
, again, maybe they don't have to use debconf, all though this is what it is intended for, (I think), but it seems like maybe they would have some alternative method they would prefer, and could help you with that,.. Surely if they have the skill to build and develop this software,they have some people that are familiar with shell scipts, etc,..?
To Contribute
To contribute

There are several ways to contribute to the project:


join the SambaÉdu association

participate in the writing of the documentation, if only by proofreading this documentation

participate in the coding of the different modules of the project, any contribution, even episodic, is welcome

by reporting dysfunctions

by requesting features
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Preconfiguring a package for numerous installations

Postby neuraleskimo » 2020-08-21 14:43

I suspect this isn't the direction you want to go, but an orchestration tool might help. I use Ansible and many of my colleagues like/use Salt, but there are others. What these tools do is allow you to write scripts and apply changes across a large number of systems. While Ansible (for example) has modules for apt, for you, a brute-force approach might be best. That is, install the package once and then copy all of the files (binaries and config) to all of the machines and then use the orchestration tool to customize the config files as needed for each machine. The downside is that apt won't "know" about the binaries.

BTW, you would deploy updates the same way. Good luck.
Black Lives Matter
User avatar
neuraleskimo
 
Posts: 193
Joined: 2019-03-12 23:26
Location: Bloomington, Indiana, USA

Re: Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-21 14:47

Thanks for the tip, I'll look into it!
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby Head_on_a_Stick » 2020-08-21 16:38

Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12488
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-21 16:45

debconf-set-selections seems interesting. Is there a way I can extract the answers I have typed on a machine, to create the file that I'll be able to use on another machine? I have tried a 'locate debconf|grep db' to find the database file of debconf (so I can read the names of the questions and the answers to give in it) but I didn't find anything relevant. Is the database in a file, or does it use SQL or something like that?

Thanks!
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby Head_on_a_Stick » 2020-08-21 16:48

fdelente wrote:Is there a way I can extract the answers I have typed on a machine, to create the file that I'll be able to use on another machine?

See debconf-get-selections(1).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12488
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Preconfiguring a package for numerous installations

Postby fdelente » 2020-08-21 16:50

OK thanks very much, I'll try this tomorrow! I cross my fingers :^)
fdelente
 
Posts: 11
Joined: 2012-12-02 14:32

Re: Preconfiguring a package for numerous installations

Postby neuraleskimo » 2020-08-21 16:56

Ah, when I skimmed the previous posts, I thought you had ruled that out. If you follow HOASes excellent advice, you can still use an orchestration tool to deploy the package by using the builtin package manager support.

If you want to try Ansible, all you need is "sudo apt install ansible". Here is the documentation: https://docs.ansible.com/
In particular, take a look at:
https://docs.ansible.com/ansible/latest ... apt-module
https://docs.ansible.com/ansible/latest ... ons-module
Black Lives Matter
User avatar
neuraleskimo
 
Posts: 193
Joined: 2019-03-12 23:26
Location: Bloomington, Indiana, USA

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable