Advice needed for multi-distro, simple configuration methods

Colin Law clanlaw at gmail.com
Tue Dec 24 08:03:17 UTC 2019


On Tue, 24 Dec 2019 at 06:59, M. Fioretti <mfioretti at nexaima.net> wrote:
> ..
> I know that Ansible is the simplest of the "big" CM systems. I have no
> problem to study and use it, if it is the best tool for the job. I am
> just not sure that it is simpler and more efficient in my own case,
> where I need no more than 10/12 programs, but almost each of them
> wants a different packaging system. To install them, I would have
> install on each distribution:
>
> ruby gems, perl modules, python packages, Go packages, npm (holy crap,
> npm), self installing bash scripts, snap, flatpak...
>
> In general, there are programs that are available as .deb on some
> systems, and any of the systems above on other distros. Or programs
> that want their own different versions of the same system. As in "hey,
> to install this, just use pip, but only THIS version of pip and
> python". 3 programs, 3 different sandboxes.
>
> Would Ansible be better, in this case of mine which is admittedly a
> bit extreme, be more efficient of one bash script that just goes like:

I can't comment on whether Ansible would be the best as I have no
experience of the others.  However the big advantage over writing bash
scripts is the idempotent nature of ansible, which means that commands
are not run unless necessary.  So once you have ansible tasks setup
for a particular system, if you want to add a new package or change
the required version of a package or apply some other adjustment you
just need to change that bit of the script and then run the whole
setup again.  You don't need to add lots of code to cope with the fact
that parts of the system may already be setup.

It should only take a few hours playing with Ansible to get the gist
of what it is about so I suggest you give it a go.  When I did that I
was quickly hooked by the ease of use and the power of the tool, plus
the large number of modules available for setting up stuff.  For
example you mentioned npm, have a look at this module for installing
node.js packages using npm.
https://docs.ansible.com/ansible/latest/modules/npm_module.html

Colin




More information about the ubuntu-users mailing list