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
If I had separate include files per OS, then my list of packages would be
duplicated in multiple files -- I mean the logical list of packages (i.e.,
"apache" + "mod_authnz_external" + "python's passlib"). If I have to add
another mod_foobar in the future, I only have to add it to one list instead
of having to remember to maintain multiple OS-dependent representations in
multiple places.
On Monday, June 8, 2015 at 7:15:59 PM UTC+2, Brian Coca wrote:
>
> @Adam,
>
> Agreed, this workaround just offsets the work of having 2 tasks to
> having 2 data structures and is more limited than the other version,
> this is one of the reasons why we do not recommend it, but it is
> available if people insist going down that path.
>
>
> --
> Brian Coca
>
--
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/c138e7cc-9bac-46c4-bf75-deca40e290f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.