Hello all,
I have been running on occasion into situations where an incomplete run
could leave a system in inconsistent state. This has mostly happened in
cases where handlers are in use.
As an example, let's say you have a task populating /etc/aliases for
Postfix. In order for Postfix to be able to use the data, /etc/aliases
has to be compiled using the newaliases command. This is a natural fit
for a single Ansible task + handler (this is a very simple case, I've
had some more complex cases too).
The problem stems from the fact that Ansible playbook run could fail
before the handler fires off - leaving the /etc/aliases file updated,
but not the /etc/aliases.db (created via newaliases command).
I am aware of the "force_handlers = True" option, however that won't
help in cases where failure is, say, due to SSH connection dropping
etc.
From what I can tell, this scenario possibly happens exclusively when
using handlers, since those are rather stateless (I'm sure you could
also trigger such behaviour with poorly designed command/shell
combination of tasks).
How do folks usually handle such situations?
Best regards
--
Branko Majic
Jabber:
bra...@majic.rs
Please use only Free formats when sending attachments to me.
Бранко Мајић
Џабер:
bra...@majic.rs
Молим вас да додатке шаљете искључиво у слободним форматима.