ansible-redis icon indicating copy to clipboard operation
ansible-redis copied to clipboard

Cannot install redis and redis-sentinel on the same host?

Open drsharp opened this issue 3 years ago • 1 comments

I noted that tasks/main.yml has this:

- include: server.yml
  when: not redis_sentinel
  tags:
    - config

- include: sentinel.yml
  when: redis_sentinel
  tags:
    - config

Because of the when conditionals, it appears that it will only run one or the other. Thus, depending on the true/false of redis_sentinel variable, it will only install redis server or the sentinel.

However, I need to have both for my configuration.

Could a second variable be used instead? maybe something like this:

- include: server.yml
  when: redis_server
  tags:
    - config

- include: sentinel.yml
  when: redis_sentinel
  tags:
    - config

That way the two variables: redis_server and redis_sentinel could be set independently.

drsharp avatar Oct 30 '20 21:10 drsharp

You could also run two plays..

rndmh3ro avatar Nov 27 '20 19:11 rndmh3ro