On Wed, 10 Jun 2015 08:43 -0700, Christian Thiemann <[email protected]> wrote: > I want all my Apache installation to behave the same on all OSs -- I want > to write one logical model of how Apache should work, and all OS > differences should just be different views of that model. > > Thus, this is how my "install Apache packages" task looks like -- one > task, > one data structure, thanks to some YAML magic: > > - include: install_packages.yml > pkgs: !platform > - apache:: > Debian: apache2 > RedHat: httpd > - mod_authnz_external:: > Debian: libapache2-mod-authnz-external > - python-passlib:: # needed for Ansible's htpasswd module > Gentoo: dev-python/passlib > - pwauth > tags: > - apache/setup
All this magic feels like more typing and wasted brain cells than keeping separate lists per distribution. I've come to the conclusion that in Ansible you either hide complexity in modules, roles or playbooks, in that order. If the module isn't featured/mature enough (and you don't want or can't improve it), you write roles that do the magic you need. It gets all hidden from you and the playbooks look very clean. Otherwise you let the imperfection fall through and deal with it in the playbooks, with command-line options and what not. I don't know what's best for your situation. It seems a role encapsulating these "imperfections" might be enough.. or you could write a module for completely managing Apache (from install to deploying new websites). They say, Ansible is a radically simple IT automation engine... I think it's much more flexible than simple (perhaps simpler compared to the absolute insanity of other automation tools). That comes with its drawbacks. Giovanni -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1433952787.4059597.292010313.74B9EACD%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout.
