Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #268976

Re: Current best practices for system configuration management?

From Tim Woodall <debianuser@woodall.me.uk>
Newsgroups linux.debian.user
Subject Re: Current best practices for system configuration management?
Date 2024-04-21 11:30 +0200
Message-ID <IvBGh-7PTD-3@gated-at.bofh.it> (permalink)
References <IuKiC-7fyI-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 18 Apr 2024, Mike Castle wrote:

> Now, I would like to expand that into also setting up various config
> files that I currently do manually, for example, the `/etc/apt/*`
> configs I need to make the above work.  For a single set of files,
> manual isn't bad, but as I want to get into setting up LDAP, autofs,
> and so on, it is time to explore solutions.  I only have four systems
> at the moment (two physical and two virtual), so I don't think I need
> something too fancy.
>
I do this - but it needs a bit of thought as to how you want to do it.

I'm assuming you don't care about debian policy ...

I do one of four things in packages depending on what I want to achieve
and what the package I'm configuring supports.

1.(easiest) - just drop a config file into a conf.d directory. I
use this for maintaining sources.list. Back in the buster days I was
using openssh from backports that supported this as maintaining the
config is so much easier than any of the other ways and so much easier
to fix bugs in your packages - a failing postinst script can be a pain
to resolve.

apt-mirror@aptmirror19:~ (none)$ apt-cache search bookworm-sources
bookworm-sources - Meta-package to pull in list of apt-sources for debian

(I generate these packages automatically from what is available on
deb.debian.org.)

FWIW, I also have a dev repo and a fast repo - the dev repo is a clone
where I can test out substantial changes and the fast repo only has a
couple of packages but can rebuild "the world" very quickly when I'm
testing. So I have a number of extra levels of indirection to support
this:

$ apt-cache depends bookworm-sources
bookworm-sources
   Depends: bookworm-local-sources

That is the normal package that I would install.

apt-mirror@aptmirror19:/mnt/mirror/local/main/o (master)$ apt-cache depends bookworm-dev-sources
bookworm-dev-sources
   Depends: bookworm-dev-main-sources

That lets me use the dev repo - and thanks to pinning, the packages in
it will replace (even downgrade) packages from local.

Ditto for my fast repo.

2. (next easiest) - add a file in /usr/share/ and then overwrite the
file in /etc by copying in postinst.

3. edit the config file without diverting it using a sed script.

4. divert the config and edit/replace it in the package.

3. and 4. in particular can make upgrades more difficult if/when you
find bugs in the way you're handling diversions and uninstalls.

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Current best practices for system configuration management? Mike Castle <dalgoda@gmail.com> - 2024-04-19 02:30 +0200
  Re: Current best practices for system configuration management? Dan Ritter <dsr@randomstring.org> - 2024-04-19 03:00 +0200
    Re: Current best practices for system configuration management? Alexandre Rossi <niol@zincube.net> - 2024-04-19 08:40 +0200
  Re: Current best practices for system configuration          management? Linux-Fan <Ma_Sys.ma@web.de> - 2024-04-19 17:30 +0200
  Re: Current best practices for system configuration management? Andy Smith <andy@strugglers.net> - 2024-04-19 22:50 +0200
  Re: Current best practices for system configuration management? Mike Castle <dalgoda@gmail.com> - 2024-04-21 02:00 +0200
    Re: Current best practices for system configuration management? John Crawley <john@bunsenlabs.org> - 2024-04-21 03:20 +0200
    Re: Current best practices for system configuration management? Mike Castle <dalgoda@gmail.com> - 2024-04-21 04:10 +0200
      Re: Current best practices for system configuration          management? Linux-Fan <Ma_Sys.ma@web.de> - 2024-04-24 18:30 +0200
    Mesh VPN on Debian (Was Re: Current best practices for system  configuration management?) Andy Smith <andy@strugglers.net> - 2024-04-21 15:40 +0200
    Re: Current best practices for system configuration management? Mike Castle <dalgoda@gmail.com> - 2024-05-27 18:40 +0200
  Re: Current best practices for system configuration management? Tim Woodall <debianuser@woodall.me.uk> - 2024-04-21 11:30 +0200

csiph-web