Is there a distro-agnostic configuration management software?
Technically, Ansible is that; because it's agent-less; I've used it to manage routers, switches, servers, etc.
What it seems like you're asking for is if the package
module supports Arch Linux? I'm too lazy to test if that supports Arch; but if it doesn't there is always the pacman
module... And if that doesn't work... There is always writing your own module.
What you're speaking of though is a larger problem with running multiple different distributions in a production environment. It becomes painful to manage long term. This is why it's good practice to not run multiple distributions in production, as from a management perspective (purely from code), it's a lot of work. The most obvious way to get around this is with Ansible using when
in combination with os_family
:
apt:
name: apache2
when: ansible_facts['os_family'] == "Debian"
pacman:
name: nginx
when: ansible_facts['os_family'] == "Archlinux"
I've been in a situation where I had to manage Debian Servers and CentOS servers in production; eventually I made the choice to go pure Debian because:
- The codebase for CM was cut in half (all the logic for distro specific quirks was removed).
- Testing became less painful (if you're not testing your CM code, then you're doing it wrong).
You'll also run into major differences anyways; for example:
- Some packages are named differently;
httpd
(RHEL) vsapache2
(Debian). - Different "default" configuration directories;
/etc/default
(Debian) vs/etc/sysconfig
(RHEL). - Different init systems; although
systemd
has largely taken over. - No SSH; for example WinRM for Windows.
Configuration Management systems are a way of abstracting the environment into code; and they give you logic/conditionals to do that yourself.
Maintaining a meta-package-manager seems to me to be a Sisyphean task, as someone would have to be maintaining some sort of "apache2" in Debian-likes is "httpd" in RHEL-likes (et cetera) Rosetta Stone.
However, there is a pacman module for Ansible which is purpose-made for using Ansible (the disto-agnostic management tool you're looking for) to manage packages on Arch-like systems. From the Examples section of the linked module's documentation:
- name: Install package foo
pacman:
name: foo
state: present
- name: Upgrade package foo
pacman:
name: foo
state: latest
update_cache: yes
- name: Remove packages foo and bar
pacman:
name: foo,bar
state: absent
- name: Recursively remove package baz
pacman:
name: baz
state: absent
recurse: yes
package is Ansible "Generic OS package manager".
An option would be to include OS specific list_of_packages
- include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "default.yml"
paths: "{{ role_path }}/vars"
and install the packages
- package:
state: present
name: "{{ item }}"
loop: "{{ list_of_packages }}"