Hi,
Better late than never, thanks guys for commenting on my pbook extract.
A few replies here, sorry for being long.
TL;DR: on the difficulty of having host-agnostic per-service playbooks
I'd like to hear what you think. It's a bit long for the list, so
I wrote a gist on it :
https://gist.github.com/leucos/4953943
Thanks for your time if you read it !
I left a comment on the gist. Why don't you move this to
Thanks, I've reproduced them here.
a collaborative editor, e.g. http://titanpad.debian.net ?
Well, you can fork gists too though I agree hat for gists is it not
really convenient (no PR AFAIK).
But done anyway :
http://titanpad.com/RFU9FrzGGS
I'm in the process of curating sensible data from my playbooks. When
done, I'll create a GH repos. We need more playbook examples, I'll try
to add my 2 cents to the mix.
I have two comments:
Wouldn't it be better not to include the tmux playbook on machines
that don't get tmux, rather than turning it into a play
conditional play?
Yes, sure. This is why I have 'per machine top level' playbooks.
For instance, goat.example.com will have a goat.e.c.yml playbook.
So yes, "only_if: ${tmux.install}" is probably an overkill safety
measure in this case.
A case could be made for tmux.install==False causing tmux to be
purged from the system, but you don't do that.
Yes right, thats is an idea ! I wouldn't do that right now, since I'm
in the process of migrating hosts under ansible management. Some of
them are partly managed with ansible, and some of them appear in
inventory jyst because their IP is needed somewhere else (firewall
deployment on other hosts).
So I wouldn't like ansible to uninstall my cyrus server just because I
messed up things.
When all hosts will be under ansible management, this is definitely a
great idea.
And even if you did, I think there are numerous cases where
parametrisation via variables should actually affect the
composition of the playbook, not just the behaviour.
Yes, this is true, and I'm still scratching my head for this. I might
end up with generic services playbooks, and some specific
configuration playbooks. For instance, a generic postfix playbook that
uses a relayhost (just for emailing out stuff), and a dedicated,
specific playbook for our much more complex MX.
Something like :
- include: host-specific/smtp.example.org/setup.yml
# contains postfix configuration for smtp.example.org
in the "host-dedicated top level playbook" could do the trick.
However, it would kill idempotency since configurations installed by
the postfix "service playbook" would be overwritten at every run (and
vice-versa).
Have a look at
https://groups.google.com/forum/?fromgroups=#!topic/ansible-project/HetiQdNKOj4
and the referenced post to the salt-users list and chime in (on the
ansible list of course).
Thanks a lot for your comments Martin !
I'm currently reworking my service bundles to contain separate
playbooks for each host (or group of hosts) that need to be
managed differently.
That could be interesting to see. Do you have an example ?
Being able to include task files and even other playbooks means
these playbooks can be quite short and simply express the required
host to task mapping, as data. This also means I can run playbooks
without having to use overly complicated command line arguments (or
script wrappers).
I personnaly end up running stuff like this :
abk -l host.example.org h.e.o.yml
where h.e.o.yml is a "top level" playbook including service playbooks :