You are not logged in.

#1 2022-04-28 21:22:51

Neven
Member
Registered: 2014-05-02
Posts: 74

How to manage identical configuration files across multiple PCs/VMs?

Suppose, for example, that I want to configure Systemd's behavior on pressing the machine's power key for all personal Archlinux machines (two laptops in my case).

Creating a file like this in /etc/systemd/logind.conf.d is enough to configure Systemd:

[Login]
HandlePowerKey=suspend

To make this scale across separate machines, I could create a package that would contain this configuration file in /etc/systemd/logind.conf.d, and other ones, too.

This approach has a fatal flaw, though: suppose I want to change my xinit configuration or my vim configuration, so I'm modifying /etc/X11/xinit/xserverrc or /etc/vimrc; I can't do this with a package because the files are already owned by existing packages (xorg-xinit or vim-runtime, in this example).

Any ideas?

Offline

#2 2022-04-29 06:29:40

seth
Member
Registered: 2012-09-03
Posts: 49,967

Re: How to manage identical configuration files across multiple PCs/VMs?

Those are user specific configs anyway and if you want to supply the user w/ a default config on user creation, that's for /etc/skel - or a very popular fashion is to abuse github for that and manage your user configs ("dotfiles") through git.

Offline

#3 2022-04-29 08:17:06

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,784
Website

Re: How to manage identical configuration files across multiple PCs/VMs?

Ansible.

Mod note: not Arch discussion, moving to System Administration


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2022-04-29 10:37:27

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: How to manage identical configuration files across multiple PCs/VMs?

I'd say system files with "system config packages" and/or config management tools like Ansible, Salt, ….
User configuration with Git or any other VCS (see "dotfiles" in the Arch Wiki or anywhere else online).

Xinit and Vim configuration (and other similar things) are user config, and ideally you don't touch system files for that.

Last edited by ayekat (2022-04-29 10:38:15)


pkgshackscfgblag

Offline

#5 2022-05-04 08:01:05

Neven
Member
Registered: 2014-05-02
Posts: 74

Re: How to manage identical configuration files across multiple PCs/VMs?

Offline

Board footer

Powered by FluxBB