DavidWittman/ansible-redis — pull request #25 by jabclab (2014-06-09 09:59:53+00:00)
Title: Idempotent config management

In order to guarantee idempotence for management of config files (both `redis-server` and `redis-sentinel`) I propose the following set of changes which will lead to config files looking like:

```
$ cat /etc/redis/6379.conf
include /etc/redis/6379.dyn.conf # <-- file which contains what /etc/redis/6379.conf did before
```

This file is solely created if it was not present before. Therefore if Redis writes dynamic config via [`CONFIG REWRITE`](http://redis.io/commands/config-rewrite) the file will not be touched. As the dynamic config will come after the `include` it will take precedence of the default config.

I've applied the same principle for the sentinel config too, e.g.

```
$ cat /etc/redis/sentinel_26379.conf
include /etc/redis/sentinel_6379.dyn.conf
```

:smile: