Configuration Managment Best Practice: List of Packages to install

Package names do differ on different platforms. Some call it httpd some apache2

Imagine your product supports RedHat, SuSE and Ubuntu. Each in two versions.

Do you keep six lists of packages to install in your configuration management?

AFAIK this question is valid for all common products like Salt, Puppet, Chef, Ansible

Update

This question got a lot of down-votes. For me this means: This question is known and a lot of people hate the situation. And: No one has an answer.

I found this: There is a project on github which tries to bring sanity into this package naming chaos:

https://github.com/unixpackage/unixpackage

One command to install equivalent packages in Ubuntu, Debian, CentOS, Fedora, Red Hat and Mac OS X.
UnixPackage is a UNIX independent way of installing packages. Specify the Ubuntu package name (e.g. libpq-dev), and it will install the equivalent on your system (e.g. postgresql-libs on Arch).

Answer

I guess there is no real best practice because it is IMHO not a good practice to maintain a zoo of distributions in a network. Beside package names many other things (usernames, paths, etc) differ among different distributions. However every configuration management system will feature a way to solve this problem.

The Ansible way is to do something like this for tasks:

- include: setup-RedHat.yml
  when: ansible_os_family == 'RedHat'

and for the variable setup something like this:

- name: Include OS-specific variables.
  include_vars: "{{ ansible_os_family }}.yml"

The file setup-RedHat.yml would then contain all the tasks specific to RHEL distributions and the variable file redhat.yml all the variable declarations specific to RHEL distributions.

Attribution
Source : Link , Question Author : guettli , Answer Author : Henrik Pingel

Leave a Comment