William-Yeh/ansible-fluentd

Setting up configuration breaks idempotency.

Opened this issue · 1 comments

First, thanks for writing the role!

I have a convoluted problem to explain. So bear with me. Your role does two things:

  1. Install fluentd
  2. Setup fluentd configuration

I think you made a good assumption about (2). If people either provide you a straight config or template, you use that and generate a config. But if either of that isn't provided, you use the one from the role. This is all good except this part is not idempotent https://github.com/William-Yeh/ansible-fluentd/blob/master/tasks/main.yml#L31.

Also, you made assumptions about the location of the said user supplied config files and template files. In our case, we have a different layout so those blocks are not useful. So I basically have another role that sets up the config we want for aggregator and forwarder. I use your role to just install the bits. However, the non-idempotent block causes our builds to fail because you always backup the original config and replace it with role config :).

I opened a PR to optionally setup configuration. I set the default to True so it doesn't break existing behavior. Wdyt?